From 4f64e93d2d2058458abf248a0b78961e674fa37c Mon Sep 17 00:00:00 2001 From: Hengqi Chen Date: Sun, 17 Oct 2021 23:50:09 +0800 Subject: [PATCH] bcc: Allow KFUNC_PROBE to instrument function without arguments Update KFUNC_PROBE and its family to allow instrument kernel function without specifying arguments. Sometimes, we don't need to bookkeep arguments at function entry, just store a timestamp. This fix would allow this use case. Signed-off-by: Hengqi Chen --- src/cc/export/helpers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/export/helpers.h b/src/cc/export/helpers.h index cd477d6982f0..5314bca019d1 100644 --- a/src/cc/export/helpers.h +++ b/src/cc/export/helpers.h @@ -1309,16 +1309,16 @@ int name(unsigned long long *ctx) \ static int ____##name(unsigned long long *ctx, ##args) #define KFUNC_PROBE(event, args...) \ - BPF_PROG(kfunc__ ## event, args) + BPF_PROG(kfunc__ ## event, ##args) #define KRETFUNC_PROBE(event, args...) \ - BPF_PROG(kretfunc__ ## event, args) + BPF_PROG(kretfunc__ ## event, ##args) #define KMOD_RET(event, args...) \ - BPF_PROG(kmod_ret__ ## event, args) + BPF_PROG(kmod_ret__ ## event, ##args) #define LSM_PROBE(event, args...) \ - BPF_PROG(lsm__ ## event, args) + BPF_PROG(lsm__ ## event, ##args) #define BPF_ITER(target) \ int bpf_iter__ ## target (struct bpf_iter__ ## target *ctx)