diff options
author | Alexei Starovoitov <ast@kernel.org> | 2019-10-15 20:24:59 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-10-17 16:44:35 +0200 |
commit | f75a697e091375c96c35f733a664e3557171f28b (patch) | |
tree | 18d1e593aea8354b271ca479cf8ea19d407c4c58 /Kbuild | |
parent | ccfe29eb29c2edcea6552072ef00ff4117f53e83 (diff) | |
download | linux-f75a697e091375c96c35f733a664e3557171f28b.tar.bz2 |
libbpf: Auto-detect btf_id of BTF-based raw_tracepoints
It's a responsiblity of bpf program author to annotate the program
with SEC("tp_btf/name") where "name" is a valid raw tracepoint.
The libbpf will try to find "name" in vmlinux BTF and error out
in case vmlinux BTF is not available or "name" is not found.
If "name" is indeed a valid raw tracepoint then in-kernel BTF
will have "btf_trace_##name" typedef that points to function
prototype of that raw tracepoint. BTF description captures
exact argument the kernel C code is passing into raw tracepoint.
The kernel verifier will check the types while loading bpf program.
libbpf keeps BTF type id in expected_attach_type, but since
kernel ignores this attribute for tracing programs copy it
into attach_btf_id attribute before loading.
Later the kernel will use prog->attach_btf_id to select raw tracepoint
during bpf_raw_tracepoint_open syscall command.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191016032505.2089704-6-ast@kernel.org
Diffstat (limited to 'Kbuild')
0 files changed, 0 insertions, 0 deletions