mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
perf trace augmented_syscalls: Hook into syscalls:sys_exit_SYSCALL too
Hook the pair enter/exit when using augmented_{filename,sockaddr,etc}_syscall(), this way we'll be able to see what entries are in the ELF sections generated from augmented_syscalls.c and filter them out from the main raw_syscalls:* tracepoints used by 'perf trace'. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-cyav42qj5yylolw4attcw99z@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
4c8f0a726e
commit
f5b076dc01
1 changed files with 14 additions and 0 deletions
|
@ -26,6 +26,12 @@ struct bpf_map SEC("maps") __augmented_syscalls__ = {
|
||||||
.max_entries = __NR_CPUS__,
|
.max_entries = __NR_CPUS__,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct syscall_exit_args {
|
||||||
|
unsigned long long common_tp_fields;
|
||||||
|
long syscall_nr;
|
||||||
|
long ret;
|
||||||
|
};
|
||||||
|
|
||||||
struct augmented_filename {
|
struct augmented_filename {
|
||||||
int size;
|
int size;
|
||||||
int reserved;
|
int reserved;
|
||||||
|
@ -49,6 +55,10 @@ int syscall_enter(syscall)(struct syscall_enter_##syscall##_args *args) \
|
||||||
(sizeof(augmented_args) - sizeof(augmented_args.filename.value) + \
|
(sizeof(augmented_args) - sizeof(augmented_args.filename.value) + \
|
||||||
augmented_args.filename.size)); \
|
augmented_args.filename.size)); \
|
||||||
return 0; \
|
return 0; \
|
||||||
|
} \
|
||||||
|
int syscall_exit(syscall)(struct syscall_exit_args *args) \
|
||||||
|
{ \
|
||||||
|
return 1; /* 0 as soon as we start copying data returned by the kernel, e.g. 'read' */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct syscall_enter_openat_args {
|
struct syscall_enter_openat_args {
|
||||||
|
@ -116,6 +126,10 @@ int syscall_enter(syscall)(struct syscall_enter_##syscall##_args *args) \
|
||||||
&augmented_args, \
|
&augmented_args, \
|
||||||
sizeof(augmented_args) - sizeof(augmented_args.addr) + addrlen); \
|
sizeof(augmented_args) - sizeof(augmented_args.addr) + addrlen); \
|
||||||
return 0; \
|
return 0; \
|
||||||
|
} \
|
||||||
|
int syscall_exit(syscall)(struct syscall_exit_args *args) \
|
||||||
|
{ \
|
||||||
|
return 1; /* 0 as soon as we start copying data returned by the kernel, e.g. 'read' */ \
|
||||||
}
|
}
|
||||||
|
|
||||||
struct sockaddr;
|
struct sockaddr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue