Thomas Maier-Komor
2010-Jul-16 14:39 UTC
[dtrace-discuss] condition probe argument construction in static probes
Hi, is it somehow possible to conditionally enable a section of code that is responsible for constructing a probe argument. I.e. if the first probe argument is a string, can I attach a function to the probe that will yield that string so that it doesn''t have to be constructed if the probe doesn''t fire? Defining the following probe yields assembly that executes the call to expensive_argument_construction unconditionally... DTRACE_PROBE1(myprovider,myprobe,expensive_argument_construction()); - Thomas -- This message posted from opensolaris.org
Chad Mynhier
2010-Jul-16 14:46 UTC
[dtrace-discuss] condition probe argument construction in static probes
I think you''re looking for is-enabled probes. See http://blogs.sun.com/ahl/entry/user_land_tracing_gets_better or the current DTrace documentation. Chad On Fri, Jul 16, 2010 at 10:39 AM, Thomas Maier-Komor <thomas at maier-komor.de> wrote:> Hi, > > is it somehow possible to conditionally enable a section of code that is responsible for constructing a probe argument. > > I.e. if the first probe argument is a string, can I attach a function to the probe that will yield that string so that it doesn''t have to be constructed if the probe doesn''t fire? > > Defining the following probe yields assembly that executes the call to expensive_argument_construction unconditionally... > > DTRACE_PROBE1(myprovider,myprobe,expensive_argument_construction()); > > - Thomas > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >
Thomas Maier-Komor
2010-Jul-16 14:58 UTC
[dtrace-discuss] conditional probe argument construction in static probes
replying to myself... dtrace -h and <provider>_<probe>_ENABLED() seems to be the clue This still yields a clear register -> nops -> jump-conditionally assembler sequence. But this is almost zero overhead... Or is there anything better? - Thomas -- This message posted from opensolaris.org
Thomas Maier-Komor
2010-Jul-19 11:08 UTC
[dtrace-discuss] condition probe argument construction in static probes
yes, that is what I was looking for and what I found myself before reading your e-mail. Your answer just came unexpectedly quick. Thanks anyway! Cheers, Thomas -- This message posted from opensolaris.org