Thanks for your answer. Finally I found that ustackdepth gives me stack depth information (doh!), and seems to be pretty robust.
Interestingly, it is not mentioned in Oracle's docs. They DO mention stackdepth, which is also mentioned in OS X's dtrace source, but in practice it always is 0. --- Horacio > On 02 Aug 2016, at 20:04, David Pacheco <d...@joyent.com> wrote: > > On Mon, Aug 1, 2016 at 9:22 AM, H. Mijail <hmij...@gmail.com > <mailto:hmij...@gmail.com>> wrote: > Hello, > > I'm trying to fix and improve the dapptrace that comes with Mac OS X > (10.11.6); its only clue about its version is a copyright from 2005 by > Brendan Gregg. I have managed to fix reporting of only-user-functions, and > now I would like to make the print flow indentation work better than the > current kludge of resetting the depth every 100ms. > > Looks like the problem is that the pid provider doesn't generate :return > probes for all the functions for which it generates :entry probes, so > whenever one of those non-return-probe function gets called, the depth can't > ratchet back. Can anyone explain why those :return probes don't get > generated, and/or how to fix or avoid it? I'm analyzing my own code, so > recompiling is a possibility if it would help. > > Also, I see that the dtrace command itself has a -F option to "coalesce trace > output by function", but I can't find any further explanation anywhere. Any > idea of how well this works, and whether this suffers from the same problem > of lack of :return probes? > > I'm assuming that studying the source of dtrace itself might be too involved > (would I have to get into the kernel, assuming it's available?), but any > pointers would be welcome. > > --- Horacio > > > There's some information about missing return probes as well as the -F > ("flowindent") option here: > > http://dtrace.org/blogs/brendan/2011/02/14/dtrace-pid-provider-return/ > <http://dtrace.org/blogs/brendan/2011/02/14/dtrace-pid-provider-return/> > > To truly root cause the missing probes, you'd probably need to look at the > disassembly for the functions that are missing probes and compare that with > what DTrace expects based on the pid provider source. It may be sufficient to > just disable the optimizations known to cause this problem, as Ryan suggested. > > I'm not sure where to find the OS X source, though much of the DTrace code > (especially in userland) is likely the same as in illumos. For reference, > here's the illumos source for flowindent: > > > https://github.com/illumos/illumos-gate/blob/b72b6bb10ad55121a1b352c6f68ebdc8e20c9086/usr/src/lib/libdtrace/common/dt_consume.c#L400-L490 > > <https://github.com/illumos/illumos-gate/blob/b72b6bb10ad55121a1b352c6f68ebdc8e20c9086/usr/src/lib/libdtrace/common/dt_consume.c#L400-L490> > > -- Dave
signature.asc
Description: Message signed with OpenPGP using GPGMail
------------------------------------------- dtrace-discuss Archives: https://www.listbox.com/member/archive/184261/=now RSS Feed: https://www.listbox.com/member/archive/rss/184261/25769126-e243886f Modify Your Subscription: https://www.listbox.com/member/?member_id=25769126&id_secret=25769126-8d47a7b2 Powered by Listbox: http://www.listbox.com