Skip to contentSkip to conversation

implement utrace-ptrace

RFC PATCH In review Oleg Nesterov 1 participant 1 message Nov 24, 2009 ptrace support

lore
Share & tools
lore

Oleg Nesterov

author maintainer
#0 lore raw

RFC PATCH 13/14 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 | 1115 +++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 1119 insertions(+), 1 deletion(-)
include/linux/ptrace.h renamed from include/linux/ptrace.h~13_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~13_UTRACE_PTRACE +1 -0
@@ -68,6 +68,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~13_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 +1115 -0

1,115 lines not on this page · raw message