diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2023-12-13 11:08:36 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-12-13 15:47:05 -0800 |
commit | ab8fc393b27cd2d6dd1ced1ba2358ddcd123fc15 (patch) | |
tree | 524a70762bbe40613a41701e3a1487d3b4f8f62c /tools/lib/bpf/libbpf_internal.h | |
parent | 29c302a2e265a356434b005155990a9e766db75d (diff) | |
download | linux-ab8fc393b27cd2d6dd1ced1ba2358ddcd123fc15.tar.gz linux-ab8fc393b27cd2d6dd1ced1ba2358ddcd123fc15.tar.bz2 linux-ab8fc393b27cd2d6dd1ced1ba2358ddcd123fc15.zip |
libbpf: move feature detection code into its own file
It's quite a lot of well isolated code, so it seems like a good
candidate to move it out of libbpf.c to reduce its size.
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231213190842.3844987-5-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
-rw-r--r-- | tools/lib/bpf/libbpf_internal.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h index 754a432335e4..db4a499c0ec5 100644 --- a/tools/lib/bpf/libbpf_internal.h +++ b/tools/lib/bpf/libbpf_internal.h @@ -360,10 +360,20 @@ enum kern_feature_id { __FEAT_CNT, }; -struct kern_feature_cache; +enum kern_feature_result { + FEAT_UNKNOWN = 0, + FEAT_SUPPORTED = 1, + FEAT_MISSING = 2, +}; + +struct kern_feature_cache { + enum kern_feature_result res[__FEAT_CNT]; +}; + bool feat_supported(struct kern_feature_cache *cache, enum kern_feature_id feat_id); bool kernel_supports(const struct bpf_object *obj, enum kern_feature_id feat_id); +int probe_kern_syscall_wrapper(void); int probe_memcg_account(void); int bump_rlimit_memlock(void); |