summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a4d9af6)
raw | patch | inline | side by side (parent: a4d9af6)
author | Vincent Brillault <git@lerya.net> | |
Sat, 23 Aug 2014 06:56:28 +0000 (08:56 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:40 +0000 (07:35 +0100) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index aef6628622af049978167182c902559d6fa39db3..6466d5c63a59d08db32dc01b34243a736c4ba08b 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
ERR_MSR_PKG_PERF_STATUS,
ERR_MSR_DRAM_PERF_STATUS,
ERR_MSR_IA32_PACKAGE_THERM_STATUS,
+ ERR_MSR_IA32_TSC,
ERR_CPU_NOT_PRESENT,
ERR_NO_MSR,
ERR_CANT_OPEN_FILE,
return 0;
}
-static unsigned long long
-rdtsc(void)
-{
- unsigned int low, high;
-
- asm volatile("rdtsc" : "=a" (low), "=d" (high));
-
- return low | ((unsigned long long)high) << 32;
-}
-
-
/*
* get_counters(...)
* migrate to cpu
return -ERR_CPU_MIGRATE;
}
- t->tsc = rdtsc(); /* we are running on local CPU of interest */
+ if (get_msr(cpu, MSR_IA32_TSC, &t->tsc))
+ return -MSR_IA32_TSC;
if (get_msr(cpu, MSR_IA32_APERF, &t->aperf))
return -ERR_MSR_IA32_APERF;