Skip to content

Commit 1958f4e

Browse files
zhang-ruilenb
authored andcommitted
tools/power turbostat: Enhance platform divergence description
In various generations, platforms often share a majority of features, diverging only in a few specific aspects. The current approach of using hardcoded values in 'platform_features' structure fails to effectively represent these divergences. To improve the description of platform divergence: 1. Each newly introduced 'platform_features' structure must have a base, typically derived from the previous generation. 2. Platform feature values should be inherited from the base structure rather than being hardcoded. This approach ensures a more accurate and maintainable representation of platform-specific features across different generations. Converts `adl_features` and `lnl_features` to follow this new scheme. No functional change. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent d39d586 commit 1958f4e

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -735,38 +735,40 @@ static const struct platform_features cnl_features = {
735735
.enable_tsc_tweak = 1,
736736
};
737737

738+
/* Copied from cnl_features, with PC7/PC9 removed */
738739
static const struct platform_features adl_features = {
739-
.has_msr_misc_feature_control = 1,
740-
.has_msr_misc_pwr_mgmt = 1,
741-
.has_nhm_msrs = 1,
742-
.has_config_tdp = 1,
743-
.bclk_freq = BCLK_100MHZ,
744-
.supported_cstates = CC1 | CC6 | CC7 | PC2 | PC3 | PC6 | PC8 | PC10,
745-
.cst_limit = CST_LIMIT_HSW,
746-
.has_irtl_msrs = 1,
747-
.has_msr_core_c1_res = 1,
748-
.has_ext_cst_msrs = 1,
749-
.trl_msrs = TRL_BASE,
750-
.tcc_offset_bits = 6,
751-
.rapl_msrs = RAPL_PKG_ALL | RAPL_CORE_ALL | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_GFX,
752-
.enable_tsc_tweak = 1,
740+
.has_msr_misc_feature_control = cnl_features.has_msr_misc_feature_control,
741+
.has_msr_misc_pwr_mgmt = cnl_features.has_msr_misc_pwr_mgmt,
742+
.has_nhm_msrs = cnl_features.has_nhm_msrs,
743+
.has_config_tdp = cnl_features.has_config_tdp,
744+
.bclk_freq = cnl_features.bclk_freq,
745+
.supported_cstates = CC1 | CC6 | CC7 | PC2 | PC3 | PC6 | PC8 | PC10,
746+
.cst_limit = cnl_features.cst_limit,
747+
.has_irtl_msrs = cnl_features.has_irtl_msrs,
748+
.has_msr_core_c1_res = cnl_features.has_msr_core_c1_res,
749+
.has_ext_cst_msrs = cnl_features.has_ext_cst_msrs,
750+
.trl_msrs = cnl_features.trl_msrs,
751+
.tcc_offset_bits = cnl_features.tcc_offset_bits,
752+
.rapl_msrs = cnl_features.rapl_msrs,
753+
.enable_tsc_tweak = cnl_features.enable_tsc_tweak,
753754
};
754755

756+
/* Copied from adl_features, with PC3/PC8 removed */
755757
static const struct platform_features lnl_features = {
756-
.has_msr_misc_feature_control = 1,
757-
.has_msr_misc_pwr_mgmt = 1,
758-
.has_nhm_msrs = 1,
759-
.has_config_tdp = 1,
760-
.bclk_freq = BCLK_100MHZ,
761-
.supported_cstates = CC1 | CC6 | CC7 | PC2 | PC6 | PC10,
762-
.cst_limit = CST_LIMIT_HSW,
763-
.has_irtl_msrs = 1,
764-
.has_msr_core_c1_res = 1,
765-
.has_ext_cst_msrs = 1,
766-
.trl_msrs = TRL_BASE,
767-
.tcc_offset_bits = 6,
768-
.rapl_msrs = RAPL_PKG_ALL | RAPL_CORE_ALL | RAPL_DRAM | RAPL_DRAM_PERF_STATUS | RAPL_GFX,
769-
.enable_tsc_tweak = 1,
758+
.has_msr_misc_feature_control = adl_features.has_msr_misc_feature_control,
759+
.has_msr_misc_pwr_mgmt = adl_features.has_msr_misc_pwr_mgmt,
760+
.has_nhm_msrs = adl_features.has_nhm_msrs,
761+
.has_config_tdp = adl_features.has_config_tdp,
762+
.bclk_freq = adl_features.bclk_freq,
763+
.supported_cstates = CC1 | CC6 | CC7 | PC2 | PC6 | PC10,
764+
.cst_limit = adl_features.cst_limit,
765+
.has_irtl_msrs = adl_features.has_irtl_msrs,
766+
.has_msr_core_c1_res = adl_features.has_msr_core_c1_res,
767+
.has_ext_cst_msrs = adl_features.has_ext_cst_msrs,
768+
.trl_msrs = adl_features.trl_msrs,
769+
.tcc_offset_bits = adl_features.tcc_offset_bits,
770+
.rapl_msrs = adl_features.rapl_msrs,
771+
.enable_tsc_tweak = adl_features.enable_tsc_tweak,
770772
};
771773

772774
static const struct platform_features skx_features = {

0 commit comments

Comments
 (0)