summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-06-13 16:15:43 +0000
committerjhb <jhb@FreeBSD.org>2015-06-13 16:15:43 +0000
commit7b9316ff5034c3ba83b38c790f78c3658e5135da (patch)
treeef6220118e54aaed7447bdcd6b2dcaabf3aa3777 /sys/kern/kern_exit.c
parentf014bfc33c51a646ad445d66106a905fa8293821 (diff)
downloadFreeBSD-src-7b9316ff5034c3ba83b38c790f78c3658e5135da.zip
FreeBSD-src-7b9316ff5034c3ba83b38c790f78c3658e5135da.tar.gz
MFC 283546:
Add KTR tracing for some MI ptrace events.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 02f0cfe..9c72442 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -531,6 +531,8 @@ exit1(struct thread *td, int rv)
*/
while ((q = LIST_FIRST(&p->p_orphans)) != NULL) {
PROC_LOCK(q);
+ CTR2(KTR_PTRACE, "exit: pid %d, clearing orphan %d", p->p_pid,
+ q->p_pid);
clear_orphan(q);
PROC_UNLOCK(q);
}
@@ -865,6 +867,9 @@ proc_reap(struct thread *td, struct proc *p, int *status, int options)
t = proc_realparent(p);
PROC_LOCK(t);
PROC_LOCK(p);
+ CTR2(KTR_PTRACE,
+ "wait: traced child %d moved back to parent %d", p->p_pid,
+ t->p_pid);
proc_reparent(p, t);
p->p_oppid = 0;
PROC_UNLOCK(p);
@@ -1219,6 +1224,10 @@ loop:
PROC_UNLOCK(q);
}
+ CTR4(KTR_PTRACE,
+ "wait: returning trapped pid %d status %#x (xstat %d) xthread %d",
+ p->p_pid, W_STOPCODE(p->p_xstat), p->p_xstat,
+ p->p_xthread != NULL ? p->p_xthread->td_tid : -1);
PROC_UNLOCK(p);
return (0);
}
OpenPOWER on IntegriCloud