summaryrefslogtreecommitdiff
path: root/samples/bpf
diff options
context:
space:
mode:
authorRong Tao <rongtao@cestc.cn>2023-02-08 04:04:41 +0300
committerAndrii Nakryiko <andrii@kernel.org>2023-02-09 03:50:42 +0300
commit06744f24696e1e7598412c3df61a538b57ebec22 (patch)
tree95c89e3cdd0a616abcdab444f8ebe2c8231945e3 /samples/bpf
parentab8684b8cecf711cc9e47c1cbb1a8f4b549f8893 (diff)
downloadlinux-06744f24696e1e7598412c3df61a538b57ebec22.tar.xz
samples/bpf: Add openat2() enter/exit tracepoint to syscall_tp sample
Commit fe3300897cbf("samples: bpf: fix syscall_tp due to unused syscall") added openat() syscall tracepoints. This patch adds support for openat2() as well. Signed-off-by: Rong Tao <rongtao@cestc.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/tencent_9381CB1A158ED7ADD12C4406034E21A3AC07@qq.com
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/syscall_tp_kern.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/samples/bpf/syscall_tp_kern.c b/samples/bpf/syscall_tp_kern.c
index 50231c2eff9c..e7121dd1ee37 100644
--- a/samples/bpf/syscall_tp_kern.c
+++ b/samples/bpf/syscall_tp_kern.c
@@ -58,6 +58,13 @@ int trace_enter_open_at(struct syscalls_enter_open_args *ctx)
return 0;
}
+SEC("tracepoint/syscalls/sys_enter_openat2")
+int trace_enter_open_at2(struct syscalls_enter_open_args *ctx)
+{
+ count(&enter_open_map);
+ return 0;
+}
+
SEC("tracepoint/syscalls/sys_exit_open")
int trace_enter_exit(struct syscalls_exit_open_args *ctx)
{
@@ -71,3 +78,10 @@ int trace_enter_exit_at(struct syscalls_exit_open_args *ctx)
count(&exit_open_map);
return 0;
}
+
+SEC("tracepoint/syscalls/sys_exit_openat2")
+int trace_enter_exit_at2(struct syscalls_exit_open_args *ctx)
+{
+ count(&exit_open_map);
+ return 0;
+}