diff options
| author | Jeremy Linton <jeremy.linton@arm.com> | 2026-07-09 17:13:44 -0500 |
|---|---|---|
| committer | Shuah Khan <skhan@linuxfoundation.org> | 2026-07-16 17:34:27 -0600 |
| commit | 5100bd356cd315112c4e27e66e4f0129800eabd2 (patch) | |
| tree | 828d4e7bea26779056bcbaea881811691a5b9ff9 /tools | |
| parent | 6b8ff068542a62c0fd58a7134282d48dd8a729c9 (diff) | |
cpupower: Print kernel and hardware frequency information
The kernel asserted frequency from scaling_cur_freq may not always match
the hardware reported frequency from cpuinfo_cur_freq.
Print both values when they are available, and only print the unavailable
message on x86 when the hardware frequency can't be read.
Link: https://lore.kernel.org/r/20260709221344.1919794-4-jeremy.linton@arm.com
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/power/cpupower/utils/cpufreq-info.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index 105f06e690cc..11629ae49f98 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -270,10 +270,10 @@ static int get_freq_hardware(unsigned int cpu, unsigned int human) { unsigned long freq; - if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)) + freq = cpufreq_get_freq_hardware(cpu); + if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF) && !freq) return -EINVAL; - freq = cpufreq_get_freq_hardware(cpu); printf(_(" current CPU frequency: ")); if (!freq) { printf("Unable to call hardware\n"); @@ -514,8 +514,8 @@ static void debug_output_one(unsigned int cpu) get_available_governors(cpu); get_policy(cpu); - if (get_freq_hardware(cpu, 1) < 0) - get_freq_kernel(cpu, 1); + get_freq_hardware(cpu, 1); + get_freq_kernel(cpu, 1); get_boost_mode(cpu); get_perf_cap(cpu); } |
