intel performance register

Entry #1293, Wed, July 10, 2002, 13:32 EST (Coding, Hacking, & CS stuff)
(posted when I was 23 years old.)
I gots to record this here, because every time I want to use it, I have to do a recursive grep through my entire cse directory tree to remember when I used it before and how I used it.

To access the intel performance register that stores the number of cycles executed so far:

  unsigned long long foo;
  __asm__ volatile (".byte 0x0f, 0x31" : "=A" (foo));


Perhaps there's a better way.
This entry is rated 5.0000/5 based on 2 ratings. You have not rated this entry.
[ previous entry ] [ next entry ]