Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 29fea61

Browse files
Patryk Wlazlynlenb
authored andcommitted
tools/power turbostat: Ignore pkg_cstate_limit when it is not available
When running in no-msr mode, the pkg_cstate_limit is not populated, thus we use perf to determine if given pcstate counter is present on the platform. Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 4e7ee02 commit 29fea61

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7121,9 +7121,7 @@ void cstate_perf_init_(bool soft_c1)
71217121

71227122
const bool counter_needed = BIC_IS_ENABLED(cai->bic) ||
71237123
(soft_c1 && (cai->flags & CSTATE_COUNTER_FLAG_SOFT_C1_DEPENDENCY));
7124-
const bool counter_supported =
7125-
(platform->supported_cstates & cai->feature_mask) &&
7126-
(pkg_cstate_limit >= cai->pkg_cstate_limit);
7124+
const bool counter_supported = (platform->supported_cstates & cai->feature_mask);
71277125

71287126
if (counter_needed && counter_supported) {
71297127
/* Use perf API for this counter */
@@ -7132,7 +7130,8 @@ void cstate_perf_init_(bool soft_c1)
71327130
cci->source[cai->rci_index] = CSTATE_SOURCE_PERF;
71337131

71347132
/* User MSR for this counter */
7135-
} else if (!no_msr && cai->msr && probe_msr(cpu, cai->msr) == 0) {
7133+
} else if (!no_msr && cai->msr && pkg_cstate_limit >= cai->pkg_cstate_limit
7134+
&& probe_msr(cpu, cai->msr) == 0) {
71367135
cci->source[cai->rci_index] = CSTATE_SOURCE_MSR;
71377136
cci->msr[cai->rci_index] = cai->msr;
71387137
}

0 commit comments

Comments
 (0)