summaryrefslogtreecommitdiffstats
path: root/src/asm.h
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-07-25 13:58:41 +0200
committerLouis Burda <quent.burda@gmail.com>2022-07-25 13:58:41 +0200
commit7e2719c913c833bdd93b463f5a7dc878d5a22273 (patch)
treea008dcd0d07c6be5b19b9eec0e7330b025d9e215 /src/asm.h
parentb98fabdf4b91a6093b3d91f15cb55b21ab89c0f3 (diff)
downloadcachepc-7e2719c913c833bdd93b463f5a7dc878d5a22273.tar.gz
cachepc-7e2719c913c833bdd93b463f5a7dc878d5a22273.zip
Read program counters directly, add print and remove procfs approach for testing
Diffstat (limited to 'src/asm.h')
-rwxr-xr-xsrc/asm.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/asm.h b/src/asm.h
index 9509952..14c6593 100755
--- a/src/asm.h
+++ b/src/asm.h
@@ -25,10 +25,9 @@ cachepc_readpmc(uint64_t event)
uint32_t lo, hi;
asm volatile (
- "mov %[event], %%rcx\t\n"
- "rdpmc\t\n"
+ "rdmsr"
: "=a" (lo), "=d" (hi)
- : [event] "r" (event)
+ : "c"(event)
);
return ((uint64_t) hi << 32) | lo;