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>
9 char _license
[] SEC("license") = "GPL";
13 SEC("tp/syscalls/sys_enter_getpgid")
14 int bench_trigger_tp(void *ctx
)
16 __sync_add_and_fetch(&hits
, 1);
20 SEC("raw_tp/sys_enter")
21 int BPF_PROG(bench_trigger_raw_tp
, struct pt_regs
*regs
, long id
)
23 if (id
== __NR_getpgid
)
24 __sync_add_and_fetch(&hits
, 1);
28 SEC("kprobe/__x64_sys_getpgid")
29 int bench_trigger_kprobe(void *ctx
)
31 __sync_add_and_fetch(&hits
, 1);
35 SEC("fentry/__x64_sys_getpgid")
36 int bench_trigger_fentry(void *ctx
)
38 __sync_add_and_fetch(&hits
, 1);
42 SEC("fentry.s/__x64_sys_getpgid")
43 int bench_trigger_fentry_sleep(void *ctx
)
45 __sync_add_and_fetch(&hits
, 1);
49 SEC("fmod_ret/__x64_sys_getpgid")
50 int bench_trigger_fmodret(void *ctx
)
52 __sync_add_and_fetch(&hits
, 1);