tracing: Expose tracepoint BTF ids via tracefs#12122
tracing: Expose tracepoint BTF ids via tracefs#12122kernel-patches-daemon-bpf[bot] wants to merge 3 commits into
Conversation
|
Upstream branch: 576482b |
8668cd4 to
ceeb3aa
Compare
|
Upstream branch: 523d2f4 |
541548d to
aef120c
Compare
ceeb3aa to
ec31e3e
Compare
|
Upstream branch: 3db0419 |
aef120c to
55df02d
Compare
ec31e3e to
b3beebb
Compare
|
Upstream branch: b1fcdf9 |
55df02d to
842c4b9
Compare
b3beebb to
01a7a7f
Compare
|
Upstream branch: eb19eea |
842c4b9 to
0b9413e
Compare
01a7a7f to
f1eeafa
Compare
|
Upstream branch: 8496d90 |
0b9413e to
9bff555
Compare
f1eeafa to
d34771f
Compare
|
Upstream branch: e42e53a |
9bff555 to
40e4457
Compare
d34771f to
fe195c9
Compare
|
Upstream branch: be4c6c7 |
40e4457 to
eb5b609
Compare
fe195c9 to
55e1ca0
Compare
|
Upstream branch: a4a5d4e |
|
Upstream branch: bbb5e2e |
27a56c7 to
bda1e1e
Compare
7519b45 to
fb70503
Compare
|
Upstream branch: f091801 |
bda1e1e to
6d449eb
Compare
fb70503 to
bbeb417
Compare
|
Upstream branch: d5e5745 |
6d449eb to
571ba22
Compare
bbeb417 to
5a9a745
Compare
|
Upstream branch: 8ddce41 |
571ba22 to
53a47c0
Compare
|
Upstream branch: f6cd665 |
|
Upstream branch: 5b03831 |
|
Upstream branch: c49f336 |
|
Upstream branch: 1444ee8 |
|
Upstream branch: 63a6f3b |
|
Upstream branch: 50dff00 |
|
Upstream branch: b9452b5 |
|
Upstream branch: dd0f968 |
|
Upstream branch: f1a660b |
|
Upstream branch: 68f4e48 |
|
Upstream branch: c15261b |
|
Upstream branch: 140fa23 |
|
Upstream branch: 2e8ad1f |
|
Upstream branch: 30dee2c |
Drop the static qualifier and add prototypes to <linux/btf.h> so the tracing core can look up module BTF and translate ids stored by resolve_btfids (which are local to a module's split BTF) into the runtime ids used by the kernel. Used by the upcoming events/<sys>/<event>/btf_ids tracefs interface. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Add events/<sys>/<event>/btf_ids, a per-template file that exposes
the BTF ids resolve_btfids fills in for each tracepoint:
btf_obj_id BTF object owning the ids below
raw_btf_id FUNC_PROTO of __bpf_trace_<call> (named args), consumed
by raw_tp / tp_btf BPF programs
tp_btf_id trace_event_raw_<call> ring-buffer record, consumed by
classic BPF_PROG_TYPE_TRACEPOINT programs
DECLARE_EVENT_CLASS now emits a 2-entry BTF_ID_LIST (FUNC __bpf_trace_*
and STRUCT trace_event_raw_*) and stores the pointer in
trace_event_class.
Per-syscall events under syscalls/ share the handcrafted classes
event_class_syscall_{enter,exit} instead of going through
DECLARE_EVENT_CLASS. Wire those classes to the BTF id lists
generated for sys_enter / sys_exit so all ~700 per-syscall
events expose the shared dispatcher prototype and record.
The per-syscall events do not own their own tracepoint
(they share sys_enter/sys_exit), so raw_btf_id is reported as 0
on those events; the meaningful raw_btf_id is exposed on
raw_syscalls/sys_{enter,exit}/btf_ids where raw_tp / tp_btf
programs can actually attach.
Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Read events/bpf_testmod/bpf_testmod_test_read/btf_ids and verify the exported FUNC_PROTO matches the testmod tracepoint signature (__data, struct task_struct *task, struct bpf_testmod_test_read_ctx *ctx) and the record struct trace_event_raw_bpf_testmod_test_read carries the fields declared by TP_STRUCT__entry. Use the testmod tracepoint so the test exercises the module/split-BTF path (btf_relocate_id) rather than vmlinux only, and falls back from /sys/kernel/tracing to /sys/kernel/debug/tracing when tracefs is not mounted at the new location. Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
Pull request for series with
subject: tracing: Expose tracepoint BTF ids via tracefs
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1096695