Skip to content

Commit fdea6b8

Browse files
zhang-ruilenb
authored andcommitted
tools/power turbostat: Always check rapl_joules flag
rapl_joules bit should always be checked even if platform_features->rapl_msrs is not set or no_msr flag is used. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent adb4973 commit fdea6b8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7302,6 +7302,9 @@ void rapl_probe_intel(void)
73027302
else
73037303
bic_enabled &= ~bic_joules_bits;
73047304

7305+
if (!platform->rapl_msrs || no_msr)
7306+
return;
7307+
73057308
if (!(platform->rapl_msrs & RAPL_PKG_PERF_STATUS))
73067309
bic_enabled &= ~BIC_PKG__;
73077310
if (!(platform->rapl_msrs & RAPL_DRAM_PERF_STATUS))
@@ -7352,6 +7355,9 @@ void rapl_probe_amd(void)
73527355
else
73537356
bic_enabled &= ~bic_joules_bits;
73547357

7358+
if (!platform->rapl_msrs || no_msr)
7359+
return;
7360+
73557361
if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr))
73567362
return;
73577363

@@ -7504,9 +7510,6 @@ int print_rapl(struct thread_data *t, struct core_data *c, struct pkg_data *p)
75047510
*/
75057511
void probe_rapl(void)
75067512
{
7507-
if (!platform->rapl_msrs || no_msr)
7508-
return;
7509-
75107513
if (genuine_intel)
75117514
rapl_probe_intel();
75127515
if (authentic_amd || hygon_genuine)
@@ -7515,6 +7518,9 @@ void probe_rapl(void)
75157518
if (quiet)
75167519
return;
75177520

7521+
if (!platform->rapl_msrs || no_msr)
7522+
return;
7523+
75187524
for_all_cpus(print_rapl, ODD_COUNTERS);
75197525
}
75207526

0 commit comments

Comments
 (0)