1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2020 Facebook
5 #include <asm/unistd.h>
6 #include <bpf/bpf_helpers.h>
7 #include <bpf/bpf_tracing.h>
10 char _license[] SEC("license") = "GPL";
14 SEC("tp/syscalls/sys_enter_getpgid")
15 int bench_trigger_tp(void *ctx)
17 __sync_add_and_fetch(&hits, 1);
21 SEC("raw_tp/sys_enter")
22 int BPF_PROG(bench_trigger_raw_tp, struct pt_regs *regs, long id)
24 if (id == __NR_getpgid)
25 __sync_add_and_fetch(&hits, 1);
29 SEC("kprobe/" SYS_PREFIX "sys_getpgid")
30 int bench_trigger_kprobe(void *ctx)
32 __sync_add_and_fetch(&hits, 1);
36 SEC("fentry/" SYS_PREFIX "sys_getpgid")
37 int bench_trigger_fentry(void *ctx)
39 __sync_add_and_fetch(&hits, 1);
43 SEC("fentry.s/" SYS_PREFIX "sys_getpgid")
44 int bench_trigger_fentry_sleep(void *ctx)
46 __sync_add_and_fetch(&hits, 1);
50 SEC("fmod_ret/" SYS_PREFIX "sys_getpgid")
51 int bench_trigger_fmodret(void *ctx)
53 __sync_add_and_fetch(&hits, 1);
58 int bench_trigger_uprobe(void *ctx)
60 __sync_add_and_fetch(&hits, 1);