rtla/timerlat: Add BPF skeleton to collect samples
authorTomas Glozar <tglozar@redhat.com>
Tue, 18 Feb 2025 14:58:55 +0000 (15:58 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 4 Mar 2025 17:35:18 +0000 (12:35 -0500)
commite34293ddcebd6bd39ff04666f010fce8d1f5e15a
tree4762608c0b46b1b6aa0879fefb360002aac09da5
parent9dc3766ed07c95c9a77fa98dcbc83dcb7f49df3d
rtla/timerlat: Add BPF skeleton to collect samples

Add BPF program that attaches to the osnoise:timerlat_sample tracepoint
and collects both the summary and the histogram (if requested) into BPF
maps (one map of each kind per context).

The program is designed to be used for both timerlat-top and
timerlat-hist. If using with timerlat-top, the "entries" parameter is
set to zero, which prevents the BPF program from recording histogram
entries. In that case, the maps for histograms do not have to be
created, as the BPF verifier will identify the code using them as
unreachable.

An IRQ or thread latency threshold might be supplied to stop recording
if hit, similar to the timerlat tracer threshold, which stops ftrace
tracing if hit. A BPF ringbuffer is used to signal threshold overflow to
userspace. In aa-only mode, this is the only function of the BPF
program.

Cc: John Kacur <jkacur@redhat.com>
Cc: Luis Goncalves <lgoncalv@redhat.com>
Cc: Gabriele Monaco <gmonaco@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Link: https://lore.kernel.org/20250218145859.27762-5-tglozar@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
tools/tracing/rtla/.gitignore
tools/tracing/rtla/Makefile
tools/tracing/rtla/src/Build
tools/tracing/rtla/src/timerlat.bpf.c [new file with mode: 0644]
tools/tracing/rtla/src/timerlat_bpf.c [new file with mode: 0644]
tools/tracing/rtla/src/timerlat_bpf.h [new file with mode: 0644]