Arjun Suresh (talk | contribs) |
Arjun Suresh (talk | contribs) |
||
Line 1: | Line 1: | ||
Download and install [[File:Pmcdriver.zip]] | Download and install [[File:Pmcdriver.zip]] | ||
+ | This install the kernel driver msrdrv which contains all the system calls needed for reading the performance monitoring counters in Intel machines. | ||
+ | |||
+ | So, in the user program just do the following: | ||
+ | 1. Load the driver | ||
+ | static int loadDriver() | ||
+ | { | ||
+ | int fd; | ||
+ | fd = open("/dev/" DEV_NAME, O_RDWR); | ||
+ | if (fd == -1) { | ||
+ | perror("Failed to open /dev/" DEV_NAME); | ||
+ | } | ||
+ | return fd; | ||
+ | } | ||
+ | 2. Send sata to driver | ||
+ | ioctl(fd, IOCTL_MSR_CMDS, (long long)msr_start); | ||
+ | |||
{{Template:FBD}} | {{Template:FBD}} | ||
[[Category:Technical]] | [[Category:Technical]] |
Download and install File:Pmcdriver.zip This install the kernel driver msrdrv which contains all the system calls needed for reading the performance monitoring counters in Intel machines.
So, in the user program just do the following: 1. Load the driver
static int loadDriver()
{
int fd; fd = open("/dev/" DEV_NAME, O_RDWR); if (fd == -1) { perror("Failed to open /dev/" DEV_NAME); } return fd;
} 2. Send sata to driver ioctl(fd, IOCTL_MSR_CMDS, (long long)msr_start);