From owner-svn-src-head@freebsd.org Wed Feb 15 06:07:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69191CE04EE; Wed, 15 Feb 2017 06:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EC301497; Wed, 15 Feb 2017 06:07:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1F671Z9069915; Wed, 15 Feb 2017 06:07:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1F671EC069914; Wed, 15 Feb 2017 06:07:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201702150607.v1F671EC069914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 15 Feb 2017 06:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313758 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2017 06:07:02 -0000 Author: markj Date: Wed Feb 15 06:07:01 2017 New Revision: 313758 URL: https://svnweb.freebsd.org/changeset/base/313758 Log: Use pget() instead of pfind() in fasttrap_pid_{enable,disable}(). Suggested by: mjg MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 02:52:43 2017 (r313757) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Wed Feb 15 06:07:01 2017 (r313758) @@ -1246,15 +1246,8 @@ fasttrap_pid_enable(void *arg, dtrace_id ASSERT(!(p->p_flag & SVFORK)); mutex_exit(&p->p_lock); #else - if ((p = pfind(probe->ftp_pid)) == NULL) + if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0) return; - if ((p->p_flag & P_WEXIT) != 0) { - PROC_UNLOCK(p); - return; - } - - _PHOLD(p); - PROC_UNLOCK(p); #endif /* @@ -1333,17 +1326,8 @@ fasttrap_pid_disable(void *arg, dtrace_i * provider lock as a point of mutual exclusion to prevent other * DTrace consumers from disabling this probe. */ - if ((p = pfind(probe->ftp_pid)) != NULL) { -#ifdef __FreeBSD__ - if (p->p_flag & P_WEXIT) { - PROC_UNLOCK(p); - p = NULL; - } else { - _PHOLD(p); - PROC_UNLOCK(p); - } -#endif - } + if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0) + p = NULL; /* * Disable all the associated tracepoints (for fully enabled probes).