aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/bpf.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2019-11-14 10:57:18 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2019-11-15 23:45:37 +0100
commite7bf94dbb882b7d679a6a18e40e4f28076eb249f (patch)
treef6bfb5152e191f6c1883b4bd5b7f357557d0b81b /tools/lib/bpf/bpf.h
parentbpf: Support attaching tracing BPF program to other BPF programs (diff)
downloadlinux-dev-e7bf94dbb882b7d679a6a18e40e4f28076eb249f.tar.xz
linux-dev-e7bf94dbb882b7d679a6a18e40e4f28076eb249f.zip
libbpf: Add support for attaching BPF programs to other BPF programs
Extend libbpf api to pass attach_prog_fd into bpf_object__open. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Song Liu <songliubraving@fb.com> Link: https://lore.kernel.org/bpf/20191114185720.1641606-19-ast@kernel.org
Diffstat (limited to 'tools/lib/bpf/bpf.h')
-rw-r--r--tools/lib/bpf/bpf.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
index 1c53bc5b4b3c..3c791fa8e68e 100644
--- a/tools/lib/bpf/bpf.h
+++ b/tools/lib/bpf/bpf.h
@@ -77,7 +77,10 @@ struct bpf_load_program_attr {
const struct bpf_insn *insns;
size_t insns_cnt;
const char *license;
- __u32 kern_version;
+ union {
+ __u32 kern_version;
+ __u32 attach_prog_fd;
+ };
union {
__u32 prog_ifindex;
__u32 attach_btf_id;