svn commit: r262052 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace
Andriy Gapon
avg at FreeBSD.org
Mon Feb 17 13:29:49 UTC 2014
Author: avg
Date: Mon Feb 17 13:29:48 2014
New Revision: 262052
URL: http://svnweb.freebsd.org/changeset/base/262052
Log:
MFC r252850: Hide references to mod_lock
Modified:
stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c
stable/9/sys/cddl/dev/dtrace/dtrace_load.c
stable/9/sys/cddl/dev/dtrace/dtrace_unload.c
Directory Properties:
stable/9/sys/ (props changed)
stable/9/sys/cddl/contrib/opensolaris/ (props changed)
Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c
==============================================================================
--- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:23:49 2014 (r262051)
+++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052)
@@ -281,8 +281,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
@@ -7681,7 +7679,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);
}
@@ -7695,7 +7695,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);
@@ -7729,7 +7731,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);
}
@@ -7811,7 +7815,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);
}
@@ -8131,6 +8137,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
@@ -8139,7 +8146,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)
@@ -8148,9 +8154,9 @@ dtrace_probe_provide(dtrace_probedesc_t
prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl);
} while ((ctl = ctl->mod_next) != &modules);
-#endif
mutex_exit(&mod_lock);
+#endif
} while (all && (prv = prv->dtpv_next) != NULL);
}
@@ -15143,7 +15149,9 @@ dtrace_module_loaded(modctl_t *ctl)
dtrace_provider_t *prv;
mutex_enter(&dtrace_provider_lock);
+#if defined(sun)
mutex_enter(&mod_lock);
+#endif
#if defined(sun)
ASSERT(ctl->mod_busy);
@@ -15156,7 +15164,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);
/*
@@ -15218,7 +15228,9 @@ dtrace_module_unloaded(modctl_t *ctl, in
#endif
mutex_enter(&dtrace_provider_lock);
+#if defined(sun)
mutex_enter(&mod_lock);
+#endif
mutex_enter(&dtrace_lock);
#if !defined(sun)
@@ -15239,7 +15251,9 @@ dtrace_module_unloaded(modctl_t *ctl, in
* 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;
}
@@ -15248,7 +15262,9 @@ dtrace_module_unloaded(modctl_t *ctl, in
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);
/*
@@ -15320,7 +15336,9 @@ dtrace_module_unloaded(modctl_t *ctl, in
}
mutex_exit(&dtrace_lock);
+#if defined(sun)
mutex_exit(&mod_lock);
+#endif
mutex_exit(&dtrace_provider_lock);
}
Modified: stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c
==============================================================================
--- stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:23:49 2014 (r262051)
+++ stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:29:48 2014 (r262052)
@@ -584,19 +584,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);
}
@@ -620,7 +626,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: stable/9/sys/cddl/dev/dtrace/dtrace_load.c
==============================================================================
--- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:23:49 2014 (r262051)
+++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052)
@@ -63,12 +63,6 @@ dtrace_load(void *dummy)
dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY);
/*
- * 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: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c
==============================================================================
--- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:23:49 2014 (r262051)
+++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052)
@@ -127,9 +127,6 @@ dtrace_unload()
mutex_destroy(&dtrace_errlock);
#endif
- /* XXX Hack */
- mutex_destroy(&mod_lock);
-
/* Reset our hook for exceptions. */
dtrace_invop_uninit();
More information about the svn-src-stable-9
mailing list