aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorDaniel T. Lee <[email protected]>2020-05-16 04:06:06 +0000
committerDaniel Borkmann <[email protected]>2020-05-19 15:12:56 +0000
commitbc1a85977b950407d67cd1e5b74f261a4bee3284 (patch)
treee4c5283ae3815b08fe2a09a34576a7ebf7931ecf /tools/bpf/bpftool/prog.c
parentsamples, bpf: Refactor kprobe tracing user progs with libbpf (diff)
downloadkernel-bc1a85977b950407d67cd1e5b74f261a4bee3284.tar.gz
kernel-bc1a85977b950407d67cd1e5b74f261a4bee3284.zip
samples, bpf: Refactor tail call user progs with libbpf
BPF tail call uses the BPF_MAP_TYPE_PROG_ARRAY type map for calling into other BPF programs and this PROG_ARRAY should be filled prior to use. Currently, samples with the PROG_ARRAY type MAP fill this program array with bpf_load. For bpf_load to fill this map, kernel BPF program must specify the section with specific format of <prog_type>/<array_idx> (e.g. SEC("socket/0")) But by using libbpf instead of bpf_load, user program can specify which programs should be added to PROG_ARRAY. The advantage of this approach is that you can selectively add only the programs you want, rather than adding all of them to PROG_ARRAY, and it's much more intuitive than the traditional approach. This commit refactors user programs with the PROG_ARRAY type MAP with libbpf instead of using bpf_load. Signed-off-by: Daniel T. Lee <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions