[PATCH RESEND 00/22] utrace for 2.6.40/fc15 (Was: utrace for 3.0 kernel)

Tony Breeds tony at bakeyournoodle.com
Tue Aug 9 03:00:11 UTC 2011


On Mon, Aug 08, 2011 at 01:45:01PM -0400, Josh Boyer wrote:
 
> Yep.  I'm fixing it now.  It'll be included in the 3.0.1 build I submit
> to updates-testing later today.

FWIW this series breakes the build on powerpc (probably all !x86)  The problem
is that TIF_SYSCALL_EMU is referenced in tracehook.h but is only defined on x86.

I applied the following hack locally.

----
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index ac833de..11a18b6 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -69,6 +69,14 @@ static inline int tracehook_expect_breakpoints(struct task_struct *task)
 	return (task_ptrace(task) & PT_PTRACED) != 0;
 }
 
+static inline int is_syscall_emu(void)
+{
+#ifdef TIF_SYSCALL_EMU
+	return test_thread_flag(TIF_SYSCALL_EMU);
+#else
+	return 0;
+#endif
+}
 /*
  * ptrace report for syscall entry and exit looks identical.
  */
@@ -76,7 +84,7 @@ static inline void ptrace_report_syscall(struct pt_regs *regs)
 {
 	int ptrace = task_ptrace(current);
 
-	if (!(ptrace & PT_SYSCALL_TRACE) && !test_thread_flag(TIF_SYSCALL_EMU))
+	if (!(ptrace & PT_SYSCALL_TRACE) && !is_syscall_emu())
 		return;
 
 	ptrace_notify(SIGTRAP | ((ptrace & PT_TRACESYSGOOD) ? 0x80 : 0));
----

Yours Tony


More information about the kernel mailing list