OSDN Git Service

bpf: Add typecast to raw_tracepoints to help BTF generation
authorAlexei Starovoitov <ast@kernel.org>
Wed, 16 Oct 2019 03:24:55 +0000 (20:24 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 Oct 2019 14:44:35 +0000 (16:44 +0200)
commite8c423fb31fa8b1ef6d7cd14a168de33e7c0d702
treedeed1e4a6eb1316a94197c9de41b9c24aff63210
parenteac9153f2b584c702cea02c1f1a57d85aa9aea42
bpf: Add typecast to raw_tracepoints to help BTF generation

When pahole converts dwarf to btf it emits only used types.
Wrap existing __bpf_trace_##template() function into
btf_trace_##template typedef and use it in type cast to
make gcc emits this type into dwarf. Then pahole will convert it to btf.
The "btf_trace_" prefix will be used to identify BTF enabled raw tracepoints.

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: John Fastabend <john.fastabend@gmail.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20191016032505.2089704-2-ast@kernel.org
include/trace/bpf_probe.h