From f2dbcf671339136aacedd9fccbfc7ecf9b020df4 Mon Sep 17 00:00:00 2001 From: Martin Cermak Date: Thu, 22 Dec 2016 17:07:58 +0100 Subject: [PATCH] PR20333/exit --- tapset/linux/nd_syscalls.stp | 13 ------------ tapset/linux/sysc_exit.stp | 38 ++++++++++++++++++++++++++++++++++++ tapset/linux/syscalls.stp | 11 ----------- 3 files changed, 38 insertions(+), 24 deletions(-) create mode 100644 tapset/linux/sysc_exit.stp diff --git a/tapset/linux/nd_syscalls.stp b/tapset/linux/nd_syscalls.stp index 4e249a031..6671eb237 100644 --- a/tapset/linux/nd_syscalls.stp +++ b/tapset/linux/nd_syscalls.stp @@ -1,17 +1,4 @@ -# exit _______________________________________________________ -# long sys_exit(int error_code) -probe nd_syscall.exit = kprobe.function("sys_exit").call -{ - name = "exit" - asmlinkage() - status = int_arg(1) - argstr = sprint(status) -} -# sys_exit() never returns, and is blacklisted for return probes, -# so no alias here. See bz6588. -# NB: the explicit .call ensures that alias suffixes can't infer .return - # exit_group _________________________________________________ # void sys_exit_group(int error_code) # diff --git a/tapset/linux/sysc_exit.stp b/tapset/linux/sysc_exit.stp new file mode 100644 index 000000000..30bd9b354 --- /dev/null +++ b/tapset/linux/sysc_exit.stp @@ -0,0 +1,38 @@ +# exit _______________________________________________________ +# long sys_exit(int error_code) +# +# sys_exit() never returns, and is blacklisted for return probes, +# so no alias here. See bz6588. +# NB: the explicit .call ensures that alias suffixes can't infer .return + +@define _SYSCALL_EXIT_NAME +%( + name = "exit" +%) + +@define _SYSCALL_EXIT_ARGSTR +%( + argstr = sprint(status) +%) + +probe syscall.exit = dw_syscall.exit !, nd_syscall.exit {} +probe syscall.exit.return = dw_syscall.exit.return !, nd_syscall.exit.return {} + +# dw_exit _____________________________________________________ + +probe dw_syscall.exit = kernel.function("sys_exit").call +{ + @_SYSCALL_EXIT_NAME + status = __int32($error_code) + @_SYSCALL_EXIT_ARGSTR +} + +# nd_exit _____________________________________________________ + +probe nd_syscall.exit = kprobe.function("sys_exit").call +{ + @_SYSCALL_EXIT_NAME + asmlinkage() + status = int_arg(1) + @_SYSCALL_EXIT_ARGSTR +} diff --git a/tapset/linux/syscalls.stp b/tapset/linux/syscalls.stp index 912fb5be8..5b76ae570 100644 --- a/tapset/linux/syscalls.stp +++ b/tapset/linux/syscalls.stp @@ -1,15 +1,4 @@ -# exit _______________________________________________________ -# long sys_exit(int error_code) -probe syscall.exit = kernel.function("sys_exit").call -{ - name = "exit" - status = __int32($error_code) - argstr = sprint(__int32($error_code)) -} -# sys_exit() never returns, and is blacklisted for return probes, -# so no alias here. See bz6588. - # exit_group _________________________________________________ # void sys_exit_group(int error_code) # -- 2.43.5