aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lib/bpf/libbpf.c
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2021-12-02 15:08:37 -0800
committerAlexei Starovoitov <ast@kernel.org>2021-12-02 15:23:41 -0800
commit080a70b21f476b39ad66524c0ce0729972c61a10 (patch)
treedad6591838a9b35d8414ed4e80d0763b02ff2287 /tools/lib/bpf/libbpf.c
parentselftests/bpf: Update test names for xchg and cmpxchg (diff)
parentlibbpf: Deprecate bpf_prog_load_xattr() API (diff)
downloadlinux-dev-080a70b21f476b39ad66524c0ce0729972c61a10.tar.xz
linux-dev-080a70b21f476b39ad66524c0ce0729972c61a10.zip
Merge branch 'Deprecate bpf_prog_load_xattr() API'
Andrii Nakryiko says: ==================== Few lines in the last patch to mark bpf_prog_load_xattr() deprecated required a decent amount of clean ups in all the other patches. samples/bpf is big part of the clean up. This patch set also bumps libbpf version to 0.7, as libbpf v0.6 release will be cut shortly. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf/libbpf.c')
-rw-r--r--tools/lib/bpf/libbpf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 1341ce539662..de260c94e418 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -8475,6 +8475,20 @@ int bpf_program__set_flags(struct bpf_program *prog, __u32 flags)
return 0;
}
+__u32 bpf_program__log_level(const struct bpf_program *prog)
+{
+ return prog->log_level;
+}
+
+int bpf_program__set_log_level(struct bpf_program *prog, __u32 log_level)
+{
+ if (prog->obj->loaded)
+ return libbpf_err(-EBUSY);
+
+ prog->log_level = log_level;
+ return 0;
+}
+
#define SEC_DEF(sec_pfx, ptype, atype, flags, ...) { \
.sec = sec_pfx, \
.prog_type = BPF_PROG_TYPE_##ptype, \