Skip to contentSkip to conversation

implement utrace-ptrace

PATCH In review Oleg Nesterov 2 participants 3 messages Dec 18, 2009 – Dec 21, 2009 ptrace support

lore
Share & tools
lore

Oleg Nesterov

author maintainer
#0 lore raw

PATCH 6/7 implement utrace-ptrace

The patch adds the new file, kernel/ptrace-utrace.c, which contains the new implementation of ptrace over utrace.

This file is not compiled until we have CONFIG_UTRACE option, will be added by the next "utrace core" patch.

It's supposed to be an invisible implementation change, nothing should change to userland when CONFIG_UTRACE is enabled.

---

 include/linux/ptrace.h |    2 
 kernel/Makefile        |    1 
 kernel/ptrace.c        |    2 
 kernel/ptrace-utrace.c | 1080 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1084 insertions(+), 1 deletion(-)
include/linux/ptrace.h renamed from include/linux/ptrace.h~6_UTRACE_PTRACE +1 -1
@@ -79,7 +79,7 @@
 #include <linux/compiler.h>		/* For unlikely.  */
 #include <linux/sched.h>		/* For struct task_struct.  */
 
-
+extern void ptrace_notify_stop(struct task_struct *tracee);
 extern long arch_ptrace(struct task_struct *child, long request, long addr, long data);
 extern int ptrace_traceme(void);
 extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
kernel/Makefile renamed from kernel/Makefile~6_UTRACE_PTRACE +1 -0
@@ -69,6 +69,7 @@ obj-$(CONFIG_IKCONFIG) += configs.o
 obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
 obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
 obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
+obj-$(CONFIG_UTRACE) += ptrace-utrace.o
 obj-$(CONFIG_AUDIT) += audit.o auditfilter.o audit_watch.o
 obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
 obj-$(CONFIG_GCOV_KERNEL) += gcov/
kernel/ptrace.c renamed from kernel/ptrace.c~6_UTRACE_PTRACE +2 -0
@@ -302,6 +302,7 @@ asmlinkage long compat_sys_ptrace(compat
 }
 #endif	/* CONFIG_COMPAT */
 
+#ifndef CONFIG_UTRACE
 /*
  * ptrace a task: make the debugger its new parent and
  * move it to the ptrace list.
@@ -762,3 +763,4 @@ int compat_ptrace_request(struct task_st
 	return ret;
 }
 #endif	/* CONFIG_COMPAT */
+#endif	/* CONFIG_UTRACE */
kernel/ptrace-utrace.c new file +1080 -0

1,080 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Oleg Nesterov

The patch adds the new file, kernel/ptrace-utrace.c, which contains the new implementation of ptrace over utrace.

This file is not compiled until we have CONFIG_UTRACE option, will be added by the next "utrace core" patch.

Quoted 6 lines

It's supposed to be an invisible implementation change, nothing should change to userland when CONFIG_UTRACE is enabled.

---

Oleg,

ptrace/utrace performs better with the ptrace-tests [1] testsuite (1 failure vs. 3 with vanilla ptrace [1]). The gdb testsuite also has no regressions. In fact, the results on the gdb testsuite are identical.

Ananth

[1] http://sourceware.org/systemtap/wiki/utrace/tests
[2] detach-stopped and stopped-attach-transparency are the additional failures. syscall-reset fails in both cases.

#2 lore raw
Quoted 14 lines · Ananth N Mavinakayanahalli
Quoted 6 lines · Oleg Nesterov

The patch adds the new file, kernel/ptrace-utrace.c, which contains the new implementation of ptrace over utrace.

This file is not compiled until we have CONFIG_UTRACE option, will be added by the next "utrace core" patch.

Quoted 6 lines

It's supposed to be an invisible implementation change, nothing should change to userland when CONFIG_UTRACE is enabled.

---

Quoted 5 lines

Oleg,

ptrace/utrace performs better with the ptrace-tests [1] testsuite (1 failure vs. 3 with vanilla ptrace [1]). The gdb testsuite also has no regressions. In fact, the results on the gdb testsuite are identical.

Forgot to mention the tests were on powerpc.