- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From intel software developer manual 3b, I came to know MSR (10H) equal to RDTSC. So I wanted to verify it using piece of code as follows in my program:
asm volatile("rdmsr":"=a"(lo),"=d"(hi):"c"(0x10));
But when I run my program it showed segmentation fault. Then a realized the caution that it work only in privilege level 0. So I run the program again with sudo access. This time the program ran without seg fault but the statement after asm volatile(..) are not getting executed. Even it dint work out.
What shall I do to make rdmsr work in my program?
(I am using linux on i7 core which supports these counters. I verified it.)
Thank you
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How would you do this in the Windows OS?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know whether there is a WindowsOS native way to access the MSRs, probably through some debugging interface or such.
You can use the Windows driver from Intel PCM https://github.com/opcm/pcm to get an interface to the user space. For further information see the Windows HOWTO https://github.com/opcm/pcm/blob/master/WINDOWS_HOWTO.rtf
Here is also a link with some explanations how to install the driver: https://software.intel.com/en-us/forums/software-tuning-performance-optimization-platform-monitoring/topic/371243
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If it will be helpfull - good examples of how to use rd/wrmsr is the source code of Intel Performance Counter Monitor and Likwid.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page