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.)
Some related posts are Cannot read back from MSR and rdmsr,wrmsr from c/c++ code