summaryrefslogtreecommitdiff
path: root/tools/power
AgeCommit message (Collapse)Author
2024-01-21tools cpupower bench: Override CFLAGS assignmentsStanley Chan
Allow user to specify outside CFLAGS values as make argument Corrects an issue where CFLAGS is passed as a make argument for cpupower, but bench's makefile does not inherit and append to them. Signed-off-by: Stanley Chan <schan@cloudflare.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-11-20PM: tools: Fix sleepgraph syntax errorDavid Woodhouse
The sleepgraph tool currently fails: File "/usr/bin/sleepgraph", line 4155 or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)): ^ SyntaxError: unmatched ')' Fixes: 34ea427e01ea ("PM: tools: sleepgraph: Recognize "CPU killed" messages") Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-11-18Merge tag 'turbostat-2023.11.07' of ↵Linus Torvalds
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 ...
2023-11-07tools/power turbostat: version 2023.11.07Len 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. Signed-off-by: Len Brown <len.brown@intel.com>
2023-11-07tools/power/turbostat: bugfix "--show IPC"Len Brown
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>
2023-11-07Merge branch 'pm-tools'Rafael J. Wysocki
Merge cpupower utility update for 6.7-rc1: - Fix a reference to a removed document in the cpupower utility documentation (Vegard Nossum). * pm-tools: cpupower: fix reference to nonexistent document
2023-11-03Merge tag 'linux-cpupower-6.7-rc1' of ↵Rafael J. Wysocki
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux Merge cpupower utility update for 6.7-rc1 from Shuah Khan: "This cpupower update for Linux 6.7-rc1 consists of a single fix to documentation to fix reference to a removed document." * tag 'linux-cpupower-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower: fix reference to nonexistent document
2023-11-01Merge tag 'linux_kselftest-next-6.7-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull kselftest updates from Shuah Khan: - kbuild kselftest-merge target fixes - fixes to several tests - resctrl test fixes and enhancements - ksft_perror() helper and reporting improvements - printf attribute to kselftest prints to improve reporting - documentation and clang build warning fixes The bulk of the patches are for resctrl fixes and enhancements. * tag 'linux_kselftest-next-6.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (51 commits) selftests/resctrl: Fix MBM test failure when MBA unavailable selftests/clone3: Report descriptive test names selftests:modify the incorrect print format selftests/efivarfs: create-read: fix a resource leak selftests/ftrace: Add riscv support for kprobe arg tests selftests/ftrace: add loongarch support for kprobe args char tests selftests/amd-pstate: Added option to provide perf binary path selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-ut selftests/resctrl: Move run_benchmark() to a more fitting file selftests/resctrl: Fix schemata write error check selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests selftests/resctrl: Fix feature checks selftests/resctrl: Refactor feature check to use resource and feature name selftests/resctrl: Move _GNU_SOURCE define into Makefile selftests/resctrl: Remove duplicate feature check from CMT test selftests/resctrl: Extend signal handler coverage to unmount on receiving signal selftests/resctrl: Fix uninitialized .sa_flags selftests/resctrl: Cleanup benchmark argument parsing selftests/resctrl: Remove ben_count variable selftests/resctrl: Make benchmark command const and build it with pointers ...
2023-10-31Merge tag 'platform-drivers-x86-v6.7-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver updates from Ilpo Järvinen: - asus-wmi: Support for screenpad and solve brightness key press duplication - int3472: Eliminate the last use of deprecated GPIO functions - mlxbf-pmc: New HW support - msi-ec: Support new EC configurations - thinkpad_acpi: Support reading aux MAC address during passthrough - wmi: Fixes & improvements - x86-android-tablets: Detection fix and avoid use of GPIO private APIs - Debug & metrics interface improvements - Miscellaneous cleanups / fixes / improvements * tag 'platform-drivers-x86-v6.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (80 commits) platform/x86: inspur-platform-profile: Add platform profile support platform/x86: thinkpad_acpi: Add battery quirk for Thinkpad X120e platform/x86: wmi: Decouple WMI device removal from wmi_block_list platform/x86: wmi: Fix opening of char device platform/x86: wmi: Fix probe failure when failing to register WMI devices platform/x86: wmi: Fix refcounting of WMI devices in legacy functions platform/x86: wmi: Decouple probe deferring from wmi_block_list platform/x86/amd/hsmp: Fix iomem handling platform/x86: asus-wmi: Do not report brightness up/down keys when also reported by acpi_video platform/x86: thinkpad_acpi: replace deprecated strncpy with memcpy tools/power/x86/intel-speed-select: v1.18 release tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0 tools/power/x86/intel-speed-select: Increase max CPUs in one request tools/power/x86/intel-speed-select: Display error for core-power support tools/power/x86/intel-speed-select: No TRL for non compute domains tools/power/x86/intel-speed-select: turbo-mode enable disable swapped tools/power/x86/intel-speed-select: Update help for TRL tools/power/x86/intel-speed-select: Sanitize integer arguments platform/x86: acer-wmi: Remove void function return platform/x86/amd/pmc: Add dump_custom_stb module parameter ...
2023-10-25cpupower: fix reference to nonexistent documentVegard Nossum
This file was renamed from .txt to .rst and left a dangling reference. Fix it. Fixes: 151f4e2bdc7a ("docs: power: convert docs to ReST and rename to *.rst") Cc: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Mark Brown <broonie@kernel.org> Cc: Srivatsa S. Bhat (VMware) <srivatsa@csail.mit.edu> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Arjan van de Ven <arjan@linux.intel.com> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Len Brown <len.brown@intel.com> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-10-24tools/power/turbostat: Add initial support for LunarLakeSumeet Pawnikar
Add initial support for LunarLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
2023-10-24tools/power/turbostat: Add initial support for ArrowLakeSumeet Pawnikar
Add initial support for ArrowLake platform. It shares the same features with CannonLake. Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
2023-10-24tools/power/turbostat: Add initial support for GrandRidgeZhang Rui
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>
2023-10-24tools/power/turbostat: Add initial support for SierraForestZhang Rui
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>
2023-10-24tools/power/turbostat: Add initial support for GraniteRapidsZhang Rui
Add initial support for GraniteRapids. It shares the same features with SapphireRapids. Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2023-10-24tools/power/turbostat: Add MSR_CORE_C1_RES support for spr_featuresZhang Rui
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>
2023-10-24tools/power/turbostat: Move process to root cgroupSrinivas Pandruvada
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>
2023-10-24tools/power/turbostat: Handle cgroup v2 cpu limitationZhang Rui
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>
2023-10-24tools/power/turbostat: Abstrct function for parsing cpu stringZhang Rui
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>
2023-10-20tools/power/turbostat: Handle offlined CPUs in cpu_subsetZhang Rui
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>
2023-10-20tools/power/turbostat: Obey allowed CPUs for system summaryZhang Rui
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>
2023-10-20tools/power/turbostat: Obey allowed CPUs for primary thread/core detectionZhang Rui
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>
2023-10-20tools/power/turbostat: Abstract several functionsZhang Rui
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>
2023-10-20tools/power/turbostat: Obey allowed CPUs during startupZhang Rui
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>
2023-10-20tools/power/turbostat: Obey allowed CPUs when accessing CPU countersZhang Rui
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>
2023-10-20tools/power/turbostat: Introduce cpu_allowed_setZhang Rui
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>
2023-10-17tools/power/x86/intel-speed-select: v1.18 releaseSrinivas Pandruvada
This version addresses issues with: - When CPU 0 hotplug is not possible, try cgroup v2 isolation without any user input - Fix turbo mode enable/disable swapped - Sanitize command line integer and hex arguments - Add more error messages - Increase CPU count in one request Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: Use cgroup isolate for CPU 0Srinivas Pandruvada
From kernel version 6.5, CPU 0 hotplug capability is deprecated. If some SST profile doesn't have CPU 0, then it is no longer possible to offline CPU 0. This means that user space threads will still run on CPU 0. To workaround this issue, use cgroup v2 isolation feature. Whenever there /sys/devices/system/cpu/cpu0/online file is absent or open fails, isolate CPU 0 via CPU cgroup v2 isolation. Also add a command line option to force even if the /sys/devices/system/cpu/cpu0/online is present. The previous commit "01bcb56f059e ("tools/power/x86/intel-speed-select: Prevent CPU 0 offline") was just warning about this issue based on the kernel version 6.5 and above. With this new approach, instead of warning take action to mitigate the issue. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: Increase max CPUs in one requestSrinivas Pandruvada
With the increase in the CPU count, this count needs to be updated. Increase max CPU count to 512. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: Display error for core-power supportSrinivas Pandruvada
When core-power is getting enabled, if the feaure is not supported, display error. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: No TRL for non compute domainsSrinivas Pandruvada
Don't call to set or get TRL for domains in which there are no CPUs. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: turbo-mode enable disable swappedSrinivas Pandruvada
The command for turbo-mode enable and disable is swapped. Fix that. Previously turbo-mode enable was actually disabling and disable was enabling. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: Update help for TRLSrinivas Pandruvada
TRL (turbo ratio limit) argument is passed in hex string. Clarify that in the help. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-17tools/power/x86/intel-speed-select: Sanitize integer argumentsSrinivas Pandruvada
If the command takes some integer arguments, make sure the command contains only digits. Same for Hex arguments. Otherwise return error. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2023-10-16selftests/amd-pstate: Fix broken paths to run workloads in amd-pstate-utSwapnil Sapkal
In selftests/amd-pstate, tbench and gitsource microbenchmarks are used to compare the performance with different governors. In current implementation the relative path to run `amd_pstate_tracer.py` is broken. Fix this by using absolute paths. Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2023-09-27tools/power/turbostat: Remove PC7/PC9 support on ADL/RPLZhang Rui
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>
2023-09-27tools/power/turbostat: Enable MSR_CORE_C1_RES on recent Intel client platformsZhang Rui
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>
2023-09-27tools/power/turbostat: Introduce probe_pm_features()Zhang Rui
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>
2023-09-27tools/power/turbostat: Relocate more probing related codeZhang Rui
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>
2023-09-27tools/power/turbostat: Reorder some functionsZhang Rui
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>
2023-09-27tools/power/turbostat: Relocate thermal probing codeZhang Rui
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>
2023-09-27tools/power/turbostat: Relocate lpi probing codeZhang Rui
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>
2023-09-27tools/power/turbostat: Relocate graphics probing codeZhang Rui
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>
2023-09-27tools/power/turbostat: Rename rapl probing functionZhang Rui
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>
2023-09-27tools/power/turbostat: Rename uncore probing functionZhang Rui
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>
2023-09-27tools/power/turbostat: Relocate pstate probing codeZhang Rui
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>
2023-09-27tools/power/turbostat: Relocate cstate probing codeZhang Rui
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>
2023-09-27tools/power/turbostat: Improve probe_platform_features() logicZhang Rui
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>
2023-09-27tools/power/turbostat: Delete intel_model_duplicates()Zhang Rui
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>
2023-09-27tools/power/turbostat: Abstract cstate prewake bit supportZhang Rui
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>