summaryrefslogtreecommitdiffstats
path: root/tools (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'turbostat-2023.11.07' of ↵Linus Torvalds2023-11-181-1442/+1442
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull turbostat updates from Len Brown: - Turbostat features are now table-driven (Rui Zhang) - Add support for some new platforms (Sumeet Pawnikar, Rui Zhang) - Gracefully run in configs when CPUs are limited (Rui Zhang, Srinivas Pandruvada) - misc minor fixes [ This came in during the merge window, but sorting out the signed tag took a while, so thus the late merge - Linus ] * tag 'turbostat-2023.11.07' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (86 commits) tools/power turbostat: version 2023.11.07 tools/power/turbostat: bugfix "--show IPC" tools/power/turbostat: Add initial support for LunarLake tools/power/turbostat: Add initial support for ArrowLake tools/power/turbostat: Add initial support for GrandRidge tools/power/turbostat: Add initial support for SierraForest tools/power/turbostat: Add initial support for GraniteRapids tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_features tools/power/turbostat: Move process to root cgroup tools/power/turbostat: Handle cgroup v2 cpu limitation tools/power/turbostat: Abstrct function for parsing cpu string tools/power/turbostat: Handle offlined CPUs in cpu_subset tools/power/turbostat: Obey allowed CPUs for system summary tools/power/turbostat: Obey allowed CPUs for primary thread/core detection tools/power/turbostat: Abstract several functions tools/power/turbostat: Obey allowed CPUs during startup tools/power/turbostat: Obey allowed CPUs when accessing CPU counters tools/power/turbostat: Introduce cpu_allowed_set tools/power/turbostat: Remove PC7/PC9 support on ADL/RPL tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platforms ...
| * tools/power turbostat: version 2023.11.07Len Brown2023-11-081-1/+1
| | | | | | | | | | | | | | | | | | Turbostat features are now table-driven (Rui Zhang) Add support for some new platforms (Sumeet Pawnikar, Rui Zhang) Gracefully run in configs when CPUs are limited (Rui Zhang, Srinivas Pandruvada) misc minor fixes. Signed-off-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: bugfix "--show IPC"Len Brown2023-11-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | turbostat --show IPC displays "inf" for the IPC column turbostat was missing the explicit dependency of IPC on APERF, and thus neglected to collect APERF when only IPC was requested. typcial use: turbostat --quiet --show CPU,IPC Signed-off-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Add initial support for LunarLakeSumeet Pawnikar2023-10-241-0/+1
| | | | | | | | | | | | | | | | Add initial support for LunarLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
| * tools/power/turbostat: Add initial support for ArrowLakeSumeet Pawnikar2023-10-241-0/+1
| | | | | | | | | | | | | | | | Add initial support for ArrowLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
| * tools/power/turbostat: Add initial support for GrandRidgeZhang Rui2023-10-241-0/+17
| | | | | | | | | | | | | | | | | | Add initial support for GrandRidge. It shares the same features as SierraForest, except that it does not support PC2/PC6. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Add initial support for SierraForestZhang Rui2023-10-241-0/+17
| | | | | | | | | | | | | | | | | | Add initial support for SierraForest. It shares the same features with SapphireRapids, except that it has MSR_MODULE_C6_RES_MS support. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Add initial support for GraniteRapidsZhang Rui2023-10-241-0/+1
| | | | | | | | | | | | | | | | Add initial support for GraniteRapids. It shares the same features with SapphireRapids. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_featuresZhang Rui2023-10-241-0/+1
| | | | | | | | | | | | | | Add MSR_CORE_C1_RES support for spr_features because both Sapphirerapids and Emeraldrapids support this MSR. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Move process to root cgroupSrinivas Pandruvada2023-10-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When available CPUs are reduced via cgroup cpuset controller, turbostat will exit with errors (For example): get_counters: Could not migrate to CPU 0 turbostat: re-initialized with num_cpus 20 get_counters: Could not migrate to CPU 0 turbostat: re-initialized with num_cpus 20 Move the turbostat to root cgroup, which has every CPU. Writing the value 0 to a cgroup.procs file causes the writing process to be moved to the corresponding cgroup. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Tested-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Handle cgroup v2 cpu limitationZhang Rui2023-10-241-15/+80
| | | | | | | | | | | | | | | | | | | | | | CPUs can be isolated via cgroup settings and turbostat should avoid migrating to these CPUs, just like it does for the '-c' cpus. Introduce cpu_effective_set to save the cgroup cpu limitation info from /sys/fs/cgroup/cpuset.cpus.effective. And use cpu_allowed_set as the intersection of cpu_present_set, cpu_effective_set and cpu_subset. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Abstrct function for parsing cpu stringZhang Rui2023-10-241-49/+55
| | | | | | | | | | | | | | | | | | | | | | Abstract parse_cpu_str() which can update any specified cpu_set by a given cpu string. This can be used to handle further CPU limitations from other sources like cgroup. The cpu string parsing code is also enhanced to handle the strings that have an extra '\n' before string terminator. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Handle offlined CPUs in cpu_subsetZhang Rui2023-10-201-10/+21
| | | | | | | | | | | | | | | | | | | | | | It is possible that the cpu_subset contains offlined CPUs. If this happens during start, exit immediately because this is likely an operator error that is best fixed by re-invoking. If this happens at runtime, give a warning only because turbostat should do its best effort to continue running. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Obey allowed CPUs for system summaryZhang Rui2023-10-201-25/+46
| | | | | | | | | | | | | | | | | | | | System summary should summarize the information for allowed CPUs instead of all the present CPUs. Introduce topology information for allowed CPUs, and use them to get system summary. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Obey allowed CPUs for primary thread/core detectionZhang Rui2023-10-201-19/+16
| | | | | | | | | | | | | | | | | | Thread_id doesn't tell if a CPU is allowed or not. Detect allowed CPUs only and use the first detected thread/core as the primary thread/core of a core/package. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Abstract several functionsZhang Rui2023-10-201-17/+41
| | | | | | | | | | | | | | | | | | | | | | When detecting the primary thread/core in a core/package, current code doesn't handle the allowed CPUs. Abstract several functions for further fix of this issue. No functional change. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Obey allowed CPUs during startupZhang Rui2023-10-201-7/+14
| | | | | | | | | | | | | | | | | | | | Set turbostat CPU affinity to make sure turbostat is running on one of the allowed CPUs. Set base_cpu to the first allowed CPU so that some platform information is dumped using one of the allowed CPUs. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Obey allowed CPUs when accessing CPU countersZhang Rui2023-10-201-2/+2
| | | | | | | | | | | | | | for_all_cpus/for_all_cpus_2 are used for accessing the per CPU counters, and they should follow the cpu_allowed_set instead of cpu_present_set. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Introduce cpu_allowed_setZhang Rui2023-10-201-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | Turbostat supports "-c" parameter which limits output to system summary plus the specified cpu-set. But some code still uses cpu_present_set to read and dump the counters. Introduce cpu_allowed_set for code that should obey the specified cpu-set. No functional change. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
| * tools/power/turbostat: Remove PC7/PC9 support on ADL/RPLZhang Rui2023-09-271-6/+23
| | | | | | | | | | | | | | | | | | | | | | Compared with other platforms that share cnl_features, ADL/RPL don't have PC7/PC9. Clone a new platform feature set from cnl_features for ADL/RPL, with PC7/PC9 removed. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platformsZhang Rui2023-09-271-0/+1
| | | | | | | | | | | | | | | | All recent Intel client platforms have MSR_CORE_C1_RES. Enable the support on these platforms, including CNL/ICL/LKF/RKL/TGL/ADL/RPL/MTL. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Introduce probe_pm_features()Zhang Rui2023-09-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | 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/turbostat: Relocate more probing related codeZhang Rui2023-09-271-20/+17
| | | | | | | | | | | | | | | | | | | | Relocate more feature probing code outside of process_cpuids() into the corresponding probing functions. This improves the readability of code and the turbostat output. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Reorder some functionsZhang Rui2023-09-271-107/+107
| | | | | | | | | | | | | | | | | | Reorder some functions to solve code depdency introduced by next patch. No functional change. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Relocate thermal probing codeZhang Rui2023-09-271-5/+10
| | | | | | | | | | | | | | | | 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>
| * tools/power/turbostat: Relocate lpi probing codeZhang Rui2023-09-271-16/+22
| | | | | | | | | | | | | | Introduce probe_lpi(), and move all lpi probing related code into it. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Relocate graphics probing codeZhang Rui2023-09-271-11/+16
| | | | | | | | | | | | | | | | Introduce probe_graphics(), and move all graphics probing related code into it. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Rename rapl probing functionZhang Rui2023-09-271-4/+4
| | | | | | | | | | | | | | | | | | | | Rename rapl_probe() to probe_rapl() to be consistent with other probing function names. Probe rapl after probing uncore frequency. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Rename uncore probing functionZhang Rui2023-09-271-3/+3
| | | | | | | | | | | | | | | | | | | | Rename intel_uncore_frequency_probe() to probe_intel_uncore_frequency() to be consistent with other probing function names. Probe uncore frequency right after probing cstates. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Relocate pstate probing codeZhang Rui2023-09-271-18/+21
| | | | | | | | | | | | | | | | Introduce probe_pstates() and move all pstate probing related code into it. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Relocate cstate probing codeZhang Rui2023-09-271-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | Move all cstate probing related code into probe_cstates(). Note that dump_platform_info() actually dumps both MSR_PLATFORM_INFO and MSR_IA32_POWER_CTL. MSR_PLATFORM_INFO is for pstate and MSR_IA32_POWER_CTL is for cstate. So split dump_platform_info() and dump MSR_IA32_POWER_CTL in probe_cstates(). Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Improve probe_platform_features() logicZhang Rui2023-09-271-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AMD/Hygon platforms that don't have RAPL use 'amd_features' to describe the platform features. Unknown Intel platforms use 'default_features' to describe the platform features. As none of the platform feature is set for 'amd_features' or 'default_features', there is no need to maintain both of them. Remove 'amd_features' structure and improve the logic in probe_platform_features(). Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Delete intel_model_duplicates()Zhang Rui2023-09-271-59/+0
| | | | | | | | | | | | | | | | | | | | Now CPU model checks have been cleaned up, no code depends on the duplicated CPU model value. Delete intel_model_duplicates(). Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract cstate prewake bit supportZhang Rui2023-09-271-43/+4
| | | | | | | | | | | | | | | | | | Abstract cstate prewake bit support. Delete is_icx()/is_spr() CPU model checks. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract aperf/mperf multiplier supportZhang Rui2023-09-271-23/+3
| | | | | | | | | | | | | | | | | | Abstract aperf/mperf multiplier support. Delete is_knl() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract extended cstate MSRs supportZhang Rui2023-09-271-25/+4
| | | | | | | | | | | | | | | | | | | | | | Abstract the support for MSR_PKG_WEIGHTED_CORE_C0_RES, MSR_PKG_ANY_CORE_C0_RES, MSR_PKG_ANY_GFXE_C0_RES and MSR_PKG_BOTH_CORE_GFXE_C0_RES. Delete has_skl_msrs() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract MSR_KNL_CORE_C6_RESIDENCY supportZhang Rui2023-09-271-4/+4
| | | | | | | | | | | | | | Abstract the support for MSR_KNL_CORE_C6_RESIDENCY. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract MSR_ATOM_PKG_C6_RESIDENCY supportZhang Rui2023-09-271-19/+4
| | | | | | | | | | | | | | | | | | Abstract the support for MSR_ATOM_PKG_C6_RESIDENCY. Delete is_slm() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract MSR_CC6/MC6_DEMOTION_POLICY_CONFIG supportZhang Rui2023-09-271-23/+6
| | | | | | | | | | | | | | | | | | Abstract the support for MSR_CC6/MC6_DEMOTION_POLICY_CONFIG. Delete has_slv_msrs() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract MSR_MODULE_C6_RES_MS supportZhang Rui2023-09-271-2/+4
| | | | | | | | | | | | | | Abstract MSR_MODULE_C6_RES_MS support. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract MSR_CORE_C1_RES supportZhang Rui2023-09-271-24/+6
| | | | | | | | | | | | | | | | | | Abstract the support for MSR_CORE_C1_RES. Delete is_dnv() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Abstract IRTL supportZhang Rui2023-09-271-46/+26
| | | | | | | | | | | | | | | | | | Abstract the support for MSR_PKGC3/PKGC6/PKGC7/PKGC8/PKGC9/PKGC10_IRTL. Delete has_snb_msrs() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Use fine grained IRTL outputZhang Rui2023-09-271-63/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | It is pointless to dump the IRTL register for a package cstate that is not supported by the platform. Print IRTL only for states that are available in platform->supported_cstates. Delete has_c8910_msrs() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for is_slm()/is_knl()/is_cnl()/is_ehl() ↵Zhang Rui2023-09-271-39/+5
| | | | | | | | | | | | | | | | | | | | | | models Disable CC3 for is_slm()/is_knl()/is_cnl()/is_ehl() models. Delete is_cnl()/is_ehl() CPU model checks. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for has_c8910_msrs() modelsZhang Rui2023-09-271-15/+7
| | | | | | | | | | | | | | Enable PC8/PC9/PC10 for has_c8910_msrs() models. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for is_bdx() modelsZhang Rui2023-09-271-21/+1
| | | | | | | | | | | | | | | | | | Disable CC7/PC7 for is_bdx() models. Delete is_bdx() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for is_skx()/is_icx()/is_spr() modelsZhang Rui2023-09-271-25/+3
| | | | | | | | | | | | | | | | | | Disable CC3/CC7/PC3/PC7 for is_skx()/is_icx()/is_spr() models. Delete is_skx() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for is_dnv() modelsZhang Rui2023-09-271-6/+1
| | | | | | | | | | | | | | Enable CC1 and disable CC3/CC7/PC3/PC7 for is_dnv() models. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for is_jvl() modelsZhang Rui2023-09-271-24/+1
| | | | | | | | | | | | | | | | | | Disable CC3/CC7/PC2/PC3/PC6/PC7 for is_jvl() models. Delete is_jvl() CPU model check. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>
| * tools/power/turbostat: Adjust cstate for has_slv_msrs() modelsZhang Rui2023-09-271-5/+1
| | | | | | | | | | | | | | Disable PC2/PC3/PC7 and enable PC6 for has_slv_msrs() models. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Len Brown <len.brown@intel.com>