Skip to content

Commit 6d4a298

Browse files
superm1shuahkh
authored andcommitted
cpupower: Add support for amd-pstate preferred core rankings
The rankings are useful information to determine if the scheduler is placing tasks appropriately for the hardware. Link: https://lore.kernel.org/r/20241218191144.3440854-4-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 3f2eb76 commit 6d4a298

File tree

1 file changed

+8
-0
lines changed
  • tools/power/cpupower/utils/helpers

1 file changed

+8
-0
lines changed

tools/power/cpupower/utils/helpers/amd.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,17 @@ enum amd_pstate_value {
177177
AMD_PSTATE_HIGHEST_PERF,
178178
AMD_PSTATE_MAX_FREQ,
179179
AMD_PSTATE_LOWEST_NONLINEAR_FREQ,
180+
AMD_PSTATE_HW_PREFCORE,
181+
AMD_PSTATE_PREFCORE_RANKING,
180182
MAX_AMD_PSTATE_VALUE_READ_FILES,
181183
};
182184

183185
static const char *amd_pstate_value_files[MAX_AMD_PSTATE_VALUE_READ_FILES] = {
184186
[AMD_PSTATE_HIGHEST_PERF] = "amd_pstate_highest_perf",
185187
[AMD_PSTATE_MAX_FREQ] = "amd_pstate_max_freq",
186188
[AMD_PSTATE_LOWEST_NONLINEAR_FREQ] = "amd_pstate_lowest_nonlinear_freq",
189+
[AMD_PSTATE_HW_PREFCORE] = "amd_pstate_hw_prefcore",
190+
[AMD_PSTATE_PREFCORE_RANKING] = "amd_pstate_prefcore_ranking",
187191
};
188192

189193
static unsigned long amd_pstate_get_data(unsigned int cpu,
@@ -240,6 +244,10 @@ void amd_pstate_show_perf_and_freq(unsigned int cpu, int no_rounding)
240244
acpi_cppc_get_data(cpu, LOWEST_PERF));
241245
print_speed(acpi_cppc_get_data(cpu, LOWEST_FREQ) * 1000, no_rounding);
242246
printf(".\n");
247+
248+
printf(_(" Preferred Core Support: %lu. Preferred Core Ranking: %lu.\n"),
249+
amd_pstate_get_data(cpu, AMD_PSTATE_HW_PREFCORE),
250+
amd_pstate_get_data(cpu, AMD_PSTATE_PREFCORE_RANKING));
243251
}
244252

245253
/* AMD P-State Helper Functions ************************************/

0 commit comments

Comments
 (0)