diff options
author | Zhang Rui <rui.zhang@intel.com> | 2023-08-31 10:02:16 +0200 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2023-09-27 16:14:20 +0200 |
commit | db735f8ba78bf7692579b78f0ca1e40563ef79fd (patch) | |
tree | 4434adec3f235067dde34a0e9bd40a189c2304b5 /tools | |
parent | tools/power/turbostat: Relocate lpi probing code (diff) | |
download | linux-db735f8ba78bf7692579b78f0ca1e40563ef79fd.tar.xz linux-db735f8ba78bf7692579b78f0ca1e40563ef79fd.zip |
tools/power/turbostat: Relocate thermal probing code
Introduce probe_thermal(), and move all thermal probing related code
into it.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/x86/turbostat/turbostat.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index ad9147757d5a..8dae576234a4 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -4894,6 +4894,14 @@ void probe_rapl(void) rapl_probe_amd(); } +void probe_thermal(void) +{ + if (!access("/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count", R_OK)) + BIC_PRESENT(BIC_CORE_THROT_CNT); + else + BIC_NOT_PRESENT(BIC_CORE_THROT_CNT); +} + int print_thermal(struct thread_data *t, struct core_data *c, struct pkg_data *p) { unsigned long long msr; @@ -5598,14 +5606,11 @@ void process_cpuid() probe_rapl(); + probe_thermal(); + if (platform->has_nhm_msrs) BIC_PRESENT(BIC_SMI); - if (!access("/sys/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count", R_OK)) - BIC_PRESENT(BIC_CORE_THROT_CNT); - else - BIC_NOT_PRESENT(BIC_CORE_THROT_CNT); - if (!quiet) decode_misc_feature_control(); |