[dtrace-discuss] Is there any way to check if DTrace is running or a DTrace probe is enabled?

Nikita Zinoviev Nikita.Zinoviev at Sun.COM
Sat Nov 1 02:30:54 PDT 2008


I do not remember exact details, but we have such functionality in 
dtrace support for java in JDK 7. I guess, it just looks whether nops 
are replaced by the breakpoint at the beginning of the probe handler 
(?). I suggest you ask Keith, Keith.McGuigan at Sun.COM.
The idea was to give the user ability to skip heavy preprocessing of 
probe arguments if the probe is not enabled.
As far as I know this solution for C code will be *very* efficient,
(in java it involved context switching, so calling Probe::isEnabled() 
had nearly the same cost as actually firing the probe).


Hope this helps,

Nikita


Danhua Shao wrote:
> Hi,
> 
> I am adding DTrace probes within NFS v3 client.  In my current 
> implementation, I use some tsd_*() functions and kmem_zalloc() function. 
> These functions might be heavy and affect the performance.  I want to 
> call this function only when DTrace is running or the DTrace probes are 
> enable. So is there a way to check  DTrace is running or DTrace probe is 
> enabled?
> 
> Regards,
> 
> Danhua
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org




More information about the dtrace-discuss mailing list