tools/power turbostat: Skip pc8, pc9, pc10 columns, if they are disabled
authorLen Brown <len.brown@intel.com>
Thu, 13 Aug 2020 23:18:22 +0000 (19:18 -0400)
committerLen Brown <len.brown@intel.com>
Thu, 3 Sep 2020 17:58:38 +0000 (13:58 -0400)
Like we skip PC3 and PC6 columns when the package C-state limit
disables them, skip PC8/PC9/CP10 under analogous conditions.

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

index 4ee4e3067681193afc578baea30f06d2a3caa76e..72c0b19db36eab6f9f2e75733b1d1c01ff56f5cf 100644 (file)
@@ -5186,9 +5186,12 @@ void process_cpuid()
                BIC_NOT_PRESENT(BIC_Pkgpc7);
        }
        if (has_c8910_msrs(family, model)) {
-               BIC_PRESENT(BIC_Pkgpc8);
-               BIC_PRESENT(BIC_Pkgpc9);
-               BIC_PRESENT(BIC_Pkgpc10);
+               if (pkg_cstate_limit >= PCL__8)
+                       BIC_PRESENT(BIC_Pkgpc8);
+               if (pkg_cstate_limit >= PCL__9)
+                       BIC_PRESENT(BIC_Pkgpc9);
+               if (pkg_cstate_limit >= PCL_10)
+                       BIC_PRESENT(BIC_Pkgpc10);
        }
        do_irtl_hsw = has_c8910_msrs(family, model);
        if (has_skl_msrs(family, model)) {