This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Probe on function entry rather than the end of the prolog (s390x only)
- From: David Wilder <dwilder at us dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Wed, 31 Jan 2007 17:59:23 -0800
- Subject: Probe on function entry rather than the end of the prolog (s390x only)
I been looking into a problem on s390x that is prevalent when testing
syscall tapset. The problem is that stap can not locate the location of
the 5th argument to functions we are placing probes on.
The root of the problem is that the dwarf location information is may
not be available for function arguments at the address stap is
identifying as the end of the function prolog. The S390x API
specifies that arguments are passed in the registers, when using -o0
all parameters are stored on the stack in the function prolog and the
debug information points to the stack slots. With optimization GCC
removes these stores and it is mandatory to use the location lists to
find a parameter. Unfortunately with optimization turned on it is not
possible anymore to to tell where the function prolog is finished and
the function body starts since gcc may intermixes the prolog and the
function body. (thanks to Andreas Kerbbel for the above information).
However; the debug information to identify all the arguments at the
function entry point looks to be correct. Identifying the correct
register for each argument. This patch sets the probes point at the
function entry point rather than the end of the prolog to correct this
issue (for s390x only) Note: I just piggy backed on a similar change
that was made for the ia64.
Comments?
--
David Wilder
IBM Linux Technology Center
Beaverton, Oregon, USA
dwilder@us.ibm.com
(503)578-3789
--- tapsets.cxx.orig 2007-01-31 13:22:50.000000000 -0800
+++ tapsets.cxx 2007-01-31 14:12:48.000000000 -0800
@@ -2413,9 +2413,9 @@
}
else
{
-#ifdef __ia64__
- // In IA64 platform function probe point is set at its
- // entry point rather than prologue end pointer
+#if defined (__ia64__) || defined (__s390x__)
+ // On IA64 and s390x platforms function probe point is set at its
+ // entry point rather than prologue end pointer.
query_statement (fi.name, fi.decl_file, fi.decl_line,
&fi.die, entrypc, q);