Tiller Beauchamp
2008-Jan-22 18:20 UTC
[dtrace-discuss] Excluding functions/modules from pid provider
Hi All, Is the approach offered below still the only way to exclude particular functions or modules when using the pid provider? Thanks, .tiller --- Frome: Morgan.Herrington at Sun.COM Morgan.Herrington at Sun.COM Subject: [dtrace-discuss] Avoiding few functions using pid provider probes Date: Tue Aug 23 14:51:31 PDT 2005 Jignesh: Trying "[!MemoryContextSwitchTo]" won''t work because that creates a regular expression character set which does NOT include any of those listed characters (rather than excluding that particular string). Unable to come up with an elegant solution, I will offer the following ugly, brute-force application of regular expressions. Consider a pattern which excludes functions starting with "M". Then add back in those which start with "M" without a following "e". Then add back in those which start with "Me" but without a following "m". Continue as necessary for "oryContextSwitchTo". Repeat for "LockBuffer". For example: pid$target::[!ML]*:entry, /* exclude funcs starting with "M" or "L" */ pid$target::M[!e]*:entry, /* add back "M" without following "e" */ pid$target::Me[!m]*:entry, /* add back "Me" without following "m" */ pid$target::Mem[!o]*:entry,/* continue this pattern as necessary */ pid$target::L[!o]*:entry, /* repeat for "LockBuffer" */ pid$target::Lo[!c]*:entry, pid$target::Loc[!k]*:entry { self->ts = timestamp; } When I tried this on a test application, I also specified the "-Z" switch because several of the patterns did not match any functions. This entire suggestion is predicated on the assumption that the complexity of this pattern match is paid during instrumentation time (in order to avoid run-time costs). I haven''t actually verified that this is true, so "buyer beware". -morgan>Somewhat helpful > >that works only if the wild Character is included .. I am trying to avoid >MemoryContextSwitchTo >& LockBuffer > >however if I use >[!MemoryContextSwitchTo] >it fails >but if I use >[!MemoryContextSwitchTo]* >it works > >Also how do I mention both MemoryContextSwitchTo as well as LockBuffer out >there?
Adam Leventhal
2008-Jan-22 19:08 UTC
[dtrace-discuss] Excluding functions/modules from pid provider
Hi Tiller, Yes; there''s no generic way of specifically excluding individual functions or modules from instrumentation. You could add a predicate, but that will just keep the function from recording data -- it will stil be instrumented. Adam On Tue, Jan 22, 2008 at 10:20:43AM -0800, Tiller Beauchamp wrote:> Hi All, > > Is the approach offered below still the only way to exclude particular > functions or modules when using the pid provider? > > Thanks, > > .tiller > > --- > > > > Frome: Morgan.Herrington at Sun.COM Morgan.Herrington at Sun.COM > Subject: [dtrace-discuss] Avoiding few functions using pid provider probes > Date: Tue Aug 23 14:51:31 PDT 2005 > > > Jignesh: > > Trying "[!MemoryContextSwitchTo]" won''t work because that creates a > regular expression character set which does NOT include any of those > listed characters (rather than excluding that particular string). > > Unable to come up with an elegant solution, I will offer the following > ugly, brute-force application of regular expressions. > > Consider a pattern which excludes functions starting with "M". Then > add back in those which start with "M" without a following "e". Then > add back in those which start with "Me" but without a following "m". > Continue as necessary for "oryContextSwitchTo". Repeat for "LockBuffer". > > For example: > > pid$target::[!ML]*:entry, /* exclude funcs starting with "M" or "L" */ > pid$target::M[!e]*:entry, /* add back "M" without following "e" */ > pid$target::Me[!m]*:entry, /* add back "Me" without following "m" */ > pid$target::Mem[!o]*:entry,/* continue this pattern as necessary */ > pid$target::L[!o]*:entry, /* repeat for "LockBuffer" */ > pid$target::Lo[!c]*:entry, > pid$target::Loc[!k]*:entry > { > self->ts = timestamp; > } > > When I tried this on a test application, I also specified the "-Z" > switch because several of the patterns did not match any functions. > > This entire suggestion is predicated on the assumption that the complexity > of this pattern match is paid during instrumentation time (in order to > avoid run-time costs). I haven''t actually verified that this is true, > so "buyer beware". > > -morgan > > >Somewhat helpful > > > >that works only if the wild Character is included .. I am trying to avoid > >MemoryContextSwitchTo > >& LockBuffer > > > >however if I use > >[!MemoryContextSwitchTo] > >it fails > >but if I use > >[!MemoryContextSwitchTo]* > >it works > > > >Also how do I mention both MemoryContextSwitchTo as well as LockBuffer out > >there? > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl