Brian Utterback
2008-Aug-25 15:31 UTC
[dtrace-discuss] Finding fully qualified symbol names.
I was trying a trick from the advanced Dtrace presentation and ran into a snag. Specifically, I was trying to do the trick called "Trick: sizeof and profiling". It says this: When used with profile provider, sizeof allows function profiling: profile-1234hz /arg0 >= `clock && arg0 <= `clock + sizeof (`clock)/ { ... } The thing is, I wanted to do the same thing with a user land function. However, no matter what I did, I got an error about the function not being defined. The function in question was in a shared library and when I did a ustack, I got a symbol printed out. I tried the symbol as printed by ustack (which included the version part of the library name) and I tried it without the version, but neither worked. What am I doing wrong? Or is it just not possible to do this for a userland function? -- blu There are two rules in life: Rule 1- Don''t tell people everything you know ---------------------------------------------------------------------- Brian Utterback - Solaris RPE, Sun Microsystems, Inc. Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom
Adam Leventhal
2008-Aug-25 16:49 UTC
[dtrace-discuss] Finding fully qualified symbol names.
Hey Brian, You can''t currently access symbols in a process'' address space. We realize that this is an annoying impediment. You can work around the problem by using mdb(1) to figure out the symbol''s address and size. Adam On Mon, Aug 25, 2008 at 11:31:17AM -0400, Brian Utterback wrote:> I was trying a trick from the advanced Dtrace presentation and ran > into a snag. Specifically, I was trying to do the trick called "Trick: > sizeof and profiling". It says this: > > When used with profile provider, sizeof allows function profiling: > > profile-1234hz > /arg0 >= `clock && > arg0 <= `clock + sizeof (`clock)/ > { > ... > } > > The thing is, I wanted to do the same thing with a user land function. > However, no matter what I did, I got an error about the function not > being defined. The function in question was in a shared library and > when I did a ustack, I got a symbol printed out. I tried the symbol as > printed by ustack (which included the version part of the library > name) and I tried it without the version, but neither worked. > > What am I doing wrong? Or is it just not possible to do this for a > userland function? > -- > blu > > There are two rules in life: > Rule 1- Don''t tell people everything you know > ---------------------------------------------------------------------- > Brian Utterback - Solaris RPE, Sun Microsystems, Inc. > Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl