]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: support bpf_get_func_arg() for BPF_TRACE_RAW_TP
authorMenglong Dong <menglong8.dong@gmail.com>
Wed, 21 Jan 2026 04:43:47 +0000 (12:43 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 21 Jan 2026 17:31:35 +0000 (09:31 -0800)
commit85c7f914714741de992fc19c2ba673f6c400a584
tree43b4b1ba56f68ca75d5b0835e98ac38b85b6f665
parentba335bf3a5b8c5f47d56e9be3f96e0989dad5346
bpf: support bpf_get_func_arg() for BPF_TRACE_RAW_TP

For now, bpf_get_func_arg() and bpf_get_func_arg_cnt() is not supported by
the BPF_TRACE_RAW_TP, which is not convenient to get the argument of the
tracepoint, especially for the case that the position of the arguments in
a tracepoint can change.

The target tracepoint BTF type id is specified during loading time,
therefore we can get the function argument count from the function
prototype instead of the stack.

Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20260121044348.113201-2-dongml2@chinatelecom.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/verifier.c
kernel/trace/bpf_trace.c