I got a c++ app, called from sun web server (hence my previous question of how to instrument a short lived process). I created a framework that fakes the client/sun web server and executes the application through a dtrace call with -c so I can use the pid provider. I instrumented to get a count of functions. A *lot* of malloc (and the mutex locking/unlocking associated with that, although this is a single threaded app, I wish I could use a straight non MT malloc). Anyway, I then used a count of similar calls: pid$target:libc:malloc:entry { @[ustack()]=count(); } As the script that runs when calling -c app.cgi I found the biggest culprit here: app.cgi`malloc libCrun.so.1`__1c2n6FL_pv_+0x28 libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc ator4Cc___I__getRep6MLL_pnH__rwstdM__string_ref4Ccn0B_n0C____+0x50 libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc ator4Cc___Hreplace6MLLLc_r1_+0x298 0x10003624c 0x1000f2d7c 0x1000f1bf4 0x1000efc8c 0x1000efb28 0x100099230 0x100098034 0x10003a5d0 app.cgi`_start+0x17c 64785 64K calls on this! Everything else is a low count in comparison. I know this is unintentional, due to a bug. This is a c++ app, compiled with Sun Studio 12 EA1, on a sun blade, as debug, with symbols, then run on a sun t1000. I also tried with release mode (and xarch=v9b, xtarget=ultraT1, xchip=ultraT1). Neither were stripped, but result is the same. How do I get names instead of addresses on the stack dump? nm app.cgi does show the symbol names etc. Thanks
Francois Dion wrote:> I got a c++ app, called from sun web server (hence my previous question > of how to instrument a short lived process). I created a framework that > fakes the client/sun web server and executes the application through a > dtrace call with -c so I can use the pid provider. > > I instrumented to get a count of functions. A *lot* of malloc (and the > mutex locking/unlocking associated with that, although this is a single > threaded app, I wish I could use a straight non MT malloc). Anyway, I > then used a count of similar calls: > > pid$target:libc:malloc:entry > { > @[ustack()]=count(); > } > > As the script that runs when calling -c app.cgi > > I found the biggest culprit here: > > app.cgi`malloc > libCrun.so.1`__1c2n6FL_pv_+0x28 > > libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc > ator4Cc___I__getRep6MLL_pnH__rwstdM__string_ref4Ccn0B_n0C____+0x50 > > libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc > ator4Cc___Hreplace6MLLLc_r1_+0x298 > 0x10003624c > 0x1000f2d7c > 0x1000f1bf4 > 0x1000efc8c > 0x1000efb28 > 0x100099230 > 0x100098034 > 0x10003a5d0 > app.cgi`_start+0x17c > 64785 > > 64K calls on this! Everything else is a low count in comparison. I know > this is unintentional, due to a bug. > > This is a c++ app, compiled with Sun Studio 12 EA1, on a sun blade, as > debug, with symbols, then run on a sun t1000. I also tried with release > mode (and xarch=v9b, xtarget=ultraT1, xchip=ultraT1). Neither were > stripped, but result is the same. How do I get names instead of > addresses on the stack dump? > > nm app.cgi does show the symbol names etc. > > Thanks > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.orgIt looks like you have a lot of local functions... if you can try this on a machine running the latest OpenSolaris bits, I think you''ll be able to see those functions w/o difficulty. This works on my build 60 desktop. - Bart -- Bart Smaalders Solaris Kernel Performance barts at cyber.eng.sun.com http://blogs.sun.com/barts
This may be related to this bug: 6296612 plockstat dumps core on second call The problem there was that libproc wasn''t able to resolve symbols in certain mappings which could explain what you''re seeing. What version of Solaris are you running? Adam On Fri, Apr 13, 2007 at 08:41:46AM -0400, Francois Dion wrote:> I got a c++ app, called from sun web server (hence my previous question > of how to instrument a short lived process). I created a framework that > fakes the client/sun web server and executes the application through a > dtrace call with -c so I can use the pid provider. > > I instrumented to get a count of functions. A *lot* of malloc (and the > mutex locking/unlocking associated with that, although this is a single > threaded app, I wish I could use a straight non MT malloc). Anyway, I > then used a count of similar calls: > > pid$target:libc:malloc:entry > { > @[ustack()]=count(); > } > > As the script that runs when calling -c app.cgi > > I found the biggest culprit here: > > app.cgi`malloc > libCrun.so.1`__1c2n6FL_pv_+0x28 > > libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc > ator4Cc___I__getRep6MLL_pnH__rwstdM__string_ref4Ccn0B_n0C____+0x50 > > libCstd.so.1`__1cDstdMbasic_string4Ccn0ALchar_traits4Cc__n0AJalloc > ator4Cc___Hreplace6MLLLc_r1_+0x298 > 0x10003624c > 0x1000f2d7c > 0x1000f1bf4 > 0x1000efc8c > 0x1000efb28 > 0x100099230 > 0x100098034 > 0x10003a5d0 > app.cgi`_start+0x17c > 64785 > > 64K calls on this! Everything else is a low count in comparison. I know > this is unintentional, due to a bug. > > This is a c++ app, compiled with Sun Studio 12 EA1, on a sun blade, as > debug, with symbols, then run on a sun t1000. I also tried with release > mode (and xarch=v9b, xtarget=ultraT1, xchip=ultraT1). Neither were > stripped, but result is the same. How do I get names instead of > addresses on the stack dump? > > nm app.cgi does show the symbol names etc. > > Thanks > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Solaris Kernel Development http://blogs.sun.com/ahl