linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] rtla/timerlat: Add --bpf-action option
@ 2025-10-17 14:46 Tomas Glozar
  2025-10-17 14:46 ` [PATCH 1/4] rtla/timerlat: Support tail call from BPF program Tomas Glozar
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Tomas Glozar @ 2025-10-17 14:46 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Linux Trace Kernel, John Kacur, Luis Goncalves,
	Costa Shulyupin, Crystal Wood, Wander Lairson Costa,
	Arnaldo Carvalho de Melo, Tomas Glozar

This patchset extends rtla-timerlat's BPF support with the option of
executing a user-supplied BPF program on latency threshold overflow.

See the supplied example and documentation for how to create a program.
bpf_tail_call() is used to chain the program with the built-in BPF
sample collection program, if the threshold is hit.

The feature can be used for both in-kernel data collection and sending
signals to userspace directly from the kernel, if the kernel version
allows it.

Note: The patchset will have to be rebased on top of [1], or vice versa,
since they both touch stop_tracing() ([1] adds one call of it, and this
patchset adds an extra argument to it).

I have contemplated adding this as --on-threshold bpf,... but it does
not fit the existing actions infrastructure very well, since the action
happens in the BPF program, not in RTLA, and only one BPF action is
supported.

[1] https://lore.kernel.org/linux-trace-kernel/20251006143100.137255-1-tglozar@redhat.com/

Tomas Glozar (4):
  rtla/timerlat: Support tail call from BPF program
  rtla/timerlat: Add --bpf-action option
  rtla/timerlat: Add example for BPF action program
  Documentation/rtla: Document --bpf-action option

 .../tools/rtla/common_timerlat_options.rst    | 18 +++++
 .../tracing/rtla/sample/timerlat_bpf_action.c | 16 +++++
 tools/tracing/rtla/src/timerlat.bpf.c         | 23 ++++++-
 tools/tracing/rtla/src/timerlat.c             | 11 +++
 tools/tracing/rtla/src/timerlat.h             |  2 +-
 tools/tracing/rtla/src/timerlat_bpf.c         | 67 +++++++++++++++++++
 tools/tracing/rtla/src/timerlat_bpf.h         |  7 +-
 tools/tracing/rtla/src/timerlat_hist.c        |  5 ++
 tools/tracing/rtla/src/timerlat_top.c         |  5 ++
 9 files changed, 149 insertions(+), 5 deletions(-)
 create mode 100644 tools/tracing/rtla/sample/timerlat_bpf_action.c

-- 
2.51.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-10-27 12:30 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 14:46 [PATCH 0/4] rtla/timerlat: Add --bpf-action option Tomas Glozar
2025-10-17 14:46 ` [PATCH 1/4] rtla/timerlat: Support tail call from BPF program Tomas Glozar
2025-10-17 14:46 ` [PATCH 2/4] rtla/timerlat: Add --bpf-action option Tomas Glozar
2025-10-20 14:04   ` Wander Lairson Costa
2025-10-20 17:51   ` Crystal Wood
2025-10-17 14:46 ` [PATCH 3/4] rtla/timerlat: Add example for BPF action program Tomas Glozar
2025-10-20 17:53   ` Crystal Wood
2025-10-21 14:54     ` Tomas Glozar
2025-10-21 15:58       ` Crystal Wood
2025-10-21 17:02         ` Steven Rostedt
2025-10-21 17:32           ` Crystal Wood
2025-10-23  7:27             ` Tomas Glozar
2025-10-24  1:49               ` Crystal Wood
2025-10-27 10:34                 ` Tomas Glozar
2025-10-27 12:30                   ` Crystal Wood
2025-10-17 14:46 ` [PATCH 4/4] Documentation/rtla: Document --bpf-action option Tomas Glozar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).