aboutsummaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2020-03-21selftests: txtimestamp: allow printing latencies in nsec.Jian Yang1-12/+44
Txtimestamp reports latencies in uses resolution, while nsec is needed in cases such as measuring latencies on localhost. Add the following new flag: -N: print timestamps and durations in nsec (instead of usec) Signed-off-by: Jian Yang <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-03-21selftests: txtimestamp: allow individual txtimestamp tests.Jian Yang1-3/+28
The wrapper script txtimestamp.sh executes a pre-defined list of testcases sequentially without configuration options available. Add an option (-r/--run) to setup the test namespace and pass remaining arguments to txtimestamp binary. The script still runs all tests when no argument is passed. Signed-off-by: Jian Yang <[email protected]> Acked-by: Willem de Bruijn <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2020-03-21Merge branches 'doc.2020.02.27a', 'fixes.2020.03.21a', ↵Paul E. McKenney6-3/+40
'kfree_rcu.2020.02.20a', 'locktorture.2020.02.20a', 'ovld.2020.02.20a', 'rcu-tasks.2020.02.20a', 'srcu.2020.02.20a' and 'torture.2020.02.20a' into HEAD doc.2020.02.27a: Documentation updates. fixes.2020.03.21a: Miscellaneous fixes. kfree_rcu.2020.02.20a: Updates to kfree_rcu(). locktorture.2020.02.20a: Lock torture-test updates. ovld.2020.02.20a: Updates to callback-overload handling. rcu-tasks.2020.02.20a: RCU-tasks updates. srcu.2020.02.20a: SRCU updates. torture.2020.02.20a: Torture-test updates.
2020-03-21lockdep: Rename trace_{hard,soft}{irq_context,irqs_enabled}()Peter Zijlstra1-4/+4
Continue what commit: d820ac4c2fa8 ("locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit]") started, rename these to avoid confusing them with tracepoints. git grep -l "trace_\(soft\|hard\)\(irq_context\|irqs_enabled\)" | while read file; do sed -ie 's/trace_\(soft\|hard\)\(irq_context\|irqs_enabled\)/lockdep_\1\2/g' $file; done Reported-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
2020-03-21lockdep: Rename trace_hardirq_{enter,exit}()Thomas Gleixner1-2/+2
Continue what commit: d820ac4c2fa8 ("locking: rename trace_softirq_[enter|exit] => lockdep_softirq_[enter|exit]") started, rename these to avoid confusing them with tracepoints. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Thomas Gleixner <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
2020-03-21tools/power turbostat: update versionLen Brown1-1/+1
A stitch in time saves nine. Signed-off-by: Len Brown <[email protected]>
2020-03-21tools/power turbostat: Print cpuidle informationLen Brown1-0/+26
Print cpuidle driver and governor. Originally-by: Antti Laakso <[email protected]> Signed-off-by: Len Brown <[email protected]>
2020-03-20kunit: Run all KUnit tests through allyesconfigHeidi Fahim5-36/+115
Implemented the functionality to run all KUnit tests through kunit_tool by specifying an --alltests flag, which builds UML with allyesconfig enabled, and consequently runs every KUnit test. A new function was added to kunit_kernel: make_allyesconfig. Firstly, if --alltests is specified, kunit.py triggers build_um_kernel which call make_allyesconfig. This function calls the make command, disables the broken configs that would otherwise prevent UML from building, then starts the kernel with all possible configurations enabled. All stdout and stderr is sent to test.log and read from there then fed through kunit_parser to parse the tests to the user. Also added a signal_handler in case kunit is interrupted while running. Tested: Run under different conditions such as testing with --raw_output, testing program interrupt then immediately running kunit again without --alltests and making sure to clean the console. Signed-off-by: Heidi Fahim <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-03-20kunit: kunit_parser: make parser more robustHeidi Fahim10-20/+280
Previously, kunit_parser did not properly handle kunit TAP output that - had any prefixes (generated from different configs e.g. CONFIG_PRINTK_TIME) - had unrelated kernel output mixed in the middle of it, which has shown up when testing with allyesconfig To remove prefixes, the parser looks for the first line that includes TAP output, "TAP version 14". It then determines the length of the string before this sequence, and strips that number of characters off the beginning of the following lines until the last KUnit output line is reached. These fixes have been tested with additional tests in the KUnitParseTest and their associated logs have also been added. Signed-off-by: Heidi Fahim <[email protected]> Reviewed-by: Brendan Higgins <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-03-20selftests/bpf: Fix mix of tabs and spacesBill Wendling1-1/+1
Clang's -Wmisleading-indentation warns about misleading indentations if there's a mixture of spaces and tabs. Remove extraneous spaces. Signed-off-by: Bill Wendling <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
2020-03-20bpftool: Add struct_ops supportMartin KaFai Lau5-1/+743
This patch adds struct_ops support to the bpftool. To recap a bit on the recent bpf_struct_ops feature on the kernel side: It currently supports "struct tcp_congestion_ops" to be implemented in bpf. At a high level, bpf_struct_ops is struct_ops map populated with a number of bpf progs. bpf_struct_ops currently supports the "struct tcp_congestion_ops". However, the bpf_struct_ops design is generic enough that other kernel struct ops can be supported in the future. Although struct_ops is map+progs at a high lever, there are differences in details. For example, 1) After registering a struct_ops, the struct_ops is held by the kernel subsystem (e.g. tcp-cc). Thus, there is no need to pin a struct_ops map or its progs in order to keep them around. 2) To iterate all struct_ops in a system, it iterates all maps in type BPF_MAP_TYPE_STRUCT_OPS. BPF_MAP_TYPE_STRUCT_OPS is the current usual filter. In the future, it may need to filter by other struct_ops specific properties. e.g. filter by tcp_congestion_ops or other kernel subsystem ops in the future. 3) struct_ops requires the running kernel having BTF info. That allows more flexibility in handling other kernel structs. e.g. it can always dump the latest bpf_map_info. 4) Also, "struct_ops" command is not intended to repeat all features already provided by "map" or "prog". For example, if there really is a need to pin the struct_ops map, the user can use the "map" cmd to do that. While the first attempt was to reuse parts from map/prog.c, it ended up not a lot to share. The only obvious item is the map_parse_fds() but that still requires modifications to accommodate struct_ops map specific filtering (for the immediate and the future needs). Together with the earlier mentioned differences, it is better to part away from map/prog.c. The initial set of subcmds are, register, unregister, show, and dump. For register, it registers all struct_ops maps that can be found in an obj file. Option can be added in the future to specify a particular struct_ops map. Also, the common bpf_tcp_cc is stateless (e.g. bpf_cubic.c and bpf_dctcp.c). The "reuse map" feature is not implemented in this patch and it can be considered later also. For other subcmds, please see the man doc for details. A sample output of dump: [root@arch-fb-vm1 bpf]# bpftool struct_ops dump name cubic [{ "bpf_map_info": { "type": 26, "id": 64, "key_size": 4, "value_size": 256, "max_entries": 1, "map_flags": 0, "name": "cubic", "ifindex": 0, "btf_vmlinux_value_type_id": 18452, "netns_dev": 0, "netns_ino": 0, "btf_id": 52, "btf_key_type_id": 0, "btf_value_type_id": 0 } },{ "bpf_struct_ops_tcp_congestion_ops": { "refcnt": { "refs": { "counter": 1 } }, "state": "BPF_STRUCT_OPS_STATE_INUSE", "data": { "list": { "next": 0, "prev": 0 }, "key": 0, "flags": 0, "init": "void (struct sock *) bictcp_init/prog_id:138", "release": "void (struct sock *) 0", "ssthresh": "u32 (struct sock *) bictcp_recalc_ssthresh/prog_id:141", "cong_avoid": "void (struct sock *, u32, u32) bictcp_cong_avoid/prog_id:140", "set_state": "void (struct sock *, u8) bictcp_state/prog_id:142", "cwnd_event": "void (struct sock *, enum tcp_ca_event) bictcp_cwnd_event/prog_id:139", "in_ack_event": "void (struct sock *, u32) 0", "undo_cwnd": "u32 (struct sock *) tcp_reno_undo_cwnd/prog_id:144", "pkts_acked": "void (struct sock *, const struct ack_sample *) bictcp_acked/prog_id:143", "min_tso_segs": "u32 (struct sock *) 0", "sndbuf_expand": "u32 (struct sock *) 0", "cong_control": "void (struct sock *, const struct rate_sample *) 0", "get_info": "size_t (struct sock *, u32, int *, union tcp_cc_info *) 0", "name": "bpf_cubic", "owner": 0 } } } ] Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
2020-03-20bpftool: Translate prog_id to its bpf prog_nameMartin KaFai Lau2-12/+107
The kernel struct_ops obj has kernel's func ptrs implemented by bpf_progs. The bpf prog_id is stored as the value of the func ptr for introspection purpose. In the latter patch, a struct_ops dump subcmd will be added to introspect these func ptrs. It is desired to print the actual bpf prog_name instead of only printing the prog_id. Since struct_ops is the only usecase storing prog_id in the func ptr, this patch adds a prog_id_as_func_ptr bool (default is false) to "struct btf_dumper" in order not to mis-interpret the ptr value for the other existing use-cases. While printing a func_ptr as a bpf prog_name, this patch also prefix the bpf prog_name with the ptr's func_proto. [ Note that it is the ptr's func_proto instead of the bpf prog's func_proto ] It reuses the current btf_dump_func() to obtain the ptr's func_proto string. Here is an example from the bpf_cubic.c: "void (struct sock *, u32, u32) bictcp_cong_avoid/prog_id:140" Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
2020-03-20bpftool: Print as a string for char arrayMartin KaFai Lau1-0/+41
A char[] is currently printed as an integer array. This patch will print it as a string when 1) The array element type is an one byte int 2) The array element type has a BTF_INT_CHAR encoding or the array element type's name is "char" 3) All characters is between (0x1f, 0x7f) and it is terminated by a null character. Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Acked-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
2020-03-20bpftool: Print the enum's name instead of valueMartin KaFai Lau1-4/+36
This patch prints the enum's name if there is one found in the array of btf_enum. The commit 9eea98497951 ("bpf: fix BTF verification of enums") has details about an enum could have any power-of-2 size (up to 8 bytes). This patch also takes this chance to accommodate these non 4 byte enums. Signed-off-by: Martin KaFai Lau <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Quentin Monnet <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
2020-03-20selftests: firmware: Add firmware_request_platform testsHans de Goede1-0/+23
Add tests cases for checking the new firmware_request_platform api. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Luis Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Fix a typo in error messageMasanari Iida1-1/+1
This patch fix a spelling typo in error message. Signed-off-by: Masanari Iida <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Update versionSrinivas Pandruvada1-1/+1
Fair number of changes including bug fixes done to change version. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Avoid duplicate Package strings for jsonSrinivas Pandruvada1-89/+83
For platforms where multiple packages/die, this makes "Package-" key duplicate. To make unique, add die and cpu id to key name. So "Package-0" key name will change to "Package-0-die-x:cpu-x". For example: $sudo ./intel-speed-select -f json perf-profile info Intel(R) Speed Select Technology Executing on CPU model:106[0x6a] { "package-0:die-0:cpu-0": { "perf-profile-level-0": { "cpu-count": "32", "enable-cpu-count": "32", ... ... "package-1:die-0:cpu-16": { "perf-profile-level-0": { "cpu-count": "32", "enable-cpu-count": "32", "enable-cpu-mask": "ffff0000,ffff0000", ... ... For non json format, there is no change. Here when print_package_info() is called, it will return the level to print for other information. This level is used formatting. Also in some function duplicate code was there to print package,die and CPU information. Replace all that code with a call to print_package_info(). Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Add display for enabled cpus countSrinivas Pandruvada1-0/+8
In addition to total CPU count also display "enabled-cpu-count" for perf-profile info command. This will show number of CPUs in the "enable-cpu-mask". For example: perf-profile-level-4 cpu-count:32 enable-cpu-count:16 enable-cpu-mask:e42d0000,e42d0000 Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Print friendly warning for bad command lineSrinivas Pandruvada1-1/+4
When user specifies invalid option, display "Unknown Option: ignore", instead of "no match". Also display error for garbage on the command line. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Fix avx options for turbo-freq featureSrinivas Pandruvada1-2/+2
Specifying "avx2" and "avx512" option for display filter doesn't work with short option "-r", only works with --try-type. Also compare full 6 characters for "avx512" string. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve CLX commandsSrinivas Pandruvada1-10/+6
CLX doesn't have capability to change the feature in the hardware, but this acts as "--auto | -a" option. So even if user didn't specify the option, use this as --auto | -a to set cpufreq scaling frequency limits. Also remove perror with debug_printf as they don't bring any value. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Show error for invalid CPUs in the optionsSrinivas Pandruvada1-2/+7
When --cpu or -c is used to specify target CPUs and non of them are valid, display error. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve core-power result and error displaySrinivas Pandruvada3-40/+62
This change adds improved error display and handling for commands related to core-power feature. The changes include: - Replace perror with helpful error message - Use ordered priority for SKX based platform by default as the proportional priority is not supported - Don't show weight and epp in help and also give error when user tries to set them in SKX based platforms - Range check for epp and weights and display error Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Kernel interface error handlingSrinivas Pandruvada1-6/+22
Treat a case when mailbox/mmio command can't be handled by the kernel drivers when the module is removed or send a command which no driver can handle. In this case ENOTTY result is returned, so print error. Also when the isst_if_mmio module is removed, we can't send CLOS message messages via Mailbox on non SKX based platforms. When this module is removed, isst_platform_info.mmio_supported is set to 0. So it can't be used as a condition to send via mailbox. Here replace check for Skylake based platform to send via mailbox, other platforms can't use mailbox in lieu of MMIO. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for turbo-freq featureSrinivas Pandruvada4-14/+60
This change adds improved error display and handling for commands related to turbo-freq feature. The changes include: - Replace perror/fprintf with helpful error message - Error for not specifying TDP level when required - Show error for invalid bucket number - Show message to enable core-power before enabling turbo-freq feature Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for base-freq featureSrinivas Pandruvada2-5/+34
This change adds improved error display and handling for commands related to base-freq feature. The changes include: - Replace perror/fprintf with helpful error message - Error for not specifying TDP level when required - For CLX show help which shows limitation Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve output of perf-profile commandsSrinivas Pandruvada3-12/+20
Improve output of perf-profile commands: get-config-enabled get-lock-status Instead of showing 0/1, show meaningful strings. Also show error when command is failed. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Enhance help for core-power assocSrinivas Pandruvada1-0/+4
Enhance help to specify CPU and clos by an example. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Display error for invalid priority typeSrinivas Pandruvada1-0/+3
When priority type for core-power enable command is anything more than 1 display error before change to 1, which is ordered priority. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Check feature status firstSrinivas Pandruvada1-0/+24
Before looking for information about the base-freq or turbo-freq details, first check if the feature is supported at that level. If not print error and return. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Improve error display for perf-profile ↵Srinivas Pandruvada2-10/+44
feature This change adds improved error display and handling for commands related to perf-profile feature. The changes include: - When invalid TDP level is passed. display error and exit - Replace perror with helpful error message - Show error when TDP level can't be set - Print error when information can't be read for a level - Validate user options for invalid level - Display error for TDP lock status Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Add an API for error/information printSrinivas Pandruvada3-0/+51
Add a common API which can be used to print all error and information messages. In this way a common format can be used. For json output an error index in suffixed to make unique error key. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Enhance --info optionSrinivas Pandruvada2-0/+76
Add additional information, which will allow user to detect available features. This will allow users to check presence of features before continue to test. A sample output: $sudo ./intel-speed-select --info Intel(R) Speed Select Technology Executing on CPU model:85[0x55] Platform: API version : 1 Platform: Driver version : 1 Platform: mbox supported : 1 Platform: mmio supported : 0 Intel(R) SST-PP (feature perf-profile) is not supported Only performance level 0 (base level) is present TDP level change control is locked Intel(R) SST-TF (feature turbo-freq) is supported Intel(R) SST-BF (feature base-freq) is supported Intel(R) SST-CP (feature core-power) is supported Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Enhance helpSrinivas Pandruvada1-5/+24
Enhance help message which adds some example. The changes include: - Print help when options are not recognized. - For CLX, display only options which are applicable. - Sort options in alphatical order. - Disply help() instead of error: "Feature name and|or command not specified" - Remove duplicate display of Intel(R) Speed Select Technology Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Helpful warning for missing kernel interfaceSrinivas Pandruvada1-10/+24
When the device file "/dev/isst_interface" is not present, instead of failing on access, check at the start and print a helpful warning. Here CLX platform is an exception, which doesn't depend on the device file. So continue for CLX platform. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Store topology informationSrinivas Pandruvada1-11/+132
Once the CPU is offline, the topology information (core-id, package-id, die-id) is not accessible via sysfs. So when user selects a config level more than base config 0 and offlined CPUs to match the config level, to return to base config he has to manually online CPUs before. Without this CPUs information mapping from Punit CPU numbering will lot work as it needs atlest package id for each CPU. To avoid this additional steps store the topology information in a file , which is created on the very first run after boot. Since system boots in base config and all CPUs are online, we can get information about every CPU. Once any of the APIs like get_physical_package_id(), get_physical_core_id() or get_physical_die_id() fails to read from sysfs, read from the stored mapping file. This mapping file is stored in /tmp file system. so on every boot it is recreated to make sure that any new CPUs are added to the system before boot are taken into account. But don't use the stored physical device id when trying to get information for CPU to send message in for_each_online_package_in_set(). Here use the real value from syfs and in case fails try the next CPU. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Max CPU count calculation when CPU0 is ↵Srinivas Pandruvada1-2/+16
offline Currently /sys/devices/system/cpu/cpu0/topology/thread_siblings is used to get the max CPU count. But when CPU0 is offline, then this file will be absent. So add processing so that we can get count from any first CPU in the system. which is online. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Special handling for CPU 0 online/offlineSrinivas Pandruvada1-1/+7
When "-o" option for force online/offline is used with command: perf-profile set-config-level If the config level calls for CPU 0 online/offline, then call fails as there is special kernel setup required for CPU 0 online/offline and the currently not setup for that. But when call is for online CPU 0, then don't fail. Just warn that this system is not setup for CPU 0 online/offline. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Use more verbiage for clos informationSrinivas Pandruvada1-2/+8
Instead of displaying 0 and 1 for enable status, display "disabled" and "enabled" respectively. Similarly for priority type, display "ordered or proportional" instead of 0 and 1. An example display: $intel-speed-select -c 1 core-power info Intel(R) Speed Select Technology .. package-0 die-0 cpu-1 core-power support-status:supported enable-status:enabled clos-enable-status:enabled priority-type:proportional Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Enhance core-power info commandSrinivas Pandruvada3-4/+26
In addition to CLOS enable status, also show the core-power feature status. This will help why clos enable status didn't give desired results as the core-power feature may be disabled or unsupported. The new display looks as follows: $intel-speed-select core-power info Intel(R) Speed Select Technology .. package-0 die-0 cpu-0 core-power support-status:supported enable-status:enabled clos-enable-status:1 priority-type:0 In the above display "support-status" and "enable-status", shows the status of the core-power feature and "clos-enable-status", shows the status of the clos. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Make target CPU optional for core-power infoSrinivas Pandruvada1-9/+7
Currently "-c" is a mandatory option for "core-power info" command. Make this optional as this is a per package/die property. When not specified, it will print info for every package/die. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Warn for invalid package idSrinivas Pandruvada1-0/+8
When CPU is offline, we can't get package id. So print error for this and don't use output. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Fix last cpu numberSrinivas Pandruvada1-1/+0
Here topology_max_cpus is used for total CPU count, not the last CPU number. So remove "-1". Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20tools/power/x86/intel-speed-select: Fix mailbox usage for CLOS_PM_QOS_CONFIGSrinivas Pandruvada1-1/+2
Even for the products using MMIO, this message needs to be sent via mail box. The previous fix done for this didn't properly address this. That fix simply removed sending command via MMIO, but still didn't trigger sending via mailbox. Add additional condition to check for CLOS_PM_QOS_CONFIG, when MMIO is supported on a platform. Fixes: cd0e63706549 (tools/power/x86/intel-speed-select: Use mailbox for CLOS_PM_QOS_CONFIG) Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
2020-03-20selftests/x86/ptrace_syscall_32: Fix no-vDSO segfaultAndy Lutomirski1-2/+6
If AT_SYSINFO is not present, don't try to call a NULL pointer. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/faaf688265a7e1a5b944d6f8bc0f6368158306d3.1584052409.git.luto@kernel.org
2020-03-20selftests/x86/vdso: Fix no-vDSO segfaultsAndy Lutomirski2-0/+20
test_vdso would try to call a NULL pointer if the vDSO was missing. vdso_restorer_32 hit a genuine failure: trying to use the kernel-provided signal restorer doesn't work if the vDSO is missing. Skip the test if the vDSO is missing, since the test adds no particular value in that case. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/618ea7b8c55b10d08b1cb139e9a3a957934b8647.1584653439.git.luto@kernel.org
2020-03-20tools/power turbostat: Fix 32-bit capabilities warningLen Brown2-17/+31
warning: `turbostat' uses 32-bit capabilities (legacy support in use) Signed-off-by: Len Brown <[email protected]>
2020-03-20tools/power turbostat: Fix missing SYS_LPI counter on some ChromebooksLen Brown1-9/+14
Some Chromebook BIOS' do not export an ACPI LPIT, which is how Linux finds the residency counter for CPU and SYSTEM low power states, that is exports in /sys/devices/system/cpu/cpuidle/*residency_us When these sysfs attributes are missing, check the debugfs attrubte from the pmc_core driver, which accesses the same counter value. Signed-off-by: Len Brown <[email protected]>
2020-03-20tools/power turbostat: Support Elkhart LakeChen Yu1-1/+30
From a turbostat point of view the Tremont-based Elkhart Lake is very similar to Goldmont, reuse the code of Goldmont. Elkhart Lake does not support 'group turbo limit counter' nor C3, adjust the code accordingly. Signed-off-by: Chen Yu <[email protected]> Signed-off-by: Len Brown <[email protected]>