From 7e2719c913c833bdd93b463f5a7dc878d5a22273 Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Mon, 25 Jul 2022 13:58:41 +0200 Subject: Read program counters directly, add print and remove procfs approach for testing --- src/asm.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/asm.h') 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; -- cgit v1.2.3-71-gd317