Date: Sat, 8 Dec 2018 06:31:43 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341721 - head/sys/kern Message-ID: <201812080631.wB86Vhmg009241@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sat Dec 8 06:31:43 2018 New Revision: 341721 URL: https://svnweb.freebsd.org/changeset/base/341721 Log: proc: handle sdt exit probe before taking the proc lock Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Dec 8 06:30:41 2018 (r341720) +++ head/sys/kern/kern_exit.c Sat Dec 8 06:31:43 2018 (r341721) @@ -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; @@ -573,15 +584,6 @@ exit1(struct thread *td, int rval, int signo) * Notify interested parties of our demise. */ 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812080631.wB86Vhmg009241>