Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

samples: bpf: Fix syscall_tp openat argument

This modification doesn't change behaviour of the syscall_tp
But such code is often used as a reference so it should be
correct anyway

Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231019113521.4103825-1-dzagorui@cisco.com

authored by

Denys Zagorui and committed by
Andrii Nakryiko
69a19170 cf559a41

+13 -2
+13 -2
samples/bpf/syscall_tp_kern.c
··· 4 4 #include <uapi/linux/bpf.h> 5 5 #include <bpf/bpf_helpers.h> 6 6 7 + #if !defined(__aarch64__) 7 8 struct syscalls_enter_open_args { 8 9 unsigned long long unused; 9 10 long syscall_nr; ··· 12 11 long flags; 13 12 long mode; 14 13 }; 14 + #endif 15 15 16 16 struct syscalls_exit_open_args { 17 17 unsigned long long unused; 18 18 long syscall_nr; 19 19 long ret; 20 + }; 21 + 22 + struct syscalls_enter_open_at_args { 23 + unsigned long long unused; 24 + long syscall_nr; 25 + long long dfd; 26 + long filename_ptr; 27 + long flags; 28 + long mode; 20 29 }; 21 30 22 31 struct { ··· 65 54 #endif 66 55 67 56 SEC("tracepoint/syscalls/sys_enter_openat") 68 - int trace_enter_open_at(struct syscalls_enter_open_args *ctx) 57 + int trace_enter_open_at(struct syscalls_enter_open_at_args *ctx) 69 58 { 70 59 count(&enter_open_map); 71 60 return 0; 72 61 } 73 62 74 63 SEC("tracepoint/syscalls/sys_enter_openat2") 75 - int trace_enter_open_at2(struct syscalls_enter_open_args *ctx) 64 + int trace_enter_open_at2(struct syscalls_enter_open_at_args *ctx) 76 65 { 77 66 count(&enter_open_map); 78 67 return 0;