diff options
Diffstat (limited to 'tools/lib/bpf/libbpf_internal.h')
| -rw-r--r-- | tools/lib/bpf/libbpf_internal.h | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/tools/lib/bpf/libbpf_internal.h b/tools/lib/bpf/libbpf_internal.h index 5e8166a2f3d8..5dbe4f463880 100644 --- a/tools/lib/bpf/libbpf_internal.h +++ b/tools/lib/bpf/libbpf_internal.h @@ -291,6 +291,45 @@ static inline bool libbpf_validate_opts(const char *opts,  					(opts)->sz - __off);		      \  }) +enum kern_feature_id { +	/* v4.14: kernel support for program & map names. */ +	FEAT_PROG_NAME, +	/* v5.2: kernel support for global data sections. */ +	FEAT_GLOBAL_DATA, +	/* BTF support */ +	FEAT_BTF, +	/* BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO support */ +	FEAT_BTF_FUNC, +	/* BTF_KIND_VAR and BTF_KIND_DATASEC support */ +	FEAT_BTF_DATASEC, +	/* BTF_FUNC_GLOBAL is supported */ +	FEAT_BTF_GLOBAL_FUNC, +	/* BPF_F_MMAPABLE is supported for arrays */ +	FEAT_ARRAY_MMAP, +	/* kernel support for expected_attach_type in BPF_PROG_LOAD */ +	FEAT_EXP_ATTACH_TYPE, +	/* bpf_probe_read_{kernel,user}[_str] helpers */ +	FEAT_PROBE_READ_KERN, +	/* BPF_PROG_BIND_MAP is supported */ +	FEAT_PROG_BIND_MAP, +	/* Kernel support for module BTFs */ +	FEAT_MODULE_BTF, +	/* BTF_KIND_FLOAT support */ +	FEAT_BTF_FLOAT, +	/* BPF perf link support */ +	FEAT_PERF_LINK, +	/* BTF_KIND_DECL_TAG support */ +	FEAT_BTF_DECL_TAG, +	/* BTF_KIND_TYPE_TAG support */ +	FEAT_BTF_TYPE_TAG, +	/* memcg-based accounting for BPF maps and progs */ +	FEAT_MEMCG_ACCOUNT, +	__FEAT_CNT, +}; + +int probe_memcg_account(void); +bool kernel_supports(const struct bpf_object *obj, enum kern_feature_id feat_id); +int bump_rlimit_memlock(void);  int parse_cpu_mask_str(const char *s, bool **mask, int *mask_sz);  int parse_cpu_mask_file(const char *fcpu, bool **mask, int *mask_sz); | 
