From owner-p4-projects@FreeBSD.ORG Mon Apr 24 23:28:35 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1023216A402; Mon, 24 Apr 2006 23:28:35 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B2CDB16A400 for ; Mon, 24 Apr 2006 23:28:34 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F13C43D46 for ; Mon, 24 Apr 2006 23:28:34 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3ONSY0G005575 for ; Mon, 24 Apr 2006 23:28:34 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3ONSYNi005572 for perforce@freebsd.org; Mon, 24 Apr 2006 23:28:34 GMT (envelope-from jb@freebsd.org) Date: Mon, 24 Apr 2006 23:28:34 GMT Message-Id: <200604242328.k3ONSYNi005572@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 96025 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2006 23:28:35 -0000 http://perforce.freebsd.org/chv.cgi?CH=96025 Change 96025 by jb@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);