Hi all,

Is there a way to print stack traces as part of an aggregation key in dtrace? I'm trying to count occurrences of different stack traces, but my program has lots of indirect function calls and the output of stack() often doesn't contain the current function. Aggregating on @who[caller,stack()] should fix this in theory, but I can't get the printing to work right.

printa(@who) shows the stack but just an address for caller, and neither %a nor %s allows me to print a stack trace if I give printa a format string:
printa("%40a %40s %...@d", @who)
dtrace: failed to compile script who.d: line 30: printa( ) argument #3 is incompatible with conversion #2 prototype:
        conversion: %s
         prototype: char [] or string (or use stringof)
          argument: stack

printa("%40a %40a %...@d", @who)
dtrace: failed to compile script who.d: line 30: printa( ) argument #3 is incompatible with conversion #2 prototype:
        conversion: %a
         prototype: pointer or integer
          argument: stack
On a related note, it seems that "%A" can translate user-level addresses to symbols in a printf/printa, which is not documented AFAICT and has caused me pain in the past (see http://kr.sun.com/developers/solaris/techdocs/dtrace_tips_public.pdf)

Ideas?
Ryan
_______________________________________________
dtrace-discuss mailing list
dtrace-discuss@opensolaris.org

Reply via email to