I am looking for a basic user land probe example which explains how I can check if probe ''a'' is active and execute extra code to fill the probe data. int main(void) { // some code if(probe_a_active) { // prepare data for probe dtrace_send_probe_data(...,data,...); } // some code } -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----''-/`-/ olga.kryzhanovska at gmail.com \-`\-''----. `''-..-| / Solaris/BSD//C/C++ programmer \ |-..-''` /\/\ /\/\ `--` `--`
2009/10/27 ????? ???????????? <olga.kryzhanovska at gmail.com>:> I am looking for a basic user land probe example which explains how I > can check if probe ''a'' is active and execute extra code to fill the > probe data.Olga, You may want to check this http://blogs.sun.com/ahl/entry/user_land_tracing_gets_better> int main(void) > { > > ? ? ? ?// some code > > ? ? ? ?if(probe_a_active) > ? ? ? ?{ > ? ? ? ? ? ? ? ?// prepare data for probe > ? ? ? ? ? ? ? ?dtrace_send_probe_data(...,data,...); > ? ? ? ?} > > ? ? ? ?// some code > > } > -- > ? ? ?, ? _ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?_ ? , > ? ? { \/`o;====- ? ?Olga Kryzhanovska ? -====;o`\/ } > .----''-/`-/ ? ? olga.kryzhanovska at gmail.com ? \-`\-''----. > ?`''-..-| / ? ? Solaris/BSD//C/C++ programmer ? \ |-..-''` > ? ? ?/\/\ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? /\/\ > ? ? ?`--` ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?`--` > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-- Regards, Cyril
On 10/27/09, Cyril Plisko <cyril.plisko at mountall.com> wrote:> 2009/10/27 ????? ???????????? <olga.kryzhanovska at gmail.com>: > > > I am looking for a basic user land probe example which explains how I > > can check if probe ''a'' is active and execute extra code to fill the > > probe data. > > > Olga, > > You may want to check this > http://blogs.sun.com/ahl/entry/user_land_tracing_gets_betterThanks. Following the links I discovered http://www.opensolaris.org/jive/thread.jspa?messageID=31314 but I still need help of someone who turns this into a complete example with main() and Makefile. -- , _ _ , { \/`o;====- Olga Kryzhanovska -====;o`\/ } .----''-/`-/ olga.kryzhanovska at gmail.com \-`\-''----. `''-..-| / Solaris/BSD//C/C++ programmer \ |-..-''` /\/\ /\/\ `--` `--`
Hi... I am curious to understand how dtrace can have a nanosecond timestamp even when the hi-res-tick-timer is off ( according to /etc/system file ). Is timestamp really that accurate when the hi-res-tick-timer is off ? wr
William Reich wrote:> Hi... > > I am curious to understand how > dtrace can have a nanosecond timestamp > even when the hi-res-tick-timer is off > ( according to /etc/system file ).hi-res-tick and the timing you get from dtrace aren''t the same thing - setting hi-res tick increases the clock tick frequency from 100Hz to 1kHz, which is much too slow for anything that needs to be measured more precisely (as you observe) - this is a holdover from the time before we had cyclics and hires-timer (not to be confused with the above), which is basically - and very roughly - a timer that gets the best resolution the HW can offer.> Is timestamp really that accurate when the hi-res-tick-timer is off ?the unit is in ns, precision can be less (at least that''s what I remember from the last time I looked at this) and again depends on HW. Michael -- Michael Schuster http://blogs.sun.com/recursion Recursion, n.: see ''Recursion''
The hires timer is based on TSC. TSC once ticked at "the CPU frequency", although of course you couldn''t read it that fast, so its precision was lower. Nowadays, it''s usually significantly lower (order of 1GHz, IIRC). IOW, the units of reporting don''t mean that you can read two successive stamps with only one tick''s difference. Michael Schuster wrote:> William Reich wrote: >> Hi... >> >> I am curious to understand how >> dtrace can have a nanosecond timestamp >> even when the hi-res-tick-timer is off >> ( according to /etc/system file ). > > hi-res-tick and the timing you get from dtrace aren''t the same thing - > setting hi-res tick increases the clock tick frequency from 100Hz to > 1kHz, which is much too slow for anything that needs to be measured more > precisely (as you observe) - this is a holdover from the time before we > had cyclics and hires-timer (not to be confused with the above), which > is basically - and very roughly - a timer that gets the best resolution > the HW can offer. > >> Is timestamp really that accurate when the hi-res-tick-timer is off ? > > the unit is in ns, precision can be less (at least that''s what I > remember from the last time I looked at this) and again depends on HW. > > Michael