From: Tomas Glozar <tglozar@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>,
John Kacur <jkacur@redhat.com>,
Luis Goncalves <lgoncalv@redhat.com>,
Costa Shulyupin <costa.shul@redhat.com>,
Crystal Wood <crwood@redhat.com>,
Wander Lairson Costa <wander@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Tomas Glozar <tglozar@redhat.com>
Subject: [PATCH v4 7/7] Documentation/rtla: Document --bpf-action option
Date: Wed, 26 Nov 2025 15:42:05 +0100 [thread overview]
Message-ID: <20251126144205.331954-8-tglozar@redhat.com> (raw)
In-Reply-To: <20251126144205.331954-1-tglozar@redhat.com>
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@redhat.com>
---
.../tools/rtla/common_timerlat_options.txt | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
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.
--
2.51.1
prev parent reply other threads:[~2025-11-26 14:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 14:41 [PATCH v4 0/7] rtla/timerlat: Add low-latency BPF-based actions Tomas Glozar
2025-11-26 14:41 ` [PATCH v4 1/7] rtla/timerlat: Support tail call from BPF program Tomas Glozar
2025-11-26 14:42 ` [PATCH v4 2/7] rtla/timerlat: Add --bpf-action option Tomas Glozar
2025-11-26 14:42 ` [PATCH v4 3/7] rtla/timerlat: Add example for BPF action program Tomas Glozar
2025-12-16 15:22 ` Wander Lairson Costa
2025-12-16 15:28 ` Tomas Glozar
2025-11-26 14:42 ` [PATCH v4 4/7] rtla/tests: Test " Tomas Glozar
2025-11-26 14:42 ` [PATCH v4 5/7] rtla/tests: Run Test::Harness in verbose mode Tomas Glozar
2025-11-26 14:42 ` [PATCH v4 6/7] Documentation/rtla: Rename sample/ to example/ Tomas Glozar
2025-11-26 14:42 ` Tomas Glozar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251126144205.331954-8-tglozar@redhat.com \
--to=tglozar@redhat.com \
--cc=acme@kernel.org \
--cc=costa.shul@redhat.com \
--cc=crwood@redhat.com \
--cc=jkacur@redhat.com \
--cc=lgoncalv@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=wander@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®