From 0b9a7f0de847d945bc5dd83961136e04d6c890ec Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Wed, 1 Jul 2020 17:52:51 +0200 Subject: [PATCH] Reinstate bpf_detach_kfunc It doesn't do anything, but bpftrace still calls it. --- src/cc/libbpf.c | 7 +++++++ src/cc/libbpf.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/cc/libbpf.c b/src/cc/libbpf.c index 010d1222..4c43218f 100644 --- a/src/cc/libbpf.c +++ b/src/cc/libbpf.c @@ -1186,6 +1186,13 @@ bool bpf_has_kernel_btf(void) return libbpf_find_vmlinux_btf_id("bpf_prog_put", 0) > 0; } +int bpf_detach_kfunc(int prog_fd, char *func) +{ + UNUSED(prog_fd); + UNUSED(func); + return 0; +} + int bpf_attach_kfunc(int prog_fd) { int ret; diff --git a/src/cc/libbpf.h b/src/cc/libbpf.h index 61471b5b..bcae5c99 100644 --- a/src/cc/libbpf.h +++ b/src/cc/libbpf.h @@ -94,6 +94,8 @@ int bpf_detach_tracepoint(const char *tp_category, const char *tp_name); int bpf_attach_raw_tracepoint(int progfd, const char *tp_name); + int bpf_detach_kfunc(int prog_fd, char *func); + int bpf_attach_kfunc(int prog_fd); int bpf_attach_lsm(int prog_fd); -- 2.25.4