* [Bug tapsets/6580] New: revamp backtrace-related tapset functions
@ 2008-05-29 19:31 fche at redhat dot com
2008-08-20 12:27 ` [Bug tapsets/6580] " fche at redhat dot com
` (5 more replies)
0 siblings, 6 replies; 9+ messages in thread
From: fche at redhat dot com @ 2008-05-29 19:31 UTC (permalink / raw)
To: systemtap
print_stack, backtrace, probefunc, print_backtrace, caller* are
IMO a mess. Let's rationalize them by deprecating these and
adding some new functions:
stack:long (n:long) - return PC at stack unwind level N
ustack:long (n:long) - return PC at user-space stack unwind level N;
useful if kernel-side probe is active
callers:string (n:long) - return stack(0) stack(1) ... stack(n) as a string
ucallers:string (n:long) - return ustack(0) ustack (1) ... ustack(n)
symname:string (addr:long) - return the kernel- or user-space symbol name
for the given address
symdata:string (addr:long) - likewise, adding [module] +offset/size
psyms (callers:string) - print symdata() for all addresses in callers
Backward compatibility:
function backtrace() { return callers (-1) }
function print_stack(s) { psyms (s) }
function print_backtrace() { psyms (callers (-1)) }
function caller_addr() { return stack (1) }
function caller() { return symname (caller_addr()) }
function probefunc() { return symname (stack (0)) }
function probemod() { return substr(symdata (stack (0)), ....) }
--
Summary: revamp backtrace-related tapset functions
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: tapsets
AssignedTo: systemtap at sources dot redhat dot com
ReportedBy: fche at redhat dot com
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
@ 2008-08-20 12:27 ` fche at redhat dot com
2008-09-01 12:33 ` mjw at redhat dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: fche at redhat dot com @ 2008-08-20 12:27 UTC (permalink / raw)
To: systemtap
--
What |Removed |Added
----------------------------------------------------------------------------
BugsThisDependsOn| |5951
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
2008-08-20 12:27 ` [Bug tapsets/6580] " fche at redhat dot com
@ 2008-09-01 12:33 ` mjw at redhat dot com
2008-09-02 10:15 ` mjw at redhat dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: mjw at redhat dot com @ 2008-09-01 12:33 UTC (permalink / raw)
To: systemtap
------- Additional Comments From mjw at redhat dot com 2008-09-01 12:32 -------
caller()/ucaller() can probably be implemented more efficiently than as full
wrappers around the caller(1)/ucaller(1). For example the following currently
works to get a quick user space symbol, without need to do a full unwind (a full
unwind is necessary for getting anything more). If you just want to get the user
address and symbol (for static binaries included with -d only for now):
# Returns the address in userspace that the current task was at when the
# probe occurred.
function uaddr:long () %{ /* pure */
#include <asm/processor.h>
struct pt_regs *uregs;
uregs = task_pt_regs(current);
THIS->__retvalue = (int64_t) REG_IP(uregs);
%}
# 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())); } }'
--
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
2008-08-20 12:27 ` [Bug tapsets/6580] " fche at redhat dot com
2008-09-01 12:33 ` mjw at redhat dot com
@ 2008-09-02 10:15 ` mjw at redhat dot com
2009-03-20 19:33 ` fche at redhat dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: mjw at redhat dot com @ 2008-09-02 10:15 UTC (permalink / raw)
To: systemtap
------- 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
` (2 preceding siblings ...)
2008-09-02 10:15 ` mjw at redhat dot com
@ 2009-03-20 19:33 ` fche at redhat dot com
2009-03-30 11:59 ` mjw at redhat dot com
2010-01-05 9:38 ` mjw at redhat dot com
5 siblings, 0 replies; 9+ messages in thread
From: fche at redhat dot com @ 2009-03-20 19:33 UTC (permalink / raw)
To: systemtap
--
Bug 6580 depends on bug 5951, which changed state.
Bug 5951 Summary: process lifetime/memorymap monitor
http://sourceware.org/bugzilla/show_bug.cgi?id=5951
What |Old Value |New Value
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
` (3 preceding siblings ...)
2009-03-20 19:33 ` fche at redhat dot com
@ 2009-03-30 11:59 ` mjw at redhat dot com
2010-01-05 9:38 ` mjw at redhat dot com
5 siblings, 0 replies; 9+ messages in thread
From: mjw at redhat dot com @ 2009-03-30 11:59 UTC (permalink / raw)
To: systemtap
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|systemtap at sources dot |mjw at redhat dot com
|redhat dot com |
Status|NEW |ASSIGNED
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug tapsets/6580] revamp backtrace-related tapset functions
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
` (4 preceding siblings ...)
2009-03-30 11:59 ` mjw at redhat dot com
@ 2010-01-05 9:38 ` mjw at redhat dot com
5 siblings, 0 replies; 9+ messages in thread
From: mjw at redhat dot com @ 2010-01-05 9:38 UTC (permalink / raw)
To: systemtap
------- Additional Comments From mjw at redhat dot com 2010-01-05 09:38 -------
The split between sym*/backtrace() for kernel side and usym*/ubacktrace() for
user side is confusing. We really should deduce from the probe context which one
the user wants.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|mjw at redhat dot com |systemtap at sources dot
| |redhat dot com
Status|ASSIGNED |NEW
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.
^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <bug-6580-6586@http.sourceware.org/bugzilla/>]
end of thread, other threads:[~2012-05-08 18:45 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-29 19:31 [Bug tapsets/6580] New: revamp backtrace-related tapset functions fche at redhat dot com
2008-08-20 12:27 ` [Bug tapsets/6580] " fche at redhat dot com
2008-09-01 12:33 ` mjw at redhat dot com
2008-09-02 10:15 ` mjw at redhat dot com
2009-03-20 19:33 ` fche at redhat dot com
2009-03-30 11:59 ` mjw at redhat dot com
2010-01-05 9:38 ` mjw at redhat dot com
[not found] <bug-6580-6586@http.sourceware.org/bugzilla/>
2011-09-08 17:11 ` mjw at redhat dot com
2012-05-08 18:45 ` fche at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).