Skip to content

Commit

Permalink
bcc: Allow KFUNC_PROBE to instrument function without arguments
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chenhengqi committed Oct 17, 2021
1 parent d1afbf6 commit 4f64e93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cc/export/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4f64e93

Please sign in to comment.