aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2018-12-08 06:31:43 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2018-12-08 06:31:43 +0000
commiteadb1dcb71bf317c19abe4d4a427fbfbf24f116a (patch)
treeab65a5e8634d1afc4759217ac9f6c73561870d69 /sys/kern/kern_exit.c
parent13a45e4b14ca38406e44dd6c5f258699a5f07c69 (diff)
Notes
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 461ecc2270c76..29016ca380a22 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -556,6 +556,17 @@ exit1(struct thread *td, int rval, int signo)
PROC_UNLOCK(q);
}
+#ifdef KDTRACE_HOOKS
+ if (SDT_PROBES_ENABLED()) {
+ int reason = CLD_EXITED;
+ if (WCOREDUMP(signo))
+ reason = CLD_DUMPED;
+ else if (WIFSIGNALED(signo))
+ reason = CLD_KILLED;
+ SDT_PROBE1(proc, , , exit, reason);
+ }
+#endif
+
/* Save exit status. */
PROC_LOCK(p);
p->p_xthread = td;
@@ -574,15 +585,6 @@ exit1(struct thread *td, int rval, int signo)
*/
KNOTE_LOCKED(p->p_klist, NOTE_EXIT);
-#ifdef KDTRACE_HOOKS
- int reason = CLD_EXITED;
- if (WCOREDUMP(signo))
- reason = CLD_DUMPED;
- else if (WIFSIGNALED(signo))
- reason = CLD_KILLED;
- SDT_PROBE1(proc, , , exit, reason);
-#endif
-
/*
* If this is a process with a descriptor, we may not need to deliver
* a signal to the parent. proctree_lock is held over