aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-25 22:45:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:08 -0400
commitdaded34be96b1975ff8539ff62ad8b158ce7d842 (patch)
tree8cab5e809e513efd1a403e587a53a1e75365d1fc
parent09a05394fe2448a4139b014936330af23fa7ec83 (diff)
tracehook: vfork-done
This moves the PTRACE_EVENT_VFORK_DONE tracing into a tracehook.h inline, tracehook_report_vfork_done(). The change has no effect, just clean-up. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--include/linux/tracehook.h18
-rw-r--r--kernel/fork.c5
2 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 3ebc58b59766..830e6e16097d 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -210,4 +210,22 @@ static inline void tracehook_report_clone_complete(int trace,
210 ptrace_event(0, trace, pid); 210 ptrace_event(0, trace, pid);
211} 211}
212 212
213/**
214 * tracehook_report_vfork_done - vfork parent's child has exited or exec'd
215 * @child: child task, already running
216 * @pid: new child's PID in the parent's namespace
217 *
218 * Called after a %CLONE_VFORK parent has waited for the child to complete.
219 * The clone/vfork system call will return immediately after this.
220 * The @child pointer may be invalid if a self-reaping child died and
221 * tracehook_report_clone() took no action to prevent it from self-reaping.
222 *
223 * Called with no locks held.
224 */
225static inline void tracehook_report_vfork_done(struct task_struct *child,
226 pid_t pid)
227{
228 ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid);
229}
230
213#endif /* <linux/tracehook.h> */ 231#endif /* <linux/tracehook.h> */
diff --git a/kernel/fork.c b/kernel/fork.c
index b42f8ed23611..abb3ed6298f6 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1414,10 +1414,7 @@ long do_fork(unsigned long clone_flags,
1414 freezer_do_not_count(); 1414 freezer_do_not_count();
1415 wait_for_completion(&vfork); 1415 wait_for_completion(&vfork);
1416 freezer_count(); 1416 freezer_count();
1417 if (unlikely (current->ptrace & PT_TRACE_VFORK_DONE)) { 1417 tracehook_report_vfork_done(p, nr);
1418 current->ptrace_message = nr;
1419 ptrace_notify ((PTRACE_EVENT_VFORK_DONE << 8) | SIGTRAP);
1420 }
1421 } 1418 }
1422 } else { 1419 } else {
1423 nr = PTR_ERR(p); 1420 nr = PTR_ERR(p);