S h i v
2008-Nov-12 03:12 UTC
[dtrace-discuss] Runtime customization of a dscript & pre-processing
I would like to make some execution time decisions as to which libraries to trace and which ones not to. For ex: 1. I use hotuser script and identify a bunch of functions/libraries taking the most time under load. 2. Now I would like to apply hotuser kind of profiling only to those libraries and heavier load(which might not be possible otherwise). In such cases, I probably need to have parameterised predicate list or dynamically generated dscripts. One thought that occurs to me is to have some kind of pre-processing option available in dtrace. Write a wrapper shell/perl script that helps identify decision points for the pre-processor and conditionally execute different instructions. Probably pre-processing is already present. I wasn''t able to find it in some of the documentation I looked at on the net. Can someone suggest me a solution for the scenario I mention. Also is pre-processing option available in dtrace. -Shiv
Jonathan Adams
2008-Nov-12 18:02 UTC
[dtrace-discuss] Runtime customization of a dscript & pre-processing
On Wed, Nov 12, 2008 at 08:42:00AM +0530, S h i v wrote:> I would like to make some execution time decisions as to which > libraries to trace and which ones not to. > > For ex: > 1. I use hotuser script and identify a bunch of functions/libraries > taking the most time under load. > 2. Now I would like to apply hotuser kind of profiling only to those > libraries and heavier load(which might not be possible otherwise). > > In such cases, I probably need to have parameterised predicate list or > dynamically generated dscripts. > One thought that occurs to me is to have some kind of pre-processing > option available in dtrace. Write a wrapper shell/perl script that > helps identify decision points for the pre-processor and conditionally > execute different instructions. > Probably pre-processing is already present. I wasn''t able to find it > in some of the documentation I looked at on the net.If you add ''-C'' to the dtrace arguments, it will run the C preprocessor. You can then use -DVAR=value to pass in whatever you need. Cheers, - jonathan
S h i v
2008-Nov-13 01:08 UTC
[dtrace-discuss] Runtime customization of a dscript & pre-processing
On Wed, Nov 12, 2008 at 11:32 PM, Jonathan Adams <jonathan.adams at sun.com> wrote:> On Wed, Nov 12, 2008 at 08:42:00AM +0530, S h i v wrote:<snip>>> One thought that occurs to me is to have some kind of pre-processing >> option available in dtrace.<snip>> > If you add ''-C'' to the dtrace arguments, it will run the C preprocessor. > You can then use -DVAR=value to pass in whatever you need. >Just what I was looking for ! Thanks. -Shiv