Commit fdea6b88 authored by Zhang Rui's avatar Zhang Rui Committed by Len Brown
Browse files

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: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent adb49732
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -7302,6 +7302,9 @@ void rapl_probe_intel(void)
	else
		bic_enabled &= ~bic_joules_bits;

	if (!platform->rapl_msrs || no_msr)
		return;

	if (!(platform->rapl_msrs & RAPL_PKG_PERF_STATUS))
		bic_enabled &= ~BIC_PKG__;
	if (!(platform->rapl_msrs & RAPL_DRAM_PERF_STATUS))
@@ -7352,6 +7355,9 @@ void rapl_probe_amd(void)
	else
		bic_enabled &= ~bic_joules_bits;

	if (!platform->rapl_msrs || no_msr)
		return;

	if (get_msr(base_cpu, MSR_RAPL_PWR_UNIT, &msr))
		return;

@@ -7504,9 +7510,6 @@ int print_rapl(struct thread_data *t, struct core_data *c, struct pkg_data *p)
 */
void probe_rapl(void)
{
	if (!platform->rapl_msrs || no_msr)
		return;

	if (genuine_intel)
		rapl_probe_intel();
	if (authentic_amd || hygon_genuine)
@@ -7515,6 +7518,9 @@ void probe_rapl(void)
	if (quiet)
		return;

	if (!platform->rapl_msrs || no_msr)
		return;

	for_all_cpus(print_rapl, ODD_COUNTERS);
}