tracing: Expose tracepoint BTF ids via tracefs#7797
tracing: Expose tracepoint BTF ids via tracefs#7797kernel-patches-daemon-bpf-rc[bot] wants to merge 3 commits into
Conversation
|
Upstream branch: 576482b |
22963c3 to
372fb59
Compare
|
Upstream branch: 879daba |
9c7ff62 to
798539a
Compare
372fb59 to
2faaa00
Compare
|
Upstream branch: 523d2f4 |
798539a to
9978f6a
Compare
2faaa00 to
8836953
Compare
|
Upstream branch: 3db0419 |
9978f6a to
ca8ecf5
Compare
8836953 to
597f5d0
Compare
|
Upstream branch: b1fcdf9 |
ca8ecf5 to
ee9c174
Compare
597f5d0 to
6f2c1a5
Compare
|
Upstream branch: eb19eea |
ee9c174 to
292ab20
Compare
6f2c1a5 to
fa837ea
Compare
|
Upstream branch: 8496d90 |
292ab20 to
957dfdb
Compare
fa837ea to
100962e
Compare
|
Upstream branch: e42e53a |
957dfdb to
0c2a07a
Compare
100962e to
acd58e2
Compare
|
Upstream branch: be4c6c7 |
0c2a07a to
33e0344
Compare
acd58e2 to
5da2a4f
Compare
|
Upstream branch: b23705e |
4f6d949 to
91d0b42
Compare
fa0c160 to
ca3466a
Compare
|
Upstream branch: f091801 |
91d0b42 to
e56f0df
Compare
ca3466a to
4764b4d
Compare
|
Upstream branch: 39a23ee |
e56f0df to
95535a0
Compare
4764b4d to
8cf039e
Compare
|
Upstream branch: d5e5745 |
95535a0 to
0171183
Compare
8cf039e to
37d815f
Compare
|
Upstream branch: 8ddce41 |
0171183 to
2dc240d
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 |
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>
|
Upstream branch: 30dee2c |
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