[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <67caphyfdl7bivf2kqkp72eqd7bi4pjpbmsbu5loco7j46fmqw@enanot5eztwc>
Date: Mon, 3 Nov 2025 10:44:08 -0300
From: Wander Lairson Costa <wander@...hat.com>
To: Tomas Glozar <tglozar@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>, Linux Trace Kernel <linux-trace-kernel@...r.kernel.org>,
John Kacur <jkacur@...hat.com>, Luis Goncalves <lgoncalv@...hat.com>,
Costa Shulyupin <costa.shul@...hat.com>, Crystal Wood <crwood@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: [PATCH v3 7/7] Documentation/rtla: Document --bpf-action option
On Mon, Oct 27, 2025 at 04:34:01PM +0100, Tomas Glozar wrote:
> 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.
>
> Signed-off-by: Tomas Glozar <tglozar@...hat.com>
> ---
> .../tools/rtla/common_timerlat_options.rst | 20 +++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/Documentation/tools/rtla/common_timerlat_options.rst b/Documentation/tools/rtla/common_timerlat_options.rst
> index c6046fcf52dc..7e08a27e87fe 100644
> --- a/Documentation/tools/rtla/common_timerlat_options.rst
> +++ b/Documentation/tools/rtla/common_timerlat_options.rst
> @@ -65,3 +65,23 @@
> 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``, declared with ``SEC("tp/timerlat_action")`` or
> + a different section name beginning with "tp/". This tells libbpf that the program type is
nit: simply document that the section name must start with "tp/", the
part saying about "tp/timerlat_action" seems redudant, IIUC.
> + BPF_PROG_TYPE_TRACEPOINT, without it, the program will not be loaded properly.
> +
> + 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 will fall back to tracefs mode and BPF actions will not be
> + supported.
> --
> 2.51.0
>
Powered by blists - more mailing lists