From owner-svn-src-head@FreeBSD.ORG Fri Jul 5 22:42:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F134C3; Fri, 5 Jul 2013 22:42:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F46318EC; Fri, 5 Jul 2013 22:42:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65MgBUW010427; Fri, 5 Jul 2013 22:42:11 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65MgA6K010423; Fri, 5 Jul 2013 22:42:10 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307052242.r65MgA6K010423@svn.freebsd.org> From: Mark Johnston Date: Fri, 5 Jul 2013 22:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252850 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/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.14 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: Fri, 05 Jul 2013 22:42:11 -0000 Author: markj Date: Fri Jul 5 22:42:10 2013 New Revision: 252850 URL: http://svnweb.freebsd.org/changeset/base/252850 Log: Hide references to mod_lock. In FreeBSD it is always acquired with the provider lock held, so its use has no effect. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c head/sys/cddl/dev/dtrace/dtrace_load.c head/sys/cddl/dev/dtrace/dtrace_unload.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri Jul 5 22:42:10 2013 (r252850) @@ -278,8 +278,6 @@ static kmutex_t dtrace_meta_lock; /* me #if !defined(sun) /* XXX FreeBSD hacks. */ -static kmutex_t mod_lock; - #define cr_suid cr_svuid #define cr_sgid cr_svgid #define ipaddr_t in_addr_t @@ -7678,7 +7676,9 @@ dtrace_unregister(dtrace_provider_id_t i } } else { mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); } @@ -7692,7 +7692,9 @@ dtrace_unregister(dtrace_provider_id_t i dtrace_anon.dta_state->dts_necbs > 0))) { if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } return (EBUSY); @@ -7726,7 +7728,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -7808,7 +7812,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -8141,6 +8147,7 @@ dtrace_probe_provide(dtrace_probedesc_t */ prv->dtpv_pops.dtps_provide(prv->dtpv_arg, desc); +#if defined(sun) /* * Now call the per-module provide operation. We will grab * mod_lock to prevent the list from being modified. Note @@ -8149,7 +8156,6 @@ dtrace_probe_provide(dtrace_probedesc_t */ mutex_enter(&mod_lock); -#if defined(sun) ctl = &modules; do { if (ctl->mod_busy || ctl->mod_mp == NULL) @@ -8158,11 +8164,11 @@ dtrace_probe_provide(dtrace_probedesc_t prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); } while ((ctl = ctl->mod_next) != &modules); + + mutex_exit(&mod_lock); #else (void) linker_file_foreach(dtrace_probe_provide_cb, prv); #endif - - mutex_exit(&mod_lock); } while (all && (prv = prv->dtpv_next) != NULL); } @@ -15156,7 +15162,9 @@ dtrace_module_loaded(modctl_t *ctl) dtrace_provider_t *prv; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif ASSERT(ctl->mod_busy); @@ -15167,7 +15175,9 @@ dtrace_module_loaded(modctl_t *ctl) for (prv = dtrace_provider; prv != NULL; prv = prv->dtpv_next) prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); /* @@ -15212,7 +15222,9 @@ dtrace_module_unloaded(modctl_t *ctl) template.dtpr_mod = ctl->mod_modname; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (dtrace_bymod == NULL) { @@ -15221,7 +15233,9 @@ dtrace_module_unloaded(modctl_t *ctl) * we don't have any work to do. */ mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); return; } @@ -15230,7 +15244,9 @@ dtrace_module_unloaded(modctl_t *ctl) probe != NULL; probe = probe->dtpr_nextmod) { if (probe->dtpr_ecb != NULL) { mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); /* @@ -15293,7 +15309,9 @@ dtrace_module_unloaded(modctl_t *ctl) } mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Jul 5 22:42:10 2013 (r252850) @@ -580,19 +580,25 @@ dtrace_ioctl(struct cdev *dev, u_long cm return (EINVAL); mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (desc->dtargd_id > dtrace_nprobes) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } if ((probe = dtrace_probes[desc->dtargd_id - 1]) == NULL) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } @@ -616,7 +622,9 @@ dtrace_ioctl(struct cdev *dev, u_long cm probe->dtpr_id, probe->dtpr_arg, desc); } +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (0); Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Fri Jul 5 22:42:10 2013 (r252850) @@ -57,12 +57,6 @@ dtrace_load(void *dummy) dtrace_invop_init(); /* - * XXX This is a short term hack to avoid having to comment - * out lots and lots of lock/unlock calls. - */ - mutex_init(&mod_lock,"XXX mod_lock hack", MUTEX_DEFAULT, NULL); - - /* * Initialise the mutexes without 'witness' because the dtrace * code is mostly written to wait for memory. To have the * witness code change a malloc() from M_WAITOK to M_NOWAIT Modified: head/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_unload.c Fri Jul 5 22:25:40 2013 (r252849) +++ head/sys/cddl/dev/dtrace/dtrace_unload.c Fri Jul 5 22:42:10 2013 (r252850) @@ -123,9 +123,6 @@ dtrace_unload() mutex_destroy(&dtrace_lock); mutex_destroy(&dtrace_errlock); - /* XXX Hack */ - mutex_destroy(&mod_lock); - /* Reset our hook for exceptions. */ dtrace_invop_uninit();