diff options
| author | Yonghong Song <[email protected]> | 2020-07-20 16:33:58 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-07-21 20:26:26 +0000 |
| commit | bc4f0548f683a3d53359cef15f088d2d5bb4bc39 (patch) | |
| tree | f2537b237c573ed4d8316b26adeee72e0b0a4b65 /tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | |
| parent | samples/bpf, selftests/bpf: Use bpf_probe_read_kernel (diff) | |
| download | kernel-bc4f0548f683a3d53359cef15f088d2d5bb4bc39.tar.gz kernel-bc4f0548f683a3d53359cef15f088d2d5bb4bc39.zip | |
bpf: Compute bpf_skc_to_*() helper socket btf ids at build time
Currently, socket types (struct tcp_sock, udp_sock, etc.)
used by bpf_skc_to_*() helpers are computed when vmlinux_btf
is first built in the kernel.
Commit 5a2798ab32ba
("bpf: Add BTF_ID_LIST/BTF_ID/BTF_ID_UNUSED macros")
implemented a mechanism to compute btf_ids at kernel build
time which can simplify kernel implementation and reduce
runtime overhead by removing in-kernel btf_id calculation.
This patch did exactly this, removing in-kernel btf_id
computation and utilizing build-time btf_id computation.
If CONFIG_DEBUG_INFO_BTF is not defined, BTF_ID_LIST will
define an array with size of 5, which is not enough for
btf_sock_ids. So define its own static array if
CONFIG_DEBUG_INFO_BTF is not defined.
Signed-off-by: Yonghong Song <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/resolve_btfids.c')
0 files changed, 0 insertions, 0 deletions
