Caruana, Damien
2006-May-26 14:01 UTC
[dtrace-discuss] Does the use of predicates removes allperformance impact?
I''d like to add the same specfic probe definition into the code of several executables to generate some traces. The idea was to have only on Dtrace script that matches my probe and generate traces only for application where tracing has been enabled. I would change dynamically a Dtrace script variable to be tested into a predicate inside the script to generate or not traces according to the executable name that fires the probe. So I was wondering what impact could this script have on my executables if it is running and if no probes are enabled into the Dtrace script. Damien -----Original Message----- From: Roch Bourbonnais - Performance Engineering [mailto:Roch.Bourbonnais at Sun.COM] Sent: vendredi 26 mai 2006 14:59 To: Caruana, Damien Cc: Casper.Dik at Sun.COM; Michael Schuster; Jim.Fiori at Sun.COM; dtrace-discuss at opensolaris.org Subject: RE: [dtrace-discuss] Does the use of predicates removes allperformance impact? Maybe we would need to have a highler level view of what your trying to acheive. We normally don''t have to focus that hard on the cost of predicate. I''m not saying the cost ain''t there, nor that it would be good to reduce it, but it''s mostly been more than acceptable for a lot of usecase. So why do you fear it that much and what are you trying to achieve here ? -r Caruana, Damien writes: > I''d like to have a better understanding of the impact of using a > predicate. > I would like to enable a probe on certain condition. If I can check the > condition inside my code before firing the probe or inside the > predicate, with a basic string comparaison for example, what''s the best > thing to do? > - firing the probe all the time and using a predicate to > generate traces or not, > - or compare the string inside an ''if'' statement into my code to > choose to fire the probe or not to generate traces? > > So does firing a probe and making a string comparaison inside a > predicate is a better choice than doing the string comparaison into an > ''if'' statement into my code to fire or not the probe? > > Thank''s > > -----Original Message----- > From: casper at holland.sun.com [mailto:casper at holland.sun.com]On Behalf Of > Casper.Dik at Sun.COM > Sent: vendredi 26 mai 2006 10:45 > To: Michael Schuster > Cc: Caruana, Damien; Jim.Fiori at Sun.COM; dtrace-discuss at opensolaris.org > Subject: Re: [dtrace-discuss] Does the use of predicates removes all > performance impact? > > > > >Caruana, Damien wrote: > >> If I well understood, > >> If I defined a probe into my source code, each time my Dtrace probe > will > >> by met in my code, some dtrace code will be executed in the kernel > even > >> if I don''t use any Dtrace script. > > > >no (according to my understanding). > > The probe code is converted to nops. Which basically means there''s > "next to no" impact but not exactly zero. > > >once you start tracing, the code at the point you''re watching is > >dynamically changed to - put very basically - branch to the > DTrace-specific > >code. This code then evaluates any predicates. > > Yes, but for probe points, some instruction space is reserved. > > Casper > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org