Hello all, Newbie question: I''d like to use Dtrace for the following. In my source code I want to place function calls that, when executed, results in an entry in a trace log. As my programme runs the log grows and stores a record of when my programme called the trace log functions. I then want to be able to view the accumulated log in some tool which displays when the programme executed the trace log functions on a per thread basis. The ideal would be time on the horizontal axis, threads on the vertical, and marks plotted for each time a trace log function had been called. Is this possible with Dtrace and associated tools? My background is in real time OSes, primarily WindRiver''s VxWorks, and they do an excellent tool called System Viewer (used to be called WindView) which does as descibed above and whole lot more (semaphore acquisitions, priority inheritence, interrupts, device driver and kernel activity, the lot). Take a look at: Figure 1.1 in: http://www.slac.stanford.edu/exp/glast/flight/sw/vxdocs/windview/wvug/c-intro.html#83877 Page 10 in: http://www.windriver.com/products/product-notes/workbench-product-note.pdf Windview is excellent, makes multithreaded programming easy as pie, and it''s a nasty shock to come to the main stream OS world and find that the development tools lack something as fundamentally good as this. Can Dtrace do the same? Cheers, Matthew -- This message posted from opensolaris.org
Matthew Bromley-Barratt wrote:> Hello all, > > Newbie question: I''d like to use Dtrace for the following. In my source code I want to place function calls that, when executed, results in an entry in a trace log. As my programme runs the log grows and stores a record of when my programme called the trace log functions. I then want to be able to view the accumulated log in some tool which displays when the programme executed the trace log functions on a per thread basis. The ideal would be time on the horizontal axis, threads on the vertical, and marks plotted for each time a trace log function had been called. Is this possible with Dtrace and associated tools? > > My background is in real time OSes, primarily WindRiver''s VxWorks, and they do an excellent tool called System Viewer (used to be called WindView) which does as descibed above and whole lot more (semaphore acquisitions, priority inheritence, interrupts, device driver and kernel activity, the lot). Take a look at: > > Figure 1.1 in: > http://www.slac.stanford.edu/exp/glast/flight/sw/vxdocs/windview/wvug/c-intro.html#83877 > > Page 10 in: > http://www.windriver.com/products/product-notes/workbench-product-note.pdf > > Windview is excellent, makes multithreaded programming easy as pie, and it''s a nasty shock to come to the main stream OS world and find that the development tools lack something as fundamentally good as this. Can Dtrace do the same? > > Cheers, > > MatthewMatthew, you might be interested in Performance Analyzer which is part of Sun Studio (http://developers.sun.com/sunstudio/overview/topics/analyzer_index.html). Menno
Thanks for the various replies I''ve had. Not been able to get on to a solaris box for various reasons so I''ve not been able to pursue anything yet. Will do so soonest.>From what I''ve seen dtrace seems to be about measuring programme metrics without adding anything to the programme''s source code. However, I don''t mind instrumenting my own application. Windview works by letting you place calls to a function wvevent(<unique_id>) which results in <unique_id> appearing as a unique event in that thread''s timeline. It is very useful indeed!Matthew -- This message posted from opensolaris.org
I should have previewed my own post: Windview works by letting you place calls to a function wvevent(UNIQUE_ID) which results in UNIQUE_ID appearing as an event in that thread''s timeline. -- This message posted from opensolaris.org
Matthew Bromley-Barratt writes:> Thanks for the various replies I''ve had. Not been able to get on to a solaris box for various reasons so I''ve not been able to pursue anything yet. Will do so soonest. > > >From what I''ve seen dtrace seems to be about measuring programme metrics without adding anything to the programme''s source code. However, I don''t mind instrumenting my own application. Windview works by letting you place calls to a function wvevent(<unique_id>) which results in <unique_id> appearing as a unique event in that thread''s timeline. It is very useful indeed!That''d be DTRACE_PROBE() in dtrace. See: http://wikis.sun.com/display/DTrace/Statically+Defined+Tracing+for+User+Applications -- James Carlson, Solaris Networking <james.d.carlson at sun.com> Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084 MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
Please forgive me if I need to chime in with an "Us too" - QNX has the System Profiler plugin to our Momentics IDE. http://www.qnx.com/developers/docs/6.4.0/ide_en/user_guide/sysprof.html http://qnx.com/products/tools/optimization.html These sort of tracing tools are very cool, and I agree that I couldn''t live without them. That said, dtrace fills an entirely different niche from simply ''logging everything''. Getting a details trace of what happened in the system has been present in one or more forms for years, but nothing has approached the flexibility of dtrace, as has the ability to instrument code. But the ability to randomly ask questions of your system, and then ask the questions that those answers beget, which you might not ever have thought of before the initial question is invaluable. It allows you to ''follow your nose'', and quickly, before your nose acclimatizes to the stink you just detected! :-) The ability to dynamically trace production systems without having to instrument them may not sound too important to you in an embedded environment, but the number of times I''ve been trying to track down weird problems on targets, where the ''fix/reflash/reboot'' cycle is enormous makes me shudder. Colin On Mon, Jan 5, 2009 at 2:48 PM, Matthew Bromley-Barratt < msbbarratt at theiet.org> wrote:> Thanks for the various replies I''ve had. Not been able to get on to a > solaris box for various reasons so I''ve not been able to pursue anything > yet. Will do so soonest. > > >From what I''ve seen dtrace seems to be about measuring programme metrics > without adding anything to the programme''s source code. However, I don''t > mind instrumenting my own application. Windview works by letting you place > calls to a function wvevent(<unique_id>) which results in <unique_id> > appearing as a unique event in that thread''s timeline. It is very useful > indeed! > > Matthew > -- > This message posted from opensolaris.org > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-- colin.burgess at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20090106/e6c462e6/attachment.html>