Skip to content

Commit bfae205

Browse files
committed
tools/power turbostat: cpu0 is no longer hard-coded, so update output
The --debug option reads a number of per-package MSRs. Previously we explicitly read them on cpu0, but recently turbostat changed to read them on the current "base_cpu". Update the print-out to reflect base_cpu, rather than the hard-coded cpu0. Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 75fd7ff commit bfae205

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ dump_nhm_platform_info(void)
11571157

11581158
get_msr(base_cpu, MSR_NHM_PLATFORM_INFO, &msr);
11591159

1160-
fprintf(stderr, "cpu0: MSR_NHM_PLATFORM_INFO: 0x%08llx\n", msr);
1160+
fprintf(stderr, "cpu%d: MSR_NHM_PLATFORM_INFO: 0x%08llx\n", base_cpu, msr);
11611161

11621162
ratio = (msr >> 40) & 0xFF;
11631163
fprintf(stderr, "%d * %.0f = %.0f MHz max efficiency frequency\n",
@@ -1168,8 +1168,8 @@ dump_nhm_platform_info(void)
11681168
ratio, bclk, ratio * bclk);
11691169

11701170
get_msr(base_cpu, MSR_IA32_POWER_CTL, &msr);
1171-
fprintf(stderr, "cpu0: MSR_IA32_POWER_CTL: 0x%08llx (C1E auto-promotion: %sabled)\n",
1172-
msr, msr & 0x2 ? "EN" : "DIS");
1171+
fprintf(stderr, "cpu%d: MSR_IA32_POWER_CTL: 0x%08llx (C1E auto-promotion: %sabled)\n",
1172+
base_cpu, msr, msr & 0x2 ? "EN" : "DIS");
11731173

11741174
return;
11751175
}
@@ -1182,7 +1182,7 @@ dump_hsw_turbo_ratio_limits(void)
11821182

11831183
get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT2, &msr);
11841184

1185-
fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT2: 0x%08llx\n", msr);
1185+
fprintf(stderr, "cpu%d: MSR_TURBO_RATIO_LIMIT2: 0x%08llx\n", base_cpu, msr);
11861186

11871187
ratio = (msr >> 8) & 0xFF;
11881188
if (ratio)
@@ -1204,7 +1204,7 @@ dump_ivt_turbo_ratio_limits(void)
12041204

12051205
get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT1, &msr);
12061206

1207-
fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT1: 0x%08llx\n", msr);
1207+
fprintf(stderr, "cpu%d: MSR_TURBO_RATIO_LIMIT1: 0x%08llx\n", base_cpu, msr);
12081208

12091209
ratio = (msr >> 56) & 0xFF;
12101210
if (ratio)
@@ -1256,7 +1256,7 @@ dump_nhm_turbo_ratio_limits(void)
12561256

12571257
get_msr(base_cpu, MSR_TURBO_RATIO_LIMIT, &msr);
12581258

1259-
fprintf(stderr, "cpu0: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", msr);
1259+
fprintf(stderr, "cpu%d: MSR_TURBO_RATIO_LIMIT: 0x%08llx\n", base_cpu, msr);
12601260

12611261
ratio = (msr >> 56) & 0xFF;
12621262
if (ratio)
@@ -1312,8 +1312,8 @@ dump_knl_turbo_ratio_limits(void)
13121312

13131313
get_msr(base_cpu, MSR_NHM_TURBO_RATIO_LIMIT, &msr);
13141314

1315-
fprintf(stderr, "cpu0: MSR_NHM_TURBO_RATIO_LIMIT: 0x%08llx\n",
1316-
msr);
1315+
fprintf(stderr, "cpu%d: MSR_NHM_TURBO_RATIO_LIMIT: 0x%08llx\n",
1316+
base_cpu, msr);
13171317

13181318
/**
13191319
* Turbo encoding in KNL is as follows:
@@ -1371,7 +1371,7 @@ dump_nhm_cst_cfg(void)
13711371
#define SNB_C1_AUTO_UNDEMOTE (1UL << 27)
13721372
#define SNB_C3_AUTO_UNDEMOTE (1UL << 28)
13731373

1374-
fprintf(stderr, "cpu0: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x%08llx", msr);
1374+
fprintf(stderr, "cpu%d: MSR_NHM_SNB_PKG_CST_CFG_CTL: 0x%08llx", base_cpu, msr);
13751375

13761376
fprintf(stderr, " (%s%s%s%s%slocked: pkg-cstate-limit=%d: %s)\n",
13771377
(msr & SNB_C3_AUTO_UNDEMOTE) ? "UNdemote-C3, " : "",

0 commit comments

Comments
 (0)