Skip to content

Commit 4d66020

Browse files
committed
Merge tag 'trace-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt: "New: - The Real Time Linux Analysis (RTLA) tool is added to the tools directory. - Can safely filter on user space pointers with: field.ustring ~ "match-string" - eprobes can now be filtered like any other event. - trace_marker(_raw) now uses stream_open() to allow multiple threads to safely write to it. Note, this could possibly break existing user space, but we will not know until we hear about it, and then can revert the change if need be. - New field in events to display when bottom halfs are disabled. - Sorting of the ftrace functions are now done at compile time instead of at bootup. Infrastructure changes to support future efforts: - Added __rel_loc type for trace events. Similar to __data_loc but the offset to the dynamic data is based off of the location of the descriptor and not the beginning of the event. Needed for user defined events. - Some simplification of event trigger code. - Make synthetic events process its callback better to not hinder other event callbacks that are registered. Needed for user defined events. And other small fixes and cleanups" * tag 'trace-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (50 commits) tracing: Add ustring operation to filtering string pointers rtla: Add rtla timerlat hist documentation rtla: Add rtla timerlat top documentation rtla: Add rtla timerlat documentation rtla: Add rtla osnoise hist documentation rtla: Add rtla osnoise top documentation rtla: Add rtla osnoise man page rtla: Add Documentation rtla/timerlat: Add timerlat hist mode rtla: Add timerlat tool and timelart top mode rtla/osnoise: Add the hist mode rtla/osnoise: Add osnoise top mode rtla: Add osnoise tool rtla: Helper functions for rtla rtla: Real-Time Linux Analysis tool tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails tracing: Remove duplicate warnings when calling trace_create_file() tracing/kprobes: 'nmissed' not showed correctly for kretprobe tracing: Add test for user space strings when filtering on string pointers tracing: Have syscall trace events use trace_event_buffer_lock_reserve() ...
2 parents 77dbd72 + f37c3bb commit 4d66020

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+6706
-292
lines changed

Documentation/tools/rtla/Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
# Based on bpftool's Documentation Makefile
3+
4+
INSTALL ?= install
5+
RM ?= rm -f
6+
RMDIR ?= rmdir --ignore-fail-on-non-empty
7+
8+
PREFIX ?= /usr/share
9+
MANDIR ?= $(PREFIX)/man
10+
MAN1DIR = $(MANDIR)/man1
11+
12+
MAN1_RST = $(wildcard rtla*.rst)
13+
14+
_DOC_MAN1 = $(patsubst %.rst,%.1,$(MAN1_RST))
15+
DOC_MAN1 = $(addprefix $(OUTPUT),$(_DOC_MAN1))
16+
17+
RST2MAN_DEP := $(shell command -v rst2man 2>/dev/null)
18+
RST2MAN_OPTS += --verbose
19+
20+
$(OUTPUT)%.1: %.rst
21+
ifndef RST2MAN_DEP
22+
$(error "rst2man not found, but required to generate man pages")
23+
endif
24+
rst2man $(RST2MAN_OPTS) $< > $@
25+
26+
man1: $(DOC_MAN1)
27+
man: man1
28+
29+
clean:
30+
$(RM) $(DOC_MAN1)
31+
32+
install: man
33+
$(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR)
34+
$(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(MAN1DIR)
35+
36+
uninstall:
37+
$(RM) $(addprefix $(DESTDIR)$(MAN1DIR)/,$(_DOC_MAN1))
38+
$(RMDIR) $(DESTDIR)$(MAN1DIR)
39+
40+
.PHONY: man man1 clean install uninstall
41+
.DEFAULT_GOAL := man
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
REPORTING BUGS
2+
==============
3+
Report bugs to <lkml@vger.kernel.org>
4+
5+
LICENSE
6+
=======
7+
**rtla** is Free Software licensed under the GNU GPLv2
8+
9+
COPYING
10+
=======
11+
Copyright \(C) 2021 Red Hat, Inc. Free use of this software is granted under
12+
the terms of the GNU Public License (GPL).
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**-b**, **--bucket-size** *N*
2+
3+
Set the histogram bucket size (default *1*).
4+
5+
**-e**, **--entries** *N*
6+
7+
Set the number of entries of the histogram (default 256).
8+
9+
**--no-header**
10+
11+
Do not print header.
12+
13+
**--no-summary**
14+
15+
Do not print summary.
16+
17+
**--no-index**
18+
19+
Do not print index.
20+
21+
**--with-zeros**
22+
23+
Print zero only entries.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
**-c**, **--cpus** *cpu-list*
2+
3+
Set the osnoise tracer to run the sample threads in the cpu-list.
4+
5+
**-d**, **--duration** *time[s|m|h|d]*
6+
7+
Set the duration of the session.
8+
9+
**-D**, **--debug**
10+
11+
Print debug info.
12+
13+
**-t**, **--trace**\[*=file*]
14+
15+
Save the stopped trace to [*file|osnoise_trace.txt*].
16+
17+
**-P**, **--priority** *o:prio|r:prio|f:prio|d:runtime:period*
18+
19+
Set scheduling parameters to the osnoise tracer threads, the format to set the priority are:
20+
21+
- *o:prio* - use SCHED_OTHER with *prio*;
22+
- *r:prio* - use SCHED_RR with *prio*;
23+
- *f:prio* - use SCHED_FIFO with *prio*;
24+
- *d:runtime[us|ms|s]:period[us|ms|s]* - use SCHED_DEADLINE with *runtime* and *period* in nanoseconds.
25+
26+
**-h**, **--help**
27+
28+
Print help menu.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The **rtla osnoise** tool is an interface for the *osnoise* tracer. The
2+
*osnoise* tracer dispatches a kernel thread per-cpu. These threads read the
3+
time in a loop while with preemption, softirq and IRQs enabled, thus
4+
allowing all the sources of operating systme noise during its execution.
5+
The *osnoise*'s tracer threads take note of the delta between each time
6+
read, along with an interference counter of all sources of interference.
7+
At the end of each period, the *osnoise* tracer displays a summary of
8+
the results.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
**-p**, **--period** *us*
2+
3+
Set the *osnoise* tracer period in microseconds.
4+
5+
**-r**, **--runtime** *us*
6+
7+
Set the *osnoise* tracer runtime in microseconds.
8+
9+
**-s**, **--stop** *us*
10+
11+
Stop the trace if a single sample is higher than the argument in microseconds.
12+
If **-T** is set, it will also save the trace to the output.
13+
14+
**-S**, **--stop-total** *us*
15+
16+
Stop the trace if the total sample is higher than the argument in microseconds.
17+
If **-T** is set, it will also save the trace to the output.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The **rtla timerlat** tool is an interface for the *timerlat* tracer. The
2+
*timerlat* tracer dispatches a kernel thread per-cpu. These threads
3+
set a periodic timer to wake themselves up and go back to sleep. After
4+
the wakeup, they collect and generate useful information for the
5+
debugging of operating system timer latency.
6+
7+
The *timerlat* tracer outputs information in two ways. It periodically
8+
prints the timer latency at the timer *IRQ* handler and the *Thread*
9+
handler. It also enable the trace of the most relevant information via
10+
**osnoise:** tracepoints.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
**-p**, **--period** *us*
2+
3+
Set the *timerlat* tracer period in microseconds.
4+
5+
**-i**, **--irq** *us*
6+
7+
Stop trace if the *IRQ* latency is higher than the argument in us.
8+
9+
**-T**, **--thread** *us*
10+
11+
Stop trace if the *Thread* latency is higher than the argument in us.
12+
13+
**-s**, **--stack** *us*
14+
15+
Save the stack trace at the *IRQ* if a *Thread* latency is higher than the
16+
argument in us.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**-q**, **--quiet**
2+
3+
Print only a summary at the end of the session.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
===================
2+
rtla-osnoise-hist
3+
===================
4+
------------------------------------------------------
5+
Display a histogram of the osnoise tracer samples
6+
------------------------------------------------------
7+
8+
:Manual section: 1
9+
10+
SYNOPSIS
11+
========
12+
**rtla osnoise hist** [*OPTIONS*]
13+
14+
DESCRIPTION
15+
===========
16+
.. include:: common_osnoise_description.rst
17+
18+
The **rtla osnoise hist** tool collects all **osnoise:sample_threshold**
19+
occurrence in a histogram, displaying the results in a user-friendly way.
20+
The tool also allows many configurations of the *osnoise* tracer and the
21+
collection of the tracer output.
22+
23+
OPTIONS
24+
=======
25+
.. include:: common_osnoise_options.rst
26+
27+
.. include:: common_hist_options.rst
28+
29+
.. include:: common_options.rst
30+
31+
EXAMPLE
32+
=======
33+
In the example below, *osnoise* tracer threads are set to run with real-time
34+
priority *FIFO:1*, on CPUs *0-11*, for *900ms* at each period (*1s* by
35+
default). The reason for reducing the runtime is to avoid starving the
36+
**rtla** tool. The tool is also set to run for *one minute*. The output
37+
histogram is set to group outputs in buckets of *10us* and *25* entries::
38+
39+
[root@f34 ~/]# rtla osnoise hist -P F:1 -c 0-11 -r 900000 -d 1M -b 10 -e 25
40+
# RTLA osnoise histogram
41+
# Time unit is microseconds (us)
42+
# Duration: 0 00:01:00
43+
Index CPU-000 CPU-001 CPU-002 CPU-003 CPU-004 CPU-005 CPU-006 CPU-007 CPU-008 CPU-009 CPU-010 CPU-011
44+
0 42982 46287 51779 53740 52024 44817 49898 36500 50408 50128 49523 52377
45+
10 12224 8356 2912 878 2667 10155 4573 18894 4214 4836 5708 2413
46+
20 8 5 12 2 13 24 20 41 29 53 39 39
47+
30 1 1 0 0 10 3 6 19 15 31 30 38
48+
40 0 0 0 0 0 4 2 7 2 3 8 11
49+
50 0 0 0 0 0 0 0 0 0 1 1 2
50+
over: 0 0 0 0 0 0 0 0 0 0 0 0
51+
count: 55215 54649 54703 54620 54714 55003 54499 55461 54668 55052 55309 54880
52+
min: 0 0 0 0 0 0 0 0 0 0 0 0
53+
avg: 0 0 0 0 0 0 0 0 0 0 0 0
54+
max: 30 30 20 20 30 40 40 40 40 50 50 50
55+
56+
SEE ALSO
57+
========
58+
**rtla-osnoise**\(1), **rtla-osnoise-top**\(1)
59+
60+
*osnoise* tracer documentation: <https://www.kernel.org/doc/html/latest/trace/osnoise-tracer.html>
61+
62+
AUTHOR
63+
======
64+
Written by Daniel Bristot de Oliveira <bristot@kernel.org>
65+
66+
.. include:: common_appendix.rst

0 commit comments

Comments
 (0)