Hi all, I know that it is possible to stop a dtrace script after some time. I have searched through the available docs but cannot find it. Can some one please inform me what the right syntax is? Regards Hans-Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090911/bf2569bf/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: disclaimer.txt URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090911/bf2569bf/attachment.txt>
Hi, It may not be the approved way but I''ve usually just set a profile provider and called exit from within it. There are profile providers for nsecs, microsecs, secs, minutes, hours, days and even hz. I''ve probably just revealed myself to be a very unsophisticated DTrace-r :*/ Cheers, Peter. Sloot, Hans-Peter wrote:> > Hi all, > > I know that it is possible to stop a dtrace script after some time. > I have searched through the available docs but cannot find it. > > Can some one please inform me what the right syntax is? > > Regards Hans-Peter > > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3253 bytes Desc: S/MIME Cryptographic Signature URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090911/fd30a8be/attachment.bin>
Hi Hans-Peter, You''re looking for the ''tick'' provider, which for some reason is documented in the page for the ''profile'' provider: http://wikis.sun.com/display/DTrace/profile+Provider. Basically, you want something like tick-10sec { exit(); } Regards, Ryan Sloot, Hans-Peter wrote:> > Hi all, > > I know that it is possible to stop a dtrace script after some time. > I have searched through the available docs but cannot find it. > > Can some one please inform me what the right syntax is? > > Regards Hans-Peter > > ------------------------------------------------------------------------ > > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
Peter Telford wrote:> Hi, > It may not be the approved way but I''ve usually just set a profile > provider and called exit from within it. > > There are profile providers for nsecs, microsecs, secs, minutes, > hours, days and even hz. > > I''ve probably just revealed myself to be a very unsophisticated > DTrace-r :*/ > Cheers, > Peter.I knew I should keep quiet, Ryan is right - tick not profile, that fires on every CPU :*) PT. -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3253 bytes Desc: S/MIME Cryptographic Signature URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090911/c615c08a/attachment-0001.bin>
On Fri, Sep 11, 2009 at 5:28 AM, Ryan Johnson <ryanjohn at ece.cmu.edu> wrote:> Hi Hans-Peter, > > You''re looking for the ''tick'' provider, which for some reason is documented > in the page for the ''profile'' provider: > http://wikis.sun.com/display/DTrace/profile+Provider. > > Basically, you want something like > > tick-10sec { exit(); } >The tick and profile providers are one and the same. The difference is that the tick provider fires on a single CPU while the profile provider fires on multiple CPUs. It''s probably also worth noting that a tick-10sec probe isn''t guaranteed to fire after 10 seconds, it''s guaranteed to fire some time in the next 10 seconds. Tick and profile probes use cyclics. If there''s already an enabled tick-10sec probe on the server, i.e., there''s an existing cyclic, DTrace won''t create a new cyclic for this script. The existing one will be used, and you don''t know when that cyclic is going to fire. The only thing you''re guaranteed is that the second and succeeding ones will fire at 10 seconds intervals. The better way to do this (if it matters) is to use a tick-1sec probe with a counter, like this: BEGIN { counter = 0; } tick-1sec / counter < 10 / { counter++; } tick-1sec / counter >= 10 / { exit(0); } This way, the script will run for somewhere between 9 and 10 seconds. Chad