summaryrefslogtreecommitdiff
path: root/Documentation/tools
diff options
context:
space:
mode:
authorTomas Glozar <tglozar@redhat.com>2025-11-26 15:42:05 +0100
committerTomas Glozar <tglozar@redhat.com>2026-01-07 15:57:16 +0100
commit26e1a9bd4dd3c03336b608d8068f045d87c8ee6a (patch)
tree8dff259fd452abe2f516d031c6b75d5d9449b681 /Documentation/tools
parent6627556c16fb1122e71110f57a90a961589ad8bf (diff)
Documentation/rtla: Document --bpf-action option
Add new option --bpf-action into common_timerlat_options.txt, including the format in which it takes the BPF program, and a reference to an example. Link: https://lore.kernel.org/r/20251126144205.331954-8-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'Documentation/tools')
-rw-r--r--Documentation/tools/rtla/common_timerlat_options.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/tools/rtla/common_timerlat_options.txt b/Documentation/tools/rtla/common_timerlat_options.txt
index 0cf7eca1f7b6..07a285fcf7cf 100644
--- a/Documentation/tools/rtla/common_timerlat_options.txt
+++ b/Documentation/tools/rtla/common_timerlat_options.txt
@@ -65,3 +65,21 @@
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/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.