summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: abbfb4e)
raw | patch | inline | side by side (parent: abbfb4e)
author | Vincent Brillault <git@lerya.net> | |
Fri, 22 Aug 2014 22:49:40 +0000 (00:49 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:40 +0000 (07:35 +0100) |
We refuse to run if it's not true, so let's just assume it is
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index ca8551a999e8a1a5c335e2d0fec8e33127a8ab34..59ebefd640199663691e0914ff9f60fb94c53b8b 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
static unsigned int do_snb_cstates;
static unsigned int do_c8_c9_c10;
static unsigned int do_slm_cstates;
-static unsigned int has_aperf;
static unsigned int has_epb;
static unsigned int genuine_intel;
static unsigned int do_nehalem_platform_info;
t->tsc = rdtsc(); /* we are running on local CPU of interest */
- if (has_aperf) {
- if (get_msr(cpu, MSR_IA32_APERF, &t->aperf))
- return -ERR_MSR_IA32_APERF;
- if (get_msr(cpu, MSR_IA32_MPERF, &t->mperf))
- return -ERR_MSR_IA32_MPERF;
- }
+ if (get_msr(cpu, MSR_IA32_APERF, &t->aperf))
+ return -ERR_MSR_IA32_APERF;
+ if (get_msr(cpu, MSR_IA32_MPERF, &t->mperf))
+ return -ERR_MSR_IA32_MPERF;
if (do_smi) {
if (get_msr(cpu, MSR_SMI_COUNT, &msr))
}
/* GHz */
- if (has_aperf && ((!aperf_mperf_unstable) || (!(t->aperf > t->tsc || t->mperf > t->tsc))))
+ if ((!aperf_mperf_unstable) || (!(t->aperf > t->tsc || t->mperf > t->tsc)))
turbostat_submit(NULL, "frequency", name, 1.0 * t->tsc / 1000000000 * t->aperf / t->mperf / interval_float);
/* SMI */
*/
__get_cpuid(0x6, &eax, &ebx, &ecx, &edx);
- has_aperf = ecx & (1 << 0);
do_dts = eax & (1 << 0);
do_ptm = eax & (1 << 6);
has_epb = ecx & (1 << 3);
- if (!has_aperf) {
+ if (!(ecx & (1 << 0))) {
ERROR("No APERF");
return -ERR_NO_APERF;
}