Date: Fri, 8 Dec 2017 18:04:43 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326701 - stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace Message-ID: <201712081804.vB8I4hKK047620@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Dec 8 18:04:43 2017 New Revision: 326701 URL: https://svnweb.freebsd.org/changeset/base/326701 Log: MFC r326134: Duplicate helpers after disabling inherited tracepoints during a fork. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Dec 8 17:52:53 2017 (r326700) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Fri Dec 8 18:04:43 2017 (r326701) @@ -600,8 +600,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) pid_t ppid = p->p_pid; int i; -#ifdef illumos ASSERT(curproc == p); +#ifdef illumos ASSERT(p->p_proc_flag & P_PR_LOCK); #else PROC_LOCK_ASSERT(p, MA_OWNED); @@ -609,26 +609,15 @@ fasttrap_fork(proc_t *p, proc_t *cp) #ifdef illumos ASSERT(p->p_dtrace_count > 0); #else - if (p->p_dtrace_helpers) { - /* - * dtrace_helpers_duplicate() allocates memory. - */ - _PHOLD(cp); - PROC_UNLOCK(p); - PROC_UNLOCK(cp); - dtrace_helpers_duplicate(p, cp); - PROC_LOCK(cp); - PROC_LOCK(p); - _PRELE(cp); - } /* * This check is purposely here instead of in kern_fork.c because, * for legal resons, we cannot include the dtrace_cddl.h header * inside kern_fork.c and insert if-clause there. */ - if (p->p_dtrace_count == 0) + if (p->p_dtrace_count == 0 && p->p_dtrace_helpers == NULL) return; #endif + ASSERT(cp->p_dtrace_count == 0); /* @@ -657,6 +646,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) _PHOLD(cp); PROC_UNLOCK(cp); PROC_UNLOCK(p); + if (p->p_dtrace_count == 0) + goto dup_helpers; #endif /* @@ -710,6 +701,9 @@ fasttrap_fork(proc_t *p, proc_t *cp) mutex_enter(&cp->p_lock); sprunlock(cp); #else +dup_helpers: + if (p->p_dtrace_helpers != NULL) + dtrace_helpers_duplicate(p, cp); PROC_LOCK(p); PROC_LOCK(cp); _PRELE(cp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712081804.vB8I4hKK047620>