Max
2009-Nov-02 12:46 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
Hi Folks, I''m trying to use DTrace to understand some complex code using the user process probe. Things are basically not matching up. When I use a variable to track depth, sometimes it jumps. Similarly, the flow indent seems off. I read another post saying that this is caused by missing return statements in functions. http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html Problem is I''m a bit of a newbie with DTrace so although I get the general idea of the post, I''m still a bit confused about how to do a workaround. Would anyone have any advice on how to resolve this? Ideally I''m just after a way to reliably trace function entries and returns. Any advice would be much appreciated. Thanks, Max
Angelo Rajadurai
2009-Nov-02 12:54 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
Hey Max: There is a built in variable ustackdepth that should provide you stack depth in user land. See if this helps -Angelo On Nov 2, 2009, at 7:46 AM, Max wrote:> Hi Folks, > I''m trying to use DTrace to understand some complex code using the > user process probe. > > Things are basically not matching up. When I use a variable to track > depth, sometimes it jumps. Similarly, the flow indent seems off. > > I read another post saying that this is caused by missing return > statements in functions. > > http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html > > Problem is I''m a bit of a newbie with DTrace so although I get the > general idea of the post, I''m still a bit confused about how to do a > workaround. > > Would anyone have any advice on how to resolve this? > > Ideally I''m just after a way to reliably trace function entries and > returns. > > Any advice would be much appreciated. > > Thanks, > Max > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
Max
2009-Nov-02 13:21 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
Hi Angelo, great thanks. It''s working a bit better now. I assume that ustackdepth handles functions with no return statements? These would otherwise be missed by using a variable to track depth with a return probe. One thing is the flow indent still seems off. Do you know of any workaround for that? Cheers, Max On 2 Nov 2009, at 12:54, Angelo Rajadurai wrote:> Hey Max: > > There is a built in variable ustackdepth that should provide you > stack depth in user land. See if this helps > > -Angelo > > > On Nov 2, 2009, at 7:46 AM, Max wrote: > >> Hi Folks, >> I''m trying to use DTrace to understand some complex code using the >> user process probe. >> >> Things are basically not matching up. When I use a variable to >> track depth, sometimes it jumps. Similarly, the flow indent seems >> off. >> >> I read another post saying that this is caused by missing return >> statements in functions. >> >> http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html >> >> Problem is I''m a bit of a newbie with DTrace so although I get the >> general idea of the post, I''m still a bit confused about how to do >> a workaround. >> >> Would anyone have any advice on how to resolve this? >> >> Ideally I''m just after a way to reliably trace function entries and >> returns. >> >> Any advice would be much appreciated. >> >> Thanks, >> Max >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org >
Angelo Rajadurai
2009-Nov-02 13:57 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
Hey Max, DTrace provides a -F flag and it does auto flow indent. Did you try that flag and see if that works for you. You can also call it as a pragma #pragma D option flowindent The flow intent understands most flow construct with -entry/-return in it. Check that out Angelo On Nov 2, 2009, at 8:21 AM, Max wrote:> Hi Angelo, > great thanks. It''s working a bit better now. I assume that > ustackdepth handles functions with no return statements? These would > otherwise be missed by using a variable to track depth with a return > probe. > > One thing is the flow indent still seems off. Do you know of any > workaround for that? > > Cheers, > Max > > > On 2 Nov 2009, at 12:54, Angelo Rajadurai wrote: > >> Hey Max: >> >> There is a built in variable ustackdepth that should provide you >> stack depth in user land. See if this helps >> >> -Angelo >> >> >> On Nov 2, 2009, at 7:46 AM, Max wrote: >> >>> Hi Folks, >>> I''m trying to use DTrace to understand some complex code using the >>> user process probe. >>> >>> Things are basically not matching up. When I use a variable to >>> track depth, sometimes it jumps. Similarly, the flow indent seems >>> off. >>> >>> I read another post saying that this is caused by missing return >>> statements in functions. >>> >>> http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html >>> >>> Problem is I''m a bit of a newbie with DTrace so although I get the >>> general idea of the post, I''m still a bit confused about how to do >>> a workaround. >>> >>> Would anyone have any advice on how to resolve this? >>> >>> Ideally I''m just after a way to reliably trace function entries >>> and returns. >>> >>> Any advice would be much appreciated. >>> >>> Thanks, >>> Max >>> _______________________________________________ >>> dtrace-discuss mailing list >>> dtrace-discuss at opensolaris.org >> >
Jonathan Adams
2009-Nov-02 17:49 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
On Mon, Nov 02, 2009 at 12:46:45PM +0000, Max wrote:> Hi Folks, > I''m trying to use DTrace to understand some complex code using the > user process probe. > > Things are basically not matching up. When I use a variable to track > depth, sometimes it jumps. Similarly, the flow indent seems off.Remember that data is stored in per-CPU buffers, which are then printed out all-at-once. If you have long-running data which can run on multiple CPUs, you''ll need to print out "timestamp", then sort the output by that field for everything to line up. Cheers, - jonathan> I read another post saying that this is caused by missing return > statements in functions. > > http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html > > Problem is I''m a bit of a newbie with DTrace so although I get the > general idea of the post, I''m still a bit confused about how to do a > workaround. > > Would anyone have any advice on how to resolve this? > > Ideally I''m just after a way to reliably trace function entries and > returns. > > Any advice would be much appreciated. > > Thanks, > Max > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org
Max
2009-Nov-02 17:58 UTC
[dtrace-discuss] User process probe. Stack depth and flow indent skips and mismatches.
Brilliant thanks. Crucial point about the CPUs. That explains a lot of what I''m seeing. Cheers, Max On 2 Nov 2009, at 17:49, Jonathan Adams wrote:> On Mon, Nov 02, 2009 at 12:46:45PM +0000, Max wrote: >> Hi Folks, >> I''m trying to use DTrace to understand some complex code using the >> user process probe. >> >> Things are basically not matching up. When I use a variable to track >> depth, sometimes it jumps. Similarly, the flow indent seems off. > > Remember that data is stored in per-CPU buffers, which are then > printed > out all-at-once. If you have long-running data which can run on > multiple CPUs, you''ll need to print out "timestamp", then sort the > output > by that field for everything to line up. > > Cheers, > - jonathan > >> I read another post saying that this is caused by missing return >> statements in functions. >> >> http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-June/000011.html >> >> Problem is I''m a bit of a newbie with DTrace so although I get the >> general idea of the post, I''m still a bit confused about how to do a >> workaround. >> >> Would anyone have any advice on how to resolve this? >> >> Ideally I''m just after a way to reliably trace function entries and >> returns. >> >> Any advice would be much appreciated. >> >> Thanks, >> Max >> _______________________________________________ >> dtrace-discuss mailing list >> dtrace-discuss at opensolaris.org