tools/power/turbostat: Introduce probe_pm_features()
authorZhang Rui <rui.zhang@intel.com>
Wed, 13 Sep 2023 15:32:39 +0000 (23:32 +0800)
committerZhang Rui <rui.zhang@intel.com>
Wed, 27 Sep 2023 14:14:21 +0000 (22:14 +0800)
Feature probe has nothing to do with CPUID, thus it should not be in
process_cpuids().

Introduce probe_pm_features() and move all feature probing functions
into it.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index ffeee48e8d85a294fef81d8757a1fbdb5c1b88bb..607152b36c1a38bfe1b0ec9af07a6776ea0b7fca 100644 (file)
@@ -5610,7 +5610,10 @@ void process_cpuid()
 
        BIC_PRESENT(BIC_IRQ);
        BIC_PRESENT(BIC_TSC_MHz);
+}
 
+void probe_pm_features(void)
+{
        probe_pstates();
 
        probe_cstates();
@@ -5630,8 +5633,6 @@ void process_cpuid()
 
        if (!quiet)
                decode_misc_feature_control();
-
-       return;
 }
 
 /*
@@ -5912,6 +5913,7 @@ void turbostat_init()
        check_dev_msr();
        check_permissions();
        process_cpuid();
+       probe_pm_features();
        linux_perf_init();
 
        for_all_cpus(get_cpu_type, ODD_COUNTERS);