ia64/xen-unstable

view tools/misc/cpuperf/cpuperf_perfcntr.h @ 6403:6e899a3840b2

Rename libxc => libxenctrl and xc.h => xen/xenctrl.h
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 24 23:07:29 2005 +0000 (2005-08-24)
parents cfee4c4a8ed6
children
line source
1 /*
2 * Interface to JRB44's /proc/perfcntr interface.
3 *
4 * $Id: cpuperf_perfcntr.h,v 1.1 2003/10/13 16:49:44 jrb44 Exp $
5 *
6 * $Log: cpuperf_perfcntr.h,v $
7 * Revision 1.1 2003/10/13 16:49:44 jrb44
8 * Initial revision
9 *
10 */
12 #define PROC_PERFCNTR "/proc/perfcntr"
14 static inline void perfcntr_wrmsr(int cpu_mask,
15 int msr,
16 unsigned int low,
17 unsigned int high )
18 {
19 FILE *fd;
20 unsigned long long value = low | (((unsigned long long)high) << 32);
22 fd = fopen(PROC_PERFCNTR, "w");
23 if (fd == NULL)
24 {
25 perror("open " PROC_PERFCNTR);
26 exit(1);
27 }
29 fprintf(fd, "%x %x %llx \n", cpu_mask, msr, value);
30 fprintf(stderr, "%x %x %llx \n", cpu_mask, msr, value);
31 fclose(fd);
32 }
34 static inline unsigned long long perfcntr_rdmsr( int cpu_mask, int msr )
35 {
36 fprintf(stderr, "WARNING: rdmsr not yet implemented for perfcntr.\n");
37 return 0;
38 }
40 // End of $RCSfile: cpuperf_perfcntr.h,v $