From 30388a7afd8ad8b237ff44f58cad6db3ec03edc6 Mon Sep 17 00:00:00 2001 From: Yonghong Song Date: Mon, 4 Feb 2019 14:39:30 -0800 Subject: [PATCH] add BPF_EMIT_CALL macro for libbpf_probes.c libbpf_probes.c accessed BPF_EMIT_CALL. Added the definition in include/linux/filter.h. Signed-off-by: Yonghong Song --- include/linux/filter.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/filter.h b/include/linux/filter.h index ef128f0..d9a7504 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -21,4 +21,12 @@ .off = 0, \ .imm = 0 }) +#define BPF_EMIT_CALL(FUNC) \ + ((struct bpf_insn) { \ + .code = BPF_JMP | BPF_CALL, \ + .dst_reg = 0, \ + .src_reg = 0, \ + .off = 0, \ + .imm = ((FUNC) - BPF_FUNC_unspec) }) + #endif