diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2012-12-22 09:21:10 +0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2013-03-21 23:39:34 +0400 |
commit | ef18272453c97238fc9a89211d4c609ef9c760dc (patch) | |
tree | f136861b2a31cc85027260775c9d00551c91d305 /arch/tile/kernel/ptrace.c | |
parent | a937536b868b8369b98967929045f1df54234323 (diff) | |
download | linux-ef18272453c97238fc9a89211d4c609ef9c760dc.tar.xz |
arch/tile: Call tracehook_report_syscall_{entry,exit} in syscall trace
Call tracehook functions for syscall tracing.
The check for TIF_SYSCALL_TRACE was removed, because the same check is
done right before in the assembly file.
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com> [with ptrace.h fixup]
Diffstat (limited to 'arch/tile/kernel/ptrace.c')
-rw-r--r-- | arch/tile/kernel/ptrace.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/arch/tile/kernel/ptrace.c b/arch/tile/kernel/ptrace.c index 9835312d5a91..0ab8b76baddc 100644 --- a/arch/tile/kernel/ptrace.c +++ b/arch/tile/kernel/ptrace.c @@ -21,6 +21,7 @@ #include <linux/uaccess.h> #include <linux/regset.h> #include <linux/elf.h> +#include <linux/tracehook.h> #include <asm/traps.h> #include <arch/chip.h> @@ -246,29 +247,18 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, } #endif -void do_syscall_trace(void) +int do_syscall_trace_enter(struct pt_regs *regs) { - if (!test_thread_flag(TIF_SYSCALL_TRACE)) - return; - - if (!(current->ptrace & PT_PTRACED)) - return; + if (tracehook_report_syscall_entry(regs)) { + regs->regs[TREG_SYSCALL_NR] = -1; + } - /* - * The 0x80 provides a way for the tracing parent to distinguish - * between a syscall stop and SIGTRAP delivery - */ - ptrace_notify(SIGTRAP|((current->ptrace & PT_TRACESYSGOOD) ? 0x80 : 0)); + return regs->regs[TREG_SYSCALL_NR]; +} - /* - * this isn't the same as continuing with a signal, but it will do - * for normal use. strace only continues with a signal if the - * stopping signal is not SIGTRAP. -brl - */ - if (current->exit_code) { - send_sig(current->exit_code, current, 1); - current->exit_code = 0; - } +void do_syscall_trace_exit(struct pt_regs *regs) +{ + tracehook_report_syscall_exit(regs, 0); } void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code) |