mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
samples/bpf: syscall_tp: Aarch64 no open syscall
__NR_open never exist on AArch64. Signed-off-by: Rong Tao <rongtao@cestc.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/tencent_C6AD4AD72BEFE813228FC188905F96C6A506@qq.com
This commit is contained in:
parent
a3e7e6b179
commit
07018b5706
1 changed files with 4 additions and 0 deletions
|
@ -44,12 +44,14 @@ static __always_inline void count(void *map)
|
||||||
bpf_map_update_elem(map, &key, &init_val, BPF_NOEXIST);
|
bpf_map_update_elem(map, &key, &init_val, BPF_NOEXIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__aarch64__)
|
||||||
SEC("tracepoint/syscalls/sys_enter_open")
|
SEC("tracepoint/syscalls/sys_enter_open")
|
||||||
int trace_enter_open(struct syscalls_enter_open_args *ctx)
|
int trace_enter_open(struct syscalls_enter_open_args *ctx)
|
||||||
{
|
{
|
||||||
count(&enter_open_map);
|
count(&enter_open_map);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
SEC("tracepoint/syscalls/sys_enter_openat")
|
SEC("tracepoint/syscalls/sys_enter_openat")
|
||||||
int trace_enter_open_at(struct syscalls_enter_open_args *ctx)
|
int trace_enter_open_at(struct syscalls_enter_open_args *ctx)
|
||||||
|
@ -65,12 +67,14 @@ int trace_enter_open_at2(struct syscalls_enter_open_args *ctx)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__aarch64__)
|
||||||
SEC("tracepoint/syscalls/sys_exit_open")
|
SEC("tracepoint/syscalls/sys_exit_open")
|
||||||
int trace_enter_exit(struct syscalls_exit_open_args *ctx)
|
int trace_enter_exit(struct syscalls_exit_open_args *ctx)
|
||||||
{
|
{
|
||||||
count(&exit_open_map);
|
count(&exit_open_map);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
SEC("tracepoint/syscalls/sys_exit_openat")
|
SEC("tracepoint/syscalls/sys_exit_openat")
|
||||||
int trace_enter_exit_at(struct syscalls_exit_open_args *ctx)
|
int trace_enter_exit_at(struct syscalls_exit_open_args *ctx)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue