aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <[email protected]>2019-11-14 18:57:18 +0000
committerDaniel Borkmann <[email protected]>2019-11-15 22:45:37 +0000
commite7bf94dbb882b7d679a6a18e40e4f28076eb249f (patch)
treef6bfb5152e191f6c1883b4bd5b7f357557d0b81b /tools/lib/bpf/libbpf.h
parentbpf: Support attaching tracing BPF program to other BPF programs (diff)
downloadkernel-e7bf94dbb882b7d679a6a18e40e4f28076eb249f.tar.gz
kernel-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 <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r--tools/lib/bpf/libbpf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h
index fbff419f6daf..0dbf4bfba0c4 100644
--- a/tools/lib/bpf/libbpf.h
+++ b/tools/lib/bpf/libbpf.h
@@ -108,8 +108,9 @@ struct bpf_object_open_opts {
* auto-pinned to that path on load; defaults to "/sys/fs/bpf".
*/
const char *pin_root_path;
+ __u32 attach_prog_fd;
};
-#define bpf_object_open_opts__last_field pin_root_path
+#define bpf_object_open_opts__last_field attach_prog_fd
LIBBPF_API struct bpf_object *bpf_object__open(const char *path);
LIBBPF_API struct bpf_object *