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]]

Revision as of 14:43, 16 December 2013

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);





blog comments powered by Disqus

Download and install File:Pmcdriver.zip




blog comments powered by Disqus