PERFORCE change 96025 for review

John Birrell jb at FreeBSD.org
Mon Apr 24 23:28:35 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=96025

Change 96025 by jb at jb_freebsd2 on 2006/04/24 23:28:05

	Use the new linker_file_list function to iterate over the loaded
	modules.
	
	Change the references to 'struct modctl' to modctl_t which is declared
	in Solaris and is consistent with the rest of their code. They usually
	use the 'foo_t' type defines in preference to 'struct foo'. It's
	easier for us to compatible-ise to foo_t.

Affected files ...

.. //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_probemgmt.c#3 edit

Differences ...

==== //depot/projects/dtrace/src/sys/cddl/dev/dtrace/dtrace_probemgmt.c#3 (text+ko) ====

@@ -175,6 +175,18 @@
 	(void) strncpy(pdp->dtpd_name, prp->dtpr_name, DTRACE_NAMELEN - 1);
 }
 
+#if !defined(sun)
+int
+dtrace_probe_provide_cb(linker_file_t lf, void *arg)
+{
+	dtrace_provider_t *prv = (dtrace_provider_t *) arg;
+
+	prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, lf);
+
+	return(0);
+}
+#endif
+
 /*
  * Called to indicate that a probe -- or probes -- should be provided by a
  * specfied provider.  If the specified description is NULL, the provider will
@@ -193,8 +205,8 @@
 static void
 dtrace_probe_provide(dtrace_probedesc_t *desc, dtrace_provider_t *prv)
 {
-#ifdef DOODAD
-	struct modctl *ctl;
+#if defined(sun)
+	modctl_t *ctl;
 #endif
 	int all = 0;
 
@@ -219,7 +231,7 @@
 		 */
 		mutex_enter(&mod_lock);
 
-#ifdef DOODAD
+#if defined(sun)
 		ctl = &modules;
 		do {
 			if (ctl->mod_busy || ctl->mod_mp == NULL)
@@ -228,6 +240,8 @@
 			prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl);
 
 		} while ((ctl = ctl->mod_next) != &modules);
+#else
+		(void) linker_file_list(dtrace_probe_provide_cb, prv);
 #endif
 
 		mutex_exit(&mod_lock);


More information about the p4-projects mailing list