]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: Add typecast to bpf helpers to help BTF generation
authorAlexei Starovoitov <ast@kernel.org>
Wed, 16 Oct 2019 03:24:56 +0000 (20:24 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 17 Oct 2019 14:44:35 +0000 (16:44 +0200)
commite3fc7cbf8ee78d597dec3614639b6f1ce707e8c0
tree522ea704e48e044ab6a643025e1a84c4ec3ede56
parent963da5cab156e7dfd39dab3746e81af22826a4ba
bpf: Add typecast to bpf helpers to help BTF generation

When pahole converts dwarf to btf it emits only used types.
Wrap existing bpf helper functions into typedef and use it in
typecast to make gcc emits this type into dwarf.
Then pahole will convert it to btf.
The "btf_#name_of_helper" types will be used to figure out
types of arguments of bpf helpers.
The generated code before and after is the same.
Only dwarf and btf sections are different.

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-3-ast@kernel.org
include/linux/filter.h