On Mon, Mar 03, 2008 at 11:43:03AM -0600, Robert Lor wrote:
> I'd like to prepend TRACE_ to the macro names generated by dtrace -h. 
> For example, change
> POSTGRESQL_LWLOCK_ACQUIRE(arg0, arg1) to 
> TRACE_POSTGRESQL_LWLOCK_ACQUIRE(arg0, arg1) and still keep postgresql as 
> the provider name. The reason for doing this is to make it clear that 
> the macros are used for (D)tracing. In this particular case, without 
> TRACE_, it appears like the macro is used for acquiring locks.
> 
> I tested this out on both Solaris and Mac OS X Leopard, and it seems to 
> work just fine. Is this safe to do? Any potential problems I'm not aware of?
> 
> It would be nice if this can be done by specifying the prefix in the .d 
> file or through the dtrace program.
> 
> Regards,
> -Robert

There's nothing wrong with changing the macro names, and I agree it'd be
nice to provide an option to set the prefix.  If anyone wants to take a
whack at a very simple extension to libdtrace this is a good one.
Basically just add a new -x option and make the dt_program.c code in
libdtrace look at it when generating the names and prepend that as well.

-Mike

-- 
Mike Shapiro, Sun Microsystems Fishworks. blogs.sun.com/mws/
_______________________________________________
dtrace-discuss mailing list
[email protected]

Reply via email to