diff options
author | Alexei Starovoitov <ast@kernel.org> | 2020-06-28 10:06:53 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-06-28 10:13:35 -0700 |
commit | afa12644c877d3f627281bb6493d7ca8f9976e3d (patch) | |
tree | 48ead881f127e3c36588a0b6e34297d38102bddf /tools/lib/bpf/libbpf.h | |
parent | 16d37ee3d2b1c30052ba5ebb69556040fc174061 (diff) | |
parent | 5712174c5c9e3d684ad05d4aaed1e14acda4bb74 (diff) |
Merge branch 'libbpf_autoload_knob'
Andrii Nakryiko says:
====================
Add ability to turn off default auto-loading of each BPF program by libbpf on
BPF object load. This is the feature that allows BPF applications to have
optional functionality, which is only excercised on kernel that support
necessary features, while falling back to reduced/less performant
functionality, if kernel is outdated.
====================
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index fdd279fb1866..2335971ed0bd 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -200,6 +200,8 @@ LIBBPF_API void bpf_program__set_ifindex(struct bpf_program *prog, LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog); LIBBPF_API const char *bpf_program__title(const struct bpf_program *prog, bool needs_copy); +LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog); +LIBBPF_API int bpf_program__set_autoload(struct bpf_program *prog, bool autoload); /* returns program size in bytes */ LIBBPF_API size_t bpf_program__size(const struct bpf_program *prog); |