summaryrefslogtreecommitdiff
path: root/Documentation/tools/rtla
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-12 14:31:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-12 14:31:02 -0800
commit582a1ef360a05bff4350bbf6e383f61d26b804f0 (patch)
tree370d2899b22883df03954f9792da8a53f14bf836 /Documentation/tools/rtla
parentf75c03a761b737c4ee94c17f154967261f00ab4d (diff)
parent6ea8a206108fe8b5940c2797afc54ae9f5a7bbdd (diff)
Merge tag 'trace-rtla-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull RTLA updates from Steven Rostedt: - Remove unused function declarations Some functions were removed in recent code consolidation 6.18, but their prototypes were not removed from headers. Remove them. - Set stop threshold after enabling instances Prefer recording samples without stopping on them on the start of tracing to stopping on samples that are never recorded. This fixes flakiness of some RTLA tests and unifies behavior of sample collection between tracefs mode and BPF mode. - Consolidate usage help message implementation RTLA tools (osnoise-top, osnoise-hist, timerlat-top, timerlat-hist) each implement usage help individually. Move common logic between them into a new function to reduce code duplication. - Add BPF actions feature Add option --bpf-action to attach a BPF program (passed as filename of its ELF representation) to be executed via BPF tail call at latency threshold. - Consolidate command line option parsing Each RTLA tool implements the parsing of command line options individually. Now that we have a common structure for parameters, unify the parsing of those options common among all four tools into one function. - De-duplicate cgroup common code Two functions in utils.c, setting cgroup for comm and setting cgroup for pid, duplicate code for constructing the cgroup path. Extract it to a new helper function. - String and error handling fixes and cleanups There were several instances of unsafe string and error handling that could cause invalid memory access; fix them. Also, remove a few unused headers, update .gitignore, and deduplicate code. * tag 'trace-rtla-v7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: (30 commits) rtla: Fix parse_cpu_set() bug introduced by strtoi() rtla: Fix parse_cpu_set() return value documentation rtla: Ensure null termination after read operations in utils.c rtla: Make stop_tracing variable volatile rtla: Add generated output files to gitignore rtla: Fix NULL pointer dereference in actions_parse rtla: Remove unused headers rtla: Remove redundant memset after calloc rtla: Use standard exit codes for result enum rtla: Replace atoi() with a robust strtoi() rtla: Introduce for_each_action() helper tools/rtla: Deduplicate cgroup path opening code tools/rtla: Consolidate -H/--house-keeping option parsing tools/rtla: Consolidate -P/--priority option parsing tools/rtla: Consolidate -e/--event option parsing tools/rtla: Consolidate -d/--duration option parsing tools/rtla: Consolidate -D/--debug option parsing tools/rtla: Consolidate -C/--cgroup option parsing tools/rtla: Consolidate -c/--cpus option parsing tools/rtla: Add common_parse_options() ...
Diffstat (limited to 'Documentation/tools/rtla')
-rw-r--r--Documentation/tools/rtla/common_timerlat_options.txt20
1 files changed, 19 insertions, 1 deletions
diff --git a/Documentation/tools/rtla/common_timerlat_options.txt b/Documentation/tools/rtla/common_timerlat_options.txt
index 33070b264cae..07a285fcf7cf 100644
--- a/Documentation/tools/rtla/common_timerlat_options.txt
+++ b/Documentation/tools/rtla/common_timerlat_options.txt
@@ -64,4 +64,22 @@
Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
- See linux/tools/rtla/sample/timerlat_load.py for an example of user-load code.
+ See linux/tools/rtla/example/timerlat_load.py for an example of user-load code.
+
+**--bpf-action** *bpf-program*
+
+ Loads a BPF program from an ELF file and executes it when a latency threshold is exceeded.
+
+ The BPF program must be a valid ELF file loadable with libbpf. The program must contain
+ a function named ``action_handler``, stored in an ELF section with the ``tp_`` prefix.
+ The prefix is used by libbpf to set BPF program type to BPF_PROG_TYPE_TRACEPOINT.
+
+ The program receives a ``struct trace_event_raw_timerlat_sample`` parameter
+ containing timerlat sample data.
+
+ An example is provided in ``tools/tracing/rtla/example/timerlat_bpf_action.c``.
+ This example demonstrates how to create a BPF program that prints latency information using
+ bpf_trace_printk() when a threshold is exceeded.
+
+ **Note**: BPF actions require BPF support to be available. If BPF is not available
+ or disabled, the tool falls back to tracefs mode and BPF actions are not supported.