public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* arch/ && tracehook_report_syscall_xxx()
@ 2009-04-27 18:04 Oleg Nesterov
  2009-04-27 18:29 ` Roland McGrath
  2009-04-27 19:24 ` David Howells
  0 siblings, 2 replies; 10+ messages in thread
From: Oleg Nesterov @ 2009-04-27 18:04 UTC (permalink / raw)
  To: Roland McGrath; +Cc: dhowells, yasutake.koichi, linux-kernel

We have a lot of code like arch/alpha/kernel/ptrace.c:syscall_trace()
in arch/ and I can't see how to convert them to use tracehooks.

The first problem, we don't know which hook should be called, there is
no entry/exit argument.

Still, I think it is better to change this code right now, and call
ptrace_report_syscall() directly.

But, the second problem, there is no "struct pt_regs *". What do you
think about the patch below?

However. I can't imagine how ptrace_report_syscall(regs) can actually
use "regs". Perhaps we can remove this argument?

Or what else do you think?

Hmm... and I can't understand how to change
arch/mn10300/kernel/ptrace.c:do_syscall_trace(), it does something
strange with TIF_SINGLESTEP. (maintainers cc'ed).

Oleg.

--- PTRACE/arch/alpha/kernel/ptrace.c~1_alpha	2009-04-06 00:03:35.000000000 +0200
+++ PTRACE/arch/alpha/kernel/ptrace.c	2009-04-27 19:11:50.000000000 +0200
@@ -11,6 +11,7 @@
 #include <linux/smp_lock.h>
 #include <linux/errno.h>
 #include <linux/ptrace.h>
+#include <linux/tracehook.h>
 #include <linux/user.h>
 #include <linux/slab.h>
 #include <linux/security.h>
@@ -354,20 +355,6 @@ syscall_trace(void)
 {
 	if (!test_thread_flag(TIF_SYSCALL_TRACE))
 		return;
-	if (!(current->ptrace & PT_PTRACED))
-		return;
-	/* 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));
 
-	/*
-	 * 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;
-	}
+	ptrace_report_syscall(NULL);
 }


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-04-29 19:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 18:04 arch/ && tracehook_report_syscall_xxx() Oleg Nesterov
2009-04-27 18:29 ` Roland McGrath
2009-04-27 18:32   ` Christoph Hellwig
2009-04-29 19:08     ` Fwd: " Oleg Nesterov
2009-04-29 19:17       ` Roland McGrath
2009-04-29 19:30       ` Ingo Molnar
2009-04-29 19:44       ` Christoph Hellwig
2009-04-29 19:53       ` Kyle McMartin
2009-04-27 18:43   ` Oleg Nesterov
2009-04-27 19:24 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox