perf tools: Use fallback for sample_addr_correlates_sym() cases
[linux/fpc-iii.git] / tools / perf / examples / bpf / sys_enter_openat.c
blob9cd124b09392c45a60e547988014b1d65b2feaf6
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Hook into 'openat' syscall entry tracepoint
5 * Test it with:
7 * perf trace -e tools/perf/examples/bpf/sys_enter_openat.c cat /etc/passwd > /dev/null
9 * It'll catch some openat syscalls related to the dynamic linked and
10 * the last one should be the one for '/etc/passwd'.
12 * The syscall_enter_openat_args can be used to get the syscall fields
13 * and use them for filtering calls, i.e. use in expressions for
14 * the return value.
17 #include <bpf.h>
19 struct syscall_enter_openat_args {
20 unsigned long long unused;
21 long syscall_nr;
22 long dfd;
23 char *filename_ptr;
24 long flags;
25 long mode;
28 int syscall_enter(openat)(struct syscall_enter_openat_args *args)
30 return 1;
33 license(GPL);