[RFC] reworking FreeBSD's SDT implementation

Mikolaj Golub trociny at FreeBSD.org
Thu Jul 11 21:02:21 UTC 2013


Hi Mark,

On Wed, Jul 10, 2013 at 10:45:08PM -0400, Mark Johnston wrote:

> The final draft of my patch is here:
> http://people.freebsd.org/~markj/patches/sdt-module-info/20130710-sdt-module-info.diff
> 
> I've committed the mod_lock stuff and man page separately. If no one has
> any objections, I'll commit the patch sometime this weekend.
> Review and comments are still very welcome!

One thing noticed. I don't think '#if defined(sun)' directives in
dtrace.c are correct now:

> -#if defined(sun)
>  /*
>   * DTrace Hook Functions
>   */
>  static void
> -dtrace_module_loaded(modctl_t *ctl)
> +dtrace_module_loaded(struct linker_file *lf)

ctl is unconditionally removed

>  {
>  	dtrace_provider_t *prv;
> 
> @@ -15166,14 +15150,16 @@ dtrace_module_loaded(modctl_t *ctl)
>  	mutex_enter(&mod_lock);
>  #endif
> 
> +#if defined(sun)
>  	ASSERT(ctl->mod_busy);
> +#endif

while here it is used if sun is defined.

> 
>  	/*
>  	 * We're going to call each providers per-module provide operation
>  	 * specifying only this module.
>  	 */
>  	for (prv = dtrace_provider; prv != NULL; prv = prv->dtpv_next)
> -		prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl);
> +		prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, lf);

And this looks wrong for sun case.

The same issues are in dtrace_module_unloaded().

-- 
Mikolaj Golub


More information about the freebsd-dtrace mailing list