[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210908150001.3702552-19-ray.huang@amd.com>
Date: Wed, 8 Sep 2021 23:00:00 +0800
From: Huang Rui <ray.huang@....com>
To: "Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Shuah Khan <skhan@...uxfoundation.org>,
"Borislav Petkov" <bp@...e.de>, Ingo Molnar <mingo@...nel.org>,
<linux-pm@...r.kernel.org>
CC: Deepak Sharma <deepak.sharma@....com>,
Alex Deucher <alexander.deucher@....com>,
Mario Limonciello <mario.limonciello@....com>,
Nathan Fontenot <nathan.fontenot@....com>,
Jinzhou Su <Jinzhou.Su@....com>,
Xiaojian Du <Xiaojian.Du@....com>,
<linux-kernel@...r.kernel.org>, <x86@...nel.org>,
Huang Rui <ray.huang@....com>
Subject: [PATCH 18/19] cpupower: print amd-pstate information on cpupower
amd-pstate kernel module is using the fine grain frequency instead of
acpi hardware pstate. So the performance and frequency values should be
printed in frequency-info.
Signed-off-by: Huang Rui <ray.huang@....com>
---
tools/power/cpupower/utils/cpufreq-info.c | 27 ++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c
index f9895e31ff5a..9eabed209adc 100644
--- a/tools/power/cpupower/utils/cpufreq-info.c
+++ b/tools/power/cpupower/utils/cpufreq-info.c
@@ -183,9 +183,30 @@ static int get_boost_mode_x86(unsigned int cpu)
printf(_(" Supported: %s\n"), support ? _("yes") : _("no"));
printf(_(" Active: %s\n"), active ? _("yes") : _("no"));
- if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
- cpupower_cpu_info.family >= 0x10) ||
- cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
+ if (cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
+ cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATE) {
+ printf(_(" AMD PSTATE Highest Performance: %u. Maximum Frequency: "),
+ amd_pstate_get_data(cpu, HIGHEST_PERF));
+ print_speed(amd_pstate_get_data(cpu, MAX_FREQ));
+ printf(".\n");
+
+ printf(_(" AMD PSTATE Nominal Performance: %u. Nominal Frequency: "),
+ amd_pstate_get_data(cpu, NOMINAL_PERF));
+ print_speed(amd_pstate_get_data(cpu, NOMINAL_FREQ));
+ printf(".\n");
+
+ printf(_(" AMD PSTATE Lowest Non-linear Performance: %u. Lowest Non-linear Frequency: "),
+ amd_pstate_get_data(cpu, LOWEST_NONLINEAR_PERF));
+ print_speed(amd_pstate_get_data(cpu, LOWEST_NONLINEAR_FREQ));
+ printf(".\n");
+
+ printf(_(" AMD PSTATE Lowest Performance: %u. Lowest Frequency: "),
+ amd_pstate_get_data(cpu, LOWEST_PERF));
+ print_speed(amd_pstate_get_data(cpu, MIN_FREQ));
+ printf(".\n");
+ } else if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD &&
+ cpupower_cpu_info.family >= 0x10) ||
+ cpupower_cpu_info.vendor == X86_VENDOR_HYGON) {
ret = decode_pstates(cpu, b_states, pstates, &pstate_no);
if (ret)
return ret;
--
2.25.1
Powered by blists - more mailing lists