License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 14:07:57 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2015-04-18 20:34:39 +00:00
|
|
|
# Some of the tools (perf) use same make variables
|
|
|
|
# as in kernel build.
|
|
|
|
export srctree=
|
|
|
|
export objtree=
|
|
|
|
|
2012-04-11 16:36:16 +00:00
|
|
|
include scripts/Makefile.include
|
|
|
|
|
2012-04-11 16:36:17 +00:00
|
|
|
help:
|
|
|
|
@echo 'Possible targets:'
|
|
|
|
@echo ''
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' acpi - ACPI tools'
|
2019-06-28 17:22:09 +00:00
|
|
|
@echo ' bpf - misc BPF tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' cgroup - cgroup tools'
|
2021-09-29 03:16:01 +00:00
|
|
|
@echo ' counter - counter tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' cpupower - a tool for all things x86 CPU power'
|
2019-01-08 19:40:06 +00:00
|
|
|
@echo ' debugging - tools for debugging'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' firewire - the userspace part of nosy, an IEEE-1394 traffic sniffer'
|
2018-10-17 18:27:18 +00:00
|
|
|
@echo ' firmware - Firmware tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' freefall - laptop accelerometer program for disk protection'
|
2015-10-21 13:45:54 +00:00
|
|
|
@echo ' gpio - GPIO tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' hv - tools used when in Hyper-V clients'
|
|
|
|
@echo ' iio - IIO tools'
|
2019-06-30 17:14:08 +00:00
|
|
|
@echo ' intel-speed-select - Intel Speed Select tool'
|
2016-05-18 11:26:21 +00:00
|
|
|
@echo ' kvm_stat - top-like utility for displaying kvm statistics'
|
2016-09-16 19:16:50 +00:00
|
|
|
@echo ' leds - LEDs tools'
|
2022-03-21 17:33:14 +00:00
|
|
|
@echo ' nolibc - nolibc headers testing and installation'
|
2019-06-28 17:22:09 +00:00
|
|
|
@echo ' objtool - an ELF object analysis tool'
|
2018-08-23 11:55:15 +00:00
|
|
|
@echo ' pci - PCI tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' perf - Linux performance measurement and analysis tool'
|
|
|
|
@echo ' selftests - various kernel selftests'
|
2020-01-10 16:03:56 +00:00
|
|
|
@echo ' bootconfig - boot config tool'
|
2016-01-14 19:39:09 +00:00
|
|
|
@echo ' spi - spi tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' tmon - thermal monitoring and tuning tool'
|
2022-04-20 16:09:31 +00:00
|
|
|
@echo ' thermometer - temperature capture tool'
|
2022-04-20 16:09:32 +00:00
|
|
|
@echo ' thermal-engine - thermal monitoring tool'
|
2022-04-20 16:09:29 +00:00
|
|
|
@echo ' thermal - thermal library'
|
tracing/tools: Add the latency-collector to tools directory
This is a tool that is intended to work around the fact that the
preemptoff, irqsoff, and preemptirqsoff tracers only work in
overwrite mode. The idea is to act randomly in such a way that we
do not systematically lose any latencies, so that if enough testing
is done, all latencies will be captured. If the same burst of
latencies is repeated, then sooner or later we will have captured all
the latencies.
It also works with the wakeup_dl, wakeup_rt, and wakeup tracers.
However, in that case it is probably not useful to use the random
sleep functionality.
The reason why it may be desirable to catch all latencies with a long
test campaign is that for some organizations, it's necessary to test
the kernel in the field and not practical for developers to work
iteratively with field testers. Because of cost and project schedules
it is not possible to start a new test campaign every time a latency
problem has been fixed.
It uses inotify to detect changes to /sys/kernel/tracing/trace.
When a latency is detected, it will either sleep or print
immediately, depending on a function that act as an unfair coin
toss.
If immediate print is chosen, it means that we open
/sys/kernel/tracing/trace and thereby cause a blackout period
that will hide any subsequent latencies.
If sleep is chosen, it means that we wait before opening
/sys/kernel/tracing/trace, by default for 1000 ms, to see if
there is another latency during this period. If there is, then we will
lose the previous latency. The coin will be tossed again with a
different probability, and we will either print the new latency, or
possibly a subsequent one.
The probability for the unfair coin toss is chosen so that there
is equal probability to obtain any of the latencies in a burst.
However, this assumes that we make an assumption of how many
latencies there can be. By default the program assumes that there
are no more than 2 latencies in a burst, the probability of immediate
printout will be:
1/2 and 1
Thus, the probability of getting each of the two latencies will be 1/2.
If we ever find that there is more than one latency in a series,
meaning that we reach the probability of 1, then the table will be
expanded to:
1/3, 1/2, and 1
Thus, we assume that there are no more than three latencies and each
with a probability of 1/3 of being captured. If the probability of 1
is reached in the new table, that is we see more than two closely
occurring latencies, then the table will again be extended, and so
on.
On my systems, it seems like this scheme works fairly well, as
long as the latencies we trace are long enough, 300 us seems to be
enough. This userspace program receive the inotify event at the end
of a latency, and it has time until the end of the next latency
to react, that is to open /sys/kernel/tracing/trace. Thus,
if we trace latencies that are >300 us, then we have at least 300 us
to react.
The minimum latency will of course not be 300 us on all systems, it
will depend on the hardware, kernel version, workload and
configuration.
Example usage:
In one shell, give the following command:
sudo latency-collector -rvv -t preemptirqsoff -s 2000 -a 3
This will trace latencies > 2000us with the preemptirqsoff tracer,
using random sleep with maximum verbosity, with a probability
table initialized to a size of 3.
In another shell, generate a few bursts of latencies:
root@host:~# modprobe preemptirq_delay_test delay=3000 test_mode=alternate
burst_size=3
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
If all goes well, you should be getting stack traces that shows
all the different latencies, i.e. you should see all the three
functions preemptirqtest_0, preemptirqtest_1, preemptirqtest_2 in the
stack traces.
Link: https://lkml.kernel.org/r/20210212134421.172750-2-Viktor.Rosendahl@bmw.de
Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-02-12 13:44:21 +00:00
|
|
|
@echo ' tracing - misc tracing tools'
|
2015-12-18 12:39:15 +00:00
|
|
|
@echo ' turbostat - Intel CPU idle stats and freq reporting tool'
|
|
|
|
@echo ' usb - USB testing tools'
|
|
|
|
@echo ' virtio - vhost test module'
|
2023-04-15 20:31:10 +00:00
|
|
|
@echo ' mm - misc mm tools'
|
2017-11-01 19:25:37 +00:00
|
|
|
@echo ' wmi - WMI interface examples'
|
2012-04-11 16:36:17 +00:00
|
|
|
@echo ' x86_energy_perf_policy - Intel energy policy tool'
|
|
|
|
@echo ''
|
2012-04-11 16:36:18 +00:00
|
|
|
@echo 'You can do:'
|
2013-01-29 10:48:11 +00:00
|
|
|
@echo ' $$ make -C tools/ <tool>_install'
|
2012-04-11 16:36:18 +00:00
|
|
|
@echo ''
|
|
|
|
@echo ' from the kernel command line to build and install one of'
|
|
|
|
@echo ' the tools above'
|
|
|
|
@echo ''
|
2015-11-11 22:25:34 +00:00
|
|
|
@echo ' $$ make tools/all'
|
|
|
|
@echo ''
|
|
|
|
@echo ' builds all tools.'
|
|
|
|
@echo ''
|
2012-04-11 16:36:18 +00:00
|
|
|
@echo ' $$ make tools/install'
|
|
|
|
@echo ''
|
|
|
|
@echo ' installs all tools.'
|
|
|
|
@echo ''
|
2012-04-11 16:36:17 +00:00
|
|
|
@echo 'Cleaning targets:'
|
|
|
|
@echo ''
|
|
|
|
@echo ' all of the above with the "_clean" string appended cleans'
|
|
|
|
@echo ' the respective build directory.'
|
|
|
|
@echo ' clean: a summary clean target to clean _all_ folders'
|
|
|
|
|
2014-01-15 04:04:17 +00:00
|
|
|
acpi: FORCE
|
|
|
|
$(call descend,power/$@)
|
|
|
|
|
2012-04-11 16:36:16 +00:00
|
|
|
cpupower: FORCE
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/$@)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2023-04-15 20:31:10 +00:00
|
|
|
cgroup counter firewire hv guest bootconfig spi usb virtio mm bpf iio gpio objtool leds wmi pci firmware debugging tracing: FORCE
|
2013-02-20 15:32:30 +00:00
|
|
|
$(call descend,$@)
|
|
|
|
|
2020-07-11 21:53:22 +00:00
|
|
|
bpf/%: FORCE
|
|
|
|
$(call descend,$@)
|
|
|
|
|
2015-04-18 20:34:38 +00:00
|
|
|
libapi: FORCE
|
2013-12-09 16:14:23 +00:00
|
|
|
$(call descend,lib/api)
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2022-05-28 15:45:45 +00:00
|
|
|
nolibc: FORCE
|
|
|
|
$(call descend,include/nolibc)
|
|
|
|
|
2022-03-21 17:33:14 +00:00
|
|
|
nolibc_%: FORCE
|
|
|
|
$(call descend,include/nolibc,$(patsubst nolibc_%,%,$@))
|
|
|
|
|
2015-04-18 20:34:39 +00:00
|
|
|
# The perf build does not follow the descend function setup,
|
|
|
|
# invoking it via it's own make rule.
|
|
|
|
PERF_O = $(if $(O),$(O)/tools/perf,)
|
|
|
|
|
2015-04-18 20:34:38 +00:00
|
|
|
perf: FORCE
|
2015-04-18 20:34:39 +00:00
|
|
|
$(Q)mkdir -p $(PERF_O) .
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir=
|
2012-04-11 16:36:16 +00:00
|
|
|
|
|
|
|
selftests: FORCE
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,testing/$@)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2022-04-20 16:09:29 +00:00
|
|
|
thermal: FORCE
|
|
|
|
$(call descend,lib/$@)
|
|
|
|
|
2019-06-30 17:14:08 +00:00
|
|
|
turbostat x86_energy_perf_policy intel-speed-select: FORCE
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/x86/$@)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
tools/thermal: Introduce tmon, a tool for thermal subsystem
Increasingly, Linux is running on thermally constrained devices. The simple
thermal relationship between processor and fan has become past for modern
computers.
As hardware vendors cope with the thermal constraints on their products,
more sensors are added, new cooling capabilities are introduced. The
complexity of the thermal relationship can grow exponentially among cooling
devices, zones, sensors, and trip points. They can also change dynamically.
To expose such relationship to the userspace, Linux generic thermal layer
introduced sysfs entry at /sys/class/thermal with a matrix of symbolic
links, trip point bindings, and device instances. To traverse such
matrix by hand is not a trivial task. Testing is also difficult in that
thermal conditions are often exception cases that hard to reach in
normal operations.
TMON is conceived as a tool to help visualize, tune, and test the
complex thermal subsystem.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-10-14 23:02:27 +00:00
|
|
|
tmon: FORCE
|
|
|
|
$(call descend,thermal/$@)
|
|
|
|
|
2022-04-20 16:09:31 +00:00
|
|
|
thermometer: FORCE
|
|
|
|
$(call descend,thermal/$@)
|
|
|
|
|
2022-04-20 16:09:32 +00:00
|
|
|
thermal-engine: FORCE thermal
|
|
|
|
$(call descend,thermal/$@)
|
|
|
|
|
2015-06-06 13:42:28 +00:00
|
|
|
freefall: FORCE
|
|
|
|
$(call descend,laptop/$@)
|
|
|
|
|
2017-04-11 15:34:35 +00:00
|
|
|
kvm_stat: FORCE
|
|
|
|
$(call descend,kvm/$@)
|
|
|
|
|
2021-11-12 15:16:02 +00:00
|
|
|
all: acpi cgroup counter cpupower gpio hv firewire \
|
2020-01-10 16:03:56 +00:00
|
|
|
perf selftests bootconfig spi turbostat usb \
|
2023-04-15 20:31:10 +00:00
|
|
|
virtio mm bpf x86_energy_perf_policy \
|
2019-01-08 19:40:06 +00:00
|
|
|
tmon freefall iio objtool kvm_stat wmi \
|
2022-04-20 16:09:32 +00:00
|
|
|
pci debugging tracing thermal thermometer thermal-engine
|
2015-11-11 22:25:34 +00:00
|
|
|
|
2014-01-15 04:04:17 +00:00
|
|
|
acpi_install:
|
|
|
|
$(call descend,power/$(@:_install=),install)
|
|
|
|
|
2012-04-11 16:36:16 +00:00
|
|
|
cpupower_install:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/$(@:_install=),install)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2023-04-15 20:31:10 +00:00
|
|
|
cgroup_install counter_install firewire_install gpio_install hv_install iio_install perf_install bootconfig_install spi_install usb_install virtio_install mm_install bpf_install objtool_install wmi_install pci_install debugging_install tracing_install:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,$(@:_install=),install)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
|
|
|
selftests_install:
|
2015-11-17 21:54:19 +00:00
|
|
|
$(call descend,testing/$(@:_install=),install)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2022-04-20 16:09:29 +00:00
|
|
|
thermal_install:
|
|
|
|
$(call descend,lib/$(@:_install=),install)
|
|
|
|
|
2019-06-30 17:14:08 +00:00
|
|
|
turbostat_install x86_energy_perf_policy_install intel-speed-select_install:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/x86/$(@:_install=),install)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
tools/thermal: Introduce tmon, a tool for thermal subsystem
Increasingly, Linux is running on thermally constrained devices. The simple
thermal relationship between processor and fan has become past for modern
computers.
As hardware vendors cope with the thermal constraints on their products,
more sensors are added, new cooling capabilities are introduced. The
complexity of the thermal relationship can grow exponentially among cooling
devices, zones, sensors, and trip points. They can also change dynamically.
To expose such relationship to the userspace, Linux generic thermal layer
introduced sysfs entry at /sys/class/thermal with a matrix of symbolic
links, trip point bindings, and device instances. To traverse such
matrix by hand is not a trivial task. Testing is also difficult in that
thermal conditions are often exception cases that hard to reach in
normal operations.
TMON is conceived as a tool to help visualize, tune, and test the
complex thermal subsystem.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-10-14 23:02:27 +00:00
|
|
|
tmon_install:
|
|
|
|
$(call descend,thermal/$(@:_install=),install)
|
|
|
|
|
2022-04-20 16:09:31 +00:00
|
|
|
thermometer_install:
|
|
|
|
$(call descend,thermal/$(@:_install=),install)
|
|
|
|
|
2022-04-20 16:09:32 +00:00
|
|
|
thermal-engine_install:
|
|
|
|
$(call descend,thermal/$(@:_install=),install)
|
|
|
|
|
2015-06-06 13:42:28 +00:00
|
|
|
freefall_install:
|
|
|
|
$(call descend,laptop/$(@:_install=),install)
|
|
|
|
|
2016-05-18 11:26:21 +00:00
|
|
|
kvm_stat_install:
|
|
|
|
$(call descend,kvm/$(@:_install=),install)
|
|
|
|
|
2021-09-29 03:16:01 +00:00
|
|
|
install: acpi_install cgroup_install counter_install cpupower_install gpio_install \
|
2021-11-12 15:16:02 +00:00
|
|
|
hv_install firewire_install iio_install \
|
2013-01-04 21:05:17 +00:00
|
|
|
perf_install selftests_install turbostat_install usb_install \
|
2023-04-15 20:31:10 +00:00
|
|
|
virtio_install mm_install bpf_install x86_energy_perf_policy_install \
|
2017-11-01 19:25:37 +00:00
|
|
|
tmon_install freefall_install objtool_install kvm_stat_install \
|
tracing/tools: Add the latency-collector to tools directory
This is a tool that is intended to work around the fact that the
preemptoff, irqsoff, and preemptirqsoff tracers only work in
overwrite mode. The idea is to act randomly in such a way that we
do not systematically lose any latencies, so that if enough testing
is done, all latencies will be captured. If the same burst of
latencies is repeated, then sooner or later we will have captured all
the latencies.
It also works with the wakeup_dl, wakeup_rt, and wakeup tracers.
However, in that case it is probably not useful to use the random
sleep functionality.
The reason why it may be desirable to catch all latencies with a long
test campaign is that for some organizations, it's necessary to test
the kernel in the field and not practical for developers to work
iteratively with field testers. Because of cost and project schedules
it is not possible to start a new test campaign every time a latency
problem has been fixed.
It uses inotify to detect changes to /sys/kernel/tracing/trace.
When a latency is detected, it will either sleep or print
immediately, depending on a function that act as an unfair coin
toss.
If immediate print is chosen, it means that we open
/sys/kernel/tracing/trace and thereby cause a blackout period
that will hide any subsequent latencies.
If sleep is chosen, it means that we wait before opening
/sys/kernel/tracing/trace, by default for 1000 ms, to see if
there is another latency during this period. If there is, then we will
lose the previous latency. The coin will be tossed again with a
different probability, and we will either print the new latency, or
possibly a subsequent one.
The probability for the unfair coin toss is chosen so that there
is equal probability to obtain any of the latencies in a burst.
However, this assumes that we make an assumption of how many
latencies there can be. By default the program assumes that there
are no more than 2 latencies in a burst, the probability of immediate
printout will be:
1/2 and 1
Thus, the probability of getting each of the two latencies will be 1/2.
If we ever find that there is more than one latency in a series,
meaning that we reach the probability of 1, then the table will be
expanded to:
1/3, 1/2, and 1
Thus, we assume that there are no more than three latencies and each
with a probability of 1/3 of being captured. If the probability of 1
is reached in the new table, that is we see more than two closely
occurring latencies, then the table will again be extended, and so
on.
On my systems, it seems like this scheme works fairly well, as
long as the latencies we trace are long enough, 300 us seems to be
enough. This userspace program receive the inotify event at the end
of a latency, and it has time until the end of the next latency
to react, that is to open /sys/kernel/tracing/trace. Thus,
if we trace latencies that are >300 us, then we have at least 300 us
to react.
The minimum latency will of course not be 300 us on all systems, it
will depend on the hardware, kernel version, workload and
configuration.
Example usage:
In one shell, give the following command:
sudo latency-collector -rvv -t preemptirqsoff -s 2000 -a 3
This will trace latencies > 2000us with the preemptirqsoff tracer,
using random sleep with maximum verbosity, with a probability
table initialized to a size of 3.
In another shell, generate a few bursts of latencies:
root@host:~# modprobe preemptirq_delay_test delay=3000 test_mode=alternate
burst_size=3
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
root@host:~# echo 1 > /sys/kernel/preemptirq_delay_test/trigger
If all goes well, you should be getting stack traces that shows
all the different latencies, i.e. you should see all the three
functions preemptirqtest_0, preemptirqtest_1, preemptirqtest_2 in the
stack traces.
Link: https://lkml.kernel.org/r/20210212134421.172750-2-Viktor.Rosendahl@bmw.de
Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-02-12 13:44:21 +00:00
|
|
|
wmi_install pci_install debugging_install intel-speed-select_install \
|
2022-04-20 16:09:32 +00:00
|
|
|
tracing_install thermometer_install thermal-engine_install
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2014-01-15 04:04:17 +00:00
|
|
|
acpi_clean:
|
|
|
|
$(call descend,power/acpi,clean)
|
|
|
|
|
2012-04-11 16:36:16 +00:00
|
|
|
cpupower_clean:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/cpupower,clean)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2023-04-15 20:31:10 +00:00
|
|
|
cgroup_clean counter_clean hv_clean firewire_clean bootconfig_clean spi_clean usb_clean virtio_clean mm_clean wmi_clean bpf_clean iio_clean gpio_clean objtool_clean leds_clean pci_clean firmware_clean debugging_clean tracing_clean:
|
2013-02-20 15:32:30 +00:00
|
|
|
$(call descend,$(@:_clean=),clean)
|
|
|
|
|
2015-04-18 20:34:38 +00:00
|
|
|
libapi_clean:
|
2013-12-09 16:14:23 +00:00
|
|
|
$(call descend,lib/api,clean)
|
2013-02-20 15:32:30 +00:00
|
|
|
|
2016-01-11 10:54:48 +00:00
|
|
|
libbpf_clean:
|
|
|
|
$(call descend,lib/bpf,clean)
|
|
|
|
|
|
|
|
libsubcmd_clean:
|
|
|
|
$(call descend,lib/subcmd,clean)
|
|
|
|
|
2015-04-18 20:34:38 +00:00
|
|
|
perf_clean:
|
2016-04-25 20:17:18 +00:00
|
|
|
$(Q)mkdir -p $(PERF_O) .
|
|
|
|
$(Q)$(MAKE) --no-print-directory -C perf O=$(PERF_O) subdir= clean
|
2012-04-11 16:36:16 +00:00
|
|
|
|
|
|
|
selftests_clean:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,testing/$(@:_clean=),clean)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2022-04-20 16:09:29 +00:00
|
|
|
thermal_clean:
|
|
|
|
$(call descend,lib/thermal,clean)
|
|
|
|
|
2019-06-30 17:14:08 +00:00
|
|
|
turbostat_clean x86_energy_perf_policy_clean intel-speed-select_clean:
|
2012-11-05 15:15:24 +00:00
|
|
|
$(call descend,power/x86/$(@:_clean=),clean)
|
2012-04-11 16:36:16 +00:00
|
|
|
|
2022-04-20 16:09:31 +00:00
|
|
|
thermometer_clean:
|
|
|
|
$(call descend,thermal/thermometer,clean)
|
|
|
|
|
2022-04-20 16:09:32 +00:00
|
|
|
thermal-engine_clean:
|
|
|
|
$(call descend,thermal/thermal-engine,clean)
|
|
|
|
|
tools/thermal: Introduce tmon, a tool for thermal subsystem
Increasingly, Linux is running on thermally constrained devices. The simple
thermal relationship between processor and fan has become past for modern
computers.
As hardware vendors cope with the thermal constraints on their products,
more sensors are added, new cooling capabilities are introduced. The
complexity of the thermal relationship can grow exponentially among cooling
devices, zones, sensors, and trip points. They can also change dynamically.
To expose such relationship to the userspace, Linux generic thermal layer
introduced sysfs entry at /sys/class/thermal with a matrix of symbolic
links, trip point bindings, and device instances. To traverse such
matrix by hand is not a trivial task. Testing is also difficult in that
thermal conditions are often exception cases that hard to reach in
normal operations.
TMON is conceived as a tool to help visualize, tune, and test the
complex thermal subsystem.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
2013-10-14 23:02:27 +00:00
|
|
|
tmon_clean:
|
|
|
|
$(call descend,thermal/tmon,clean)
|
|
|
|
|
2015-06-06 13:42:28 +00:00
|
|
|
freefall_clean:
|
|
|
|
$(call descend,laptop/freefall,clean)
|
|
|
|
|
2016-01-11 10:54:48 +00:00
|
|
|
build_clean:
|
|
|
|
$(call descend,build,clean)
|
|
|
|
|
2021-09-29 03:16:01 +00:00
|
|
|
clean: acpi_clean cgroup_clean counter_clean cpupower_clean hv_clean firewire_clean \
|
2020-01-10 16:03:56 +00:00
|
|
|
perf_clean selftests_clean turbostat_clean bootconfig_clean spi_clean usb_clean virtio_clean \
|
2023-04-15 20:31:10 +00:00
|
|
|
mm_clean bpf_clean iio_clean x86_energy_perf_policy_clean tmon_clean \
|
2021-11-12 15:16:02 +00:00
|
|
|
freefall_clean build_clean libbpf_clean libsubcmd_clean \
|
2019-06-30 17:14:08 +00:00
|
|
|
gpio_clean objtool_clean leds_clean wmi_clean pci_clean firmware_clean debugging_clean \
|
2022-04-20 16:09:32 +00:00
|
|
|
intel-speed-select_clean tracing_clean thermal_clean thermometer_clean thermal-engine_clean
|
2012-04-11 16:36:16 +00:00
|
|
|
|
|
|
|
.PHONY: FORCE
|