aboutsummaryrefslogtreecommitdiffstats
path: root/arch/parisc/kernel/ptrace.c
diff options
context:
space:
mode:
authorKyle McMartin <kyle@mcmartin.ca>2009-04-26 23:53:34 -0400
committerKyle McMartin <kyle@ihatethathostname.lab.bos.redhat.com>2009-09-27 23:07:21 -0400
commitd6b58772dc39262629708e5f3c30ef06de290894 (patch)
treebed61d5aea5f655ca86a064f441df2f505e769e9 /arch/parisc/kernel/ptrace.c
parent17d857be649a21ca90008c6dc425d849fa83db5c (diff)
parisc: tracehook_report_syscall
This makes parisc use the standard tracehook_report_syscall_entry and tracehook_report_syscall_exit hooks in <linux/tracehook.h>. To do this, we need to access current->thread.regs, and to know whether we're entering or exiting the syscall, so add this to syscall_trace. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Diffstat (limited to 'arch/parisc/kernel/ptrace.c')
-rw-r--r--arch/parisc/kernel/ptrace.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/parisc/kernel/ptrace.c b/arch/parisc/kernel/ptrace.c
index 927db3668b6f..2118ed02e886 100644
--- a/arch/parisc/kernel/ptrace.c
+++ b/arch/parisc/kernel/ptrace.c
@@ -13,6 +13,7 @@
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/ptrace.h> 15#include <linux/ptrace.h>
16#include <linux/tracehook.h>
16#include <linux/user.h> 17#include <linux/user.h>
17#include <linux/personality.h> 18#include <linux/personality.h>
18#include <linux/security.h> 19#include <linux/security.h>
@@ -264,21 +265,19 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
264#endif 265#endif
265 266
266 267
267void syscall_trace(void) 268void syscall_trace(int why)
268{ 269{
270 struct pt_regs *regs = &current->thread.regs;
271
269 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 272 if (!test_thread_flag(TIF_SYSCALL_TRACE))
270 return; 273 return;
271 if (!(current->ptrace & PT_PTRACED))
272 return;
273 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
274 ? 0x80 : 0));
275 /* 274 /*
276 * this isn't the same as continuing with a signal, but it will do 275 * Report the system call for tracing. Entry tracing can
277 * for normal use. strace only continues with a signal if the 276 * decide to abort the call. We handle that by setting an
278 * stopping signal is not SIGTRAP. -brl 277 * invalid syscall number (-1) to force an ENOSYS error.
279 */ 278 */
280 if (current->exit_code) { 279 if (why)
281 send_sig(current->exit_code, current, 1); 280 tracehook_report_syscall_exit(regs, 0);
282 current->exit_code = 0; 281 else if (tracehook_report_syscall_entry(regs))
283 } 282 regs->gr[20] = -1; /* force ENOSYS */
284} 283}