[GIT PULL] tracing/tools: Updates for 6.15
From: Steven Rostedt
Date: Thu Mar 27 2025 - 12:52:02 EST
Costa Shulyupin <costa.shul@xxxxxxxxxx>, John Kacur <jkacur@xxxxxxxxxx>, Tomas Glozar <tglozar@xxxxxxxxxx>
Linus,
tracing tooling updates for 6.15:
- Allow RTLA to collect data via BPF
The current implementation of rtla uses libtracefs and libtraceevent to
pull sample events generated by the timerlat tracer from the trace
buffer. rtla then processes the sample by updating the histogram and
summary (current, maximum, minimum, and sum values) as well as checks
if tracing has been stopped due to threshold overflow.
In use cases where a large number of samples is being generated, that
is, with measurements running on many CPUs and with a low interval,
this sample processing design causes a significant CPU load on the rtla
side. Furthermore, with >100 CPUs and 100us interval, rtla was reported
as not being able to keep up with the samples and dropping most of them,
leading to it being unusable.
Change the way the timerlat trace processes samples by attaching
a BPF program to the trace event using the BPF skeleton feature of bpftool.
Unlike the current implementation, the BPF implementation does not check
whether tracing is stopped (in BPF mode, tracing is always off to improve
performance), but waits for a write to a BPF ringbuffer instead. This allows
rtla to exit immediately when a threshold is violated, without waiting
for the next iteration of the while loop.
If the requirements for the BPF implementation are not met, either at
build time or at run time, the current implementation is used as
fallback. Which implementation is being used can be seen when running
rtla timerlat with "-D" option. rtla can be forced to run in non-BPF
mode by setting the RTLA_NO_BPF option to 1, for debugging purposes.
- Fix LD_FLAGS from being dropped in build
- Refactor code to remove duplication of save_trace_to_file
- Always set options and do not rely on default settings
Do not rely on the default kernel settings of the tracers when
starting. They could have been changed by the user which gives
inconsistent results. Always set the options that rtla expects.
- Add creation of ctags and TAGS for traversing code
Please pull the latest trace-tools-v6.15 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-tools-v6.15
Tag SHA1: cab13e49ba8fc5d0e9545cd41e34e59dabbd3954
Head SHA1: 732032692f6ae311bc35159b18e5b7c5e64010fc
Costa Shulyupin (1):
rtla: Refactor save_trace_to_file
John Kacur (1):
rtla: Add the ability to create ctags and etags
Tomas Glozar (17):
rtla/timerlat: Unify params struct
tools/build: Add bpftool-skeletons feature test
rtla: Add optional dependency on BPF tooling
rtla/timerlat: Add BPF skeleton to collect samples
rtla/timerlat_hist: Use BPF to collect samples
rtla/timerlat_top: Move divisor to update
rtla/timerlat_top: Use BPF to collect samples
rtla/timerlat: Test BPF mode
tools/rv: Keep user LDFLAGS in build
tools/build: Use SYSTEM_BPFTOOL for system bpftool
rtla: Fix segfault in save_trace_to_file call
rtla/osnoise: Unify params struct
rtla: Unify apply_config between top and hist
rtla/osnoise: Set OSNOISE_WORKLOAD to true
rtla: Always set all tracer options
rtla/tests: Reset osnoise options before check
rtla/tests: Test setting default options
----
tools/build/Makefile.feature | 3 +-
tools/build/feature/Makefile | 3 +
tools/scripts/Makefile.include | 3 +
tools/tracing/rtla/.gitignore | 1 +
tools/tracing/rtla/Makefile | 20 +-
tools/tracing/rtla/Makefile.config | 42 +++
tools/tracing/rtla/Makefile.rtla | 17 +-
tools/tracing/rtla/src/Build | 1 +
tools/tracing/rtla/src/osnoise.c | 86 +++++-
tools/tracing/rtla/src/osnoise.h | 50 ++++
tools/tracing/rtla/src/osnoise_hist.c | 124 ++-------
tools/tracing/rtla/src/osnoise_top.c | 126 +--------
tools/tracing/rtla/src/timerlat.bpf.c | 149 ++++++++++
tools/tracing/rtla/src/timerlat.c | 106 ++++++++
tools/tracing/rtla/src/timerlat.h | 54 ++++
tools/tracing/rtla/src/timerlat_aa.c | 2 -
tools/tracing/rtla/src/timerlat_bpf.c | 166 ++++++++++++
tools/tracing/rtla/src/timerlat_bpf.h | 59 ++++
tools/tracing/rtla/src/timerlat_hist.c | 354 ++++++++++++------------
tools/tracing/rtla/src/timerlat_top.c | 482 ++++++++++++++++++---------------
tools/tracing/rtla/src/trace.c | 4 +
tools/tracing/rtla/tests/engine.sh | 66 +++++
tools/tracing/rtla/tests/osnoise.t | 6 +
tools/tracing/rtla/tests/timerlat.t | 14 +
tools/verification/rv/Makefile.rv | 2 +-
25 files changed, 1315 insertions(+), 625 deletions(-)
create mode 100644 tools/tracing/rtla/src/timerlat.bpf.c
create mode 100644 tools/tracing/rtla/src/timerlat_bpf.c
create mode 100644 tools/tracing/rtla/src/timerlat_bpf.h
---------------------------