Skip to content

Commit 26e1a9b

Browse files
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>
1 parent 6627556 commit 26e1a9b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Documentation/tools/rtla/common_timerlat_options.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,21 @@
6565
Set timerlat to run without workload, waiting for the user to dispatch a per-cpu
6666
task that waits for a new period on the tracing/osnoise/per_cpu/cpu$ID/timerlat_fd.
6767
See linux/tools/rtla/example/timerlat_load.py for an example of user-load code.
68+
69+
**--bpf-action** *bpf-program*
70+
71+
Loads a BPF program from an ELF file and executes it when a latency threshold is exceeded.
72+
73+
The BPF program must be a valid ELF file loadable with libbpf. The program must contain
74+
a function named ``action_handler``, stored in an ELF section with the ``tp_`` prefix.
75+
The prefix is used by libbpf to set BPF program type to BPF_PROG_TYPE_TRACEPOINT.
76+
77+
The program receives a ``struct trace_event_raw_timerlat_sample`` parameter
78+
containing timerlat sample data.
79+
80+
An example is provided in ``tools/tracing/rtla/example/timerlat_bpf_action.c``.
81+
This example demonstrates how to create a BPF program that prints latency information using
82+
bpf_trace_printk() when a threshold is exceeded.
83+
84+
**Note**: BPF actions require BPF support to be available. If BPF is not available
85+
or disabled, the tool falls back to tracefs mode and BPF actions are not supported.

0 commit comments

Comments
 (0)