Hi All, Is there a way to resolve symbols in dtrace, like the ustack() does, but with my own addresses? I''ve recorded a list of addresses, which are previous PC values (uregs[R_PC]) and I would like to print them as resolved symbols. Is this possible? Thanks, .tiller
On Sun, Feb 03, 2008 at 08:52:04PM -0800, Tiller Beauchamp wrote:> Hi All, > > Is there a way to resolve symbols in dtrace, like the ustack() does, but > with my own addresses? I''ve recorded a list of addresses, which are > previous PC values (uregs[R_PC]) and I would like to print them as resolved > symbols. Is this possible? > > Thanks, > > .tillerusym() traces the string symbol+offset of a given user address. printf("%A") can also be used for formatting user symbols. -Mike -- Mike Shapiro, Solaris Kernel Development. blogs.sun.com/mws/
On Sun, Feb 03, 2008 at 08:52:04PM -0800, Tiller Beauchamp wrote:> Is there a way to resolve symbols in dtrace, like the ustack() does, but > with my own addresses? I''ve recorded a list of addresses, which are > previous PC values (uregs[R_PC]) and I would like to print them as resolved > symbols. Is this possible?Try out the uaddr() action: # dtrace -c date -n ''pid$target::main:entry{ uaddr(0x8062578); }'' dtrace: description ''pid$target::main:entry'' matched 1 probe Sun Feb 3 20:58:03 PST 2008 dtrace: pid 105537 has exited CPU ID FUNCTION:NAME 0 59934 main:entry date`clock_val Unfortunately, the only place this and some other actions and subroutines are "documented" is in dt_open.c: http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/common/dt_open.c#134 Documenting these would be a great way to contribute to the DTrace community. If anyone would like to take a whack at updating the docs, here''s the section where they should be added: http://wikis.sun.com/display/DTrace/Actions+and+Subroutines And here''s some more general information on update the docs: http://opensolaris.org/jive/thread.jspa?messageID=180783𬈯 Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Thank you both. I?ve gone ahead and added uaddr and usym to the wiki. There are some other interesting functions and global variables that I?ve seen used but aren?t documented, such as ucaller and ufunc. .tiller On 2/3/08 9:02 PM, "Adam Leventhal" <ahl at eng.sun.com> wrote:> On Sun, Feb 03, 2008 at 08:52:04PM -0800, Tiller Beauchamp wrote: >> > Is there a way to resolve symbols in dtrace, like the ustack() does, but >> > with my own addresses? I''ve recorded a list of addresses, which are >> > previous PC values (uregs[R_PC]) and I would like to print them as resolved >> > symbols. Is this possible? > > Try out the uaddr() action: > > # dtrace -c date -n ''pid$target::main:entry{ uaddr(0x8062578); }'' > dtrace: description ''pid$target::main:entry'' matched 1 probe > Sun Feb 3 20:58:03 PST 2008 > dtrace: pid 105537 has exited > CPU ID FUNCTION:NAME > 0 59934 main:entry date`clock_val > > Unfortunately, the only place this and some other actions and subroutines > are "documented" is in dt_open.c: > > http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/co > mmon/dt_open.c#134 > > Documenting these would be a great way to contribute to the DTrace community. > If anyone would like to take a whack at updating the docs, here''s the section > where they should be added: > > http://wikis.sun.com/display/DTrace/Actions+and+Subroutines > > And here''s some more general information on update the docs: > > http://opensolaris.org/jive/thread.jspa?messageID=180783? > <http://opensolaris.org/jive/thread.jspa?messageID=180783𬈯> > > Adam > > -- > Adam Leventhal, Fishworks http://blogs.sun.com/ahl > _______________________________________________ > dtrace-discuss mailing list > dtrace-discuss at opensolaris.org >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20080204/d007308e/attachment.html>
Hi Tiller, Thanks for adding that information, but for future reference, the protocol is to send out mail first to this discussion list with your proposed changes. We just want to make sure the information is accurate before it hits the wiki. Adam On Mon, Feb 04, 2008 at 11:00:37AM -0800, Tiller Beauchamp wrote:> Thank you both. I??ve gone ahead and added uaddr and usym to the wiki. > There are some other interesting functions and global variables that I??ve > seen used but aren??t documented, such as ucaller and ufunc. > > .tiller > > On 2/3/08 9:02 PM, "Adam Leventhal" <ahl at eng.sun.com> wrote: > > > On Sun, Feb 03, 2008 at 08:52:04PM -0800, Tiller Beauchamp wrote: > >> > Is there a way to resolve symbols in dtrace, like the ustack() does, but > >> > with my own addresses? I''ve recorded a list of addresses, which are > >> > previous PC values (uregs[R_PC]) and I would like to print them as resolved > >> > symbols. Is this possible? > > > > Try out the uaddr() action: > > > > # dtrace -c date -n ''pid$target::main:entry{ uaddr(0x8062578); }'' > > dtrace: description ''pid$target::main:entry'' matched 1 probe > > Sun Feb 3 20:58:03 PST 2008 > > dtrace: pid 105537 has exited > > CPU ID FUNCTION:NAME > > 0 59934 main:entry date`clock_val > > > > Unfortunately, the only place this and some other actions and subroutines > > are "documented" is in dt_open.c: > > > > http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/co > > mmon/dt_open.c#134 > > > > Documenting these would be a great way to contribute to the DTrace community. > > If anyone would like to take a whack at updating the docs, here''s the section > > where they should be added: > > > > http://wikis.sun.com/display/DTrace/Actions+and+Subroutines > > > > And here''s some more general information on update the docs: > > > > http://opensolaris.org/jive/thread.jspa?messageID=180783?? > > <http://opensolaris.org/jive/thread.jspa?messageID=180783𬈯> > > > > Adam > > > > -- > > Adam Leventhal, Fishworks http://blogs.sun.com/ahl > > _______________________________________________ > > dtrace-discuss mailing list > > dtrace-discuss at opensolaris.org > > > >-- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Actually, this question was discussed when the Wiki was first made available. The resolution was consistent, I think, with the wikis.sun.com policy (http://www.sun.com/aboutsun/media/wiki/policy.html).>From that original discussion thread:"Actually, there''s no need to contact me or anyone: the wiki is open for all registered users to modify. We''ll tighted up security if we have any problems." Thanks again, Tiller, for your contribution! I''m sure that if there are any inaccuracies, other people will jump in to help fix them! Mike -- This message posted from opensolaris.org
On Mon, Feb 04, 2008 at 02:19:44PM -0800, Mike Pogue wrote:> >From that original discussion thread: > > "Actually, there''s no need to contact me or anyone: the wiki is open for all > registered users to modify. We''ll tighted up security if we have any problems."Right: that was in response to Jon''s statement about how one would gain access. For larger contributions we''re asking that individuals submit a draft to the discussion list. Either wait for a thumbs up or for a few days to pass. Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl