This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tapsets/6580] revamp backtrace-related tapset functions


------- Additional Comments From mjw at redhat dot com  2008-09-02 10:14 -------
(In reply to comment #1)
> # Translates an address to a function symbol. Might be expensive
> # so use sparingly in probes, try translating only in end probes.
> function uaddr_symbol:string (uaddr: long) %{ /* pure */
> 	_stp_symbol_snprint(THIS->__retvalue, MAXSTRINGLEN, THIS->uaddr);
> %}
> 
> Can be used with something like the following for a quick and dirty "profiler":
> 
> stap -d /path/to/my-static-binary -e 'probe timer.ms(100) {t = tid(); if (t !=
> 0) { printf("%s:.%d 0x%xd:%s\n", execname(), tid(), uaddr(),
> uaddr_symbol(uaddr())); } }'

Franks pointed out that I should mention that _stp_symbol_snprint() only kind of
works by accident for user space and isn't reliable. I filed bug #6866 (Extend
stp_symbol_snprintf for user space) with some more explanation and a plan for
making it reliable.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |6866


http://sourceware.org/bugzilla/show_bug.cgi?id=6580

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]