Roland McGrath [Wed, 18 Aug 2010 08:39:45 +0000 (01:39 -0700)]
Clean up test compilations using sys/sdt.h, test new and old variants
* testsuite/sys/sdt.h: New file.
* testsuite/lib/systemtap.exp (sdt_includes): New function.
* testsuite/systemtap.base/const_value.exp: Use [sdt_includes].
* testsuite/systemtap.base/cxxclass.exp: Likewise.
* testsuite/systemtap.base/vta-test.exp: Likewise.
* testsuite/systemtap.exelib/exelib.exp: Likewise.
* testsuite/systemtap.base/sdt.exp: Likewise.
Test new version plus sdt-compat.h v1 and v2 variants.
* testsuite/systemtap.base/sdt_misc.exp: Likewise.
Roland McGrath [Wed, 18 Aug 2010 08:35:40 +0000 (01:35 -0700)]
Make sdt-compat.h play nice with new sys/sdt.h
* sdt-compat.h: Change multiple inclusion protection to _SDT_COMPAT_H.
Omit probe macros if _SYS_SDT_H is defined.
* tapsets.cxx: Include "sys/sdt.h" before "sdt-compat.h".
Roland McGrath [Wed, 18 Aug 2010 06:49:01 +0000 (23:49 -0700)]
Move old sys/sdt.h to sdt-compat.h for translator use
* includes/sys/sdt.h: File renamed to ...
* sdt-compat.h: ... here.
* Makefile.am (noinst_HEADERS): New variable, add it.
* tapset.cxx: Include "sdt-compat.h" instead of "sys/sdt.h".
Roland McGrath [Tue, 17 Aug 2010 20:25:45 +0000 (13:25 -0700)]
Add configury for using .section "?" in sdt.h
* includes/sys/sdt-config.h.in: New file.
* configure.ac: Check for assembler support of .section name,"?".
* configure: Regenerated.
* Makefile.in: Regenerated.
Roland McGrath [Wed, 18 Aug 2010 22:37:22 +0000 (15:37 -0700)]
Test case for DW_OP_GNU_implicit_pointer support
* testsuite/systemtap.base/implicitptr.c: New file.
* testsuite/systemtap.base/implicitptr.stp: New file.
* testsuite/systemtap.base/implicitptr.exp: New file.
Roland McGrath [Tue, 27 Jul 2010 11:55:48 +0000 (04:55 -0700)]
loc2c internal reorganization and DW_OP_GNU_implicit_pointer handling
* loc2c.c (struct location_context): New type.
(struct location): New member context points to that.
Add pointer variant with .type = loc_implicit_pointer.
(alloc_location): Take just context pointer as argument.
(FAIL): Use context pointer.
(new_context): New function.
(translate_constant): New function, broken out of ...
(c_translate_constant): ... here. Call it.
(new_synthetic_loc): Don't take pool argument, origin->context has it.
(lose): Take new argument LEN, overall length of LEXPR.
Don't mention the offset into LEXPR if LEXPR is NULL or I is past LEN.
(translate): Take context argument instead of pool, addrbias.
Handle DW_OP_GNU_implicit_pointer.
(location_from_address): Take context argument instead of pool, fail,
fail_arg, emit_address, dwbias, attr, address, fb_attr, cfa_ops.
(location_from_attr): New function.
(translate_offset): New function, broken out of ...
(location_relative): ... here. Call it.
Take context argument instead of pool, dwbias, attr, address.
(c_translate_location): Use new_context.
(c_translate_argument): Likewise.
(emit_base_fetch): Diagnose for loc_implicit_pointer.
(emit_base_store): Likewise.
(c_translate_addressof, c_translate_array): Likewise.
(discontiguify): Likewise. Take context argument instead of pool.
(c_translate_pointer): Handle loc_implicit_pointer.
(c_translate_array_pointer): Likewise.
(c_emit_location): Likewise.
William Cohen [Wed, 15 Sep 2010 19:57:53 +0000 (15:57 -0400)]
Improved latencytap.stp
This version of latencytap.stp has the following improvements:
-Print out the data sorted on the total time waiting for each cause
-Have a debug flag to print out stack backtraces when there is no cause listed.
This is enabled by compiling latencytap to a module and then using:
staprun latentap.ko debug=1
William Cohen [Tue, 14 Sep 2010 21:39:55 +0000 (17:39 -0400)]
Use decimal output for automatic printing of global aggregates
Previously, the automatic printing of global aggregates was hexidecimal.
Most people find it more convenient to look at this information in decimal
form. Thus, the output is now decimal based. If one really needs or wants
the old behavior a --compatible=1.3 option can be added to the command line.
Stan Cox [Mon, 13 Sep 2010 18:49:45 +0000 (14:49 -0400)]
Use common handler for sdt.h v2/v3 and change sdt.h v2 to use it.
* tapsets.cxx (sdt_query::iterate_over_probe_entries): Replaces get_next_probe.
(sdt_query::handle_query_module): Use it.
(sdt_query::handle_probe_entry): New. Used by sdt.h v2/v3
Dave Brolley [Fri, 10 Sep 2010 18:18:07 +0000 (14:18 -0400)]
PR 11905: Take more care with stap-server config files.
- Config files now have a fixed suffix which avoids collisions with other
stap-server files.
- Config files are now interpreted in order to avoid execution of random
code.
William Cohen [Thu, 9 Sep 2010 16:49:22 +0000 (12:49 -0400)]
Updated latencytap.stp
The updated latencytap.stp uses more portable probe points for the collecting
the data. The script also maps the functions in the traceback to reasons the
sleep. The reasons for the sleeps were mechanically generated from
latencytop-0.5 latencytop.trans file.
Mark Wielaard [Thu, 9 Sep 2010 14:38:53 +0000 (16:38 +0200)]
Validate backtrace addresses.
* runtime/stack-i386.c (_stp_valid_pc_addr): New function.
(_stp_stack_print_fallback): Use it.
(__stp_stack_print): Use it.
* runtime/stack-x86_64.c (_stp_valid_pc_addr): New function.
(_stp_stack_print_fallback): Use it.
(__stp_stack_print): Use it.
* runtime/unwind/i386.h (arch_unw_user_mode): Removed.
* runtime/unwind/x86_64.h (arch_unw_user_mode): Likewise.
Roland McGrath [Mon, 30 Aug 2010 22:43:43 +0000 (15:43 -0700)]
Give staprun/stapio/stap-merge a standalone configure and makefile
* Makefile.am: New file.
* configure.ac: New file.
* Makefile.in: New generated file.
* aclocal.m4: New generated file.
* config.in: New generated file.
* configure: New generated file.
Josh Stone [Thu, 26 Aug 2010 20:32:26 +0000 (13:32 -0700)]
Print a warning for labels outside their scope
Sometimes the compiler may output debuginfo a label PC that's not
actually contained by its lexical scope. When this happens, it's likely
that we won't be able to access any variables. Print a WARNING so the
user knows something is amiss.
* dwflpp.cxx (dwflpp::iterate_over_labels): Print a warning when the
scope doesn't contain the label address.
(dwflpp::inner_die_containing_pc): Return bool indicating if the
address is even contained by the result scope.
* testsuite/systemtap.base/ptridx.stp: Use the right exe path.
* testsuite/systemtap.base/ptridx.exp: Use manual spawn/expect for more
precise matching.
Josh Stone [Thu, 26 Aug 2010 17:07:03 +0000 (10:07 -0700)]
Relax inner_die_containing_pc's initial check
I had a semantic error thrown if the given address wasn't even within
the starting scope, but now I've just made that return right away.
Roland found a case where the compiler had a label in DWARF that was
outside the PC range of the inline that supposedly contained it.
* dwflpp.cxx (dwflpp::inner_die_containing_pc): Return if !die_has_pc.
* testsuite/systemtap.base/ptridx.*: Roland's testcase. It still fails
when the variables lack locations, but at least -L should work now.
Roland McGrath [Thu, 26 Aug 2010 05:57:05 +0000 (22:57 -0700)]
loc2c: Handle arrays of computed values
* loc2c.c (translate_array): New function, broken out of ...
(c_translate_array): ... here. Call it.
(c_translate_array_pointer): Call it.
(translate_array): Accept computed or unavailable value with
constant zero index.
William Cohen [Mon, 23 Aug 2010 19:59:50 +0000 (15:59 -0400)]
Simplify the installation of the needed rpm packages
There was some detail on writing repo files. However, that text is not needed
for rhel-5/6 or fedora. There are already repo files that point on the
location of the debuginfo files.
Dave Brolley [Mon, 9 Aug 2010 19:13:14 +0000 (15:13 -0400)]
PR 11441: Implement resolving/querying of trusted servers (SSL) and trusted signing servers.
- Serial number of server certificate now displayed by --list-servers when available
- Servers now present certificate serial number via avahi in order to assist the user in
identifying trusted servers and signers.
- Resolve servers using dns, avahi and NSS in order to present complete information
Josh Stone [Thu, 19 Aug 2010 22:42:55 +0000 (15:42 -0700)]
List variables from containing scopes too
Now we iterate through the lexical scopes up to but not including the
file level, so we can find variables in containing scopes too. This is
most significant for statement probes to list everything available.
Excluding file-level means that globals aren't listed, but we could
consider a more verbose version to include those too.
* tapsets.cxx (dwarf_derived_probe::saveargs): Iterate through scopes.
Josh Stone [Thu, 19 Aug 2010 21:32:09 +0000 (14:32 -0700)]
Resolve statement scopes lexically instead of by raw PC
When we have a statement PC within a function that we wish to probe,
it's not reliable to use getscopes(PC) for variable scoping. This is
because there may also be inline instances at the PC, and so you can end
up in a different scope altogether.
So now we can traverse the DIEs within a function looking for the
innermost containing the PC, avoiding those nested DIEs which are
actually inlines. This also lets us get rid of the hack that made
function prologues do a PC search, so we should have more reliable
scoping all around.
* dwflpp.cxx (dwflpp::inner_die_containing_pc): New, scan lexical scopes
for the innermost DIE that contains a PC, avoiding inlines.
(dwflpp::iterate_over_labels): Use the above to find the lexical scope
containing the label's address.
* tapsets.cxx (query_srcfile_line): Use the above to find the closest
DIE for each statement probe.
(dwarf_var_expanding_visitor::getscopes): Always call getscopes on the
given scope_die, so we don't have the trouble that a PC search entails.
Josh Stone [Wed, 18 Aug 2010 23:23:29 +0000 (16:23 -0700)]
PR11911: Include in -L vars which are partially available
Mostly this is for aggregate types, like a struct type where we can't
translate $foo, but $foo->bar works just fine. So instead of seeing if
translation works without error, we now look for location info
ourselves. We list all $vars which are present at this address, even
if not "fully" available.
This also adds verbosity on errors, for PR11910.
* tapsets.cxx (dwarf_derived_probe::saveargs): Check for locations
manually instead of trying translation.
* testsuite/semok/bz11911.stp: New test adapted from Roland.
William Cohen [Thu, 19 Aug 2010 19:16:22 +0000 (15:16 -0400)]
Minimize manual white space for <programlisting> and <screen>
Docbook pays attention to the white space in <programlisting> and <screen>
sections. To avoid the additional whitespace in those sections mechanically
went through xml and merged the lines together. The resulting manual is a
couple pages shorter.
David Smith [Tue, 17 Aug 2010 20:47:51 +0000 (15:47 -0500)]
Made arch-specific syscalls probe fixups and deprecations. New testcase.
* tapset/i386/syscalls.stp (syscall.sigaltstack): Deprecated 'ussp'
variable in favor of 'uss_uaddr' (to match other arches).
* tapset/ia64/syscalls.stp(syscall.sigaltstack): Deprecated the
'ss_uaddr'/'oss_uaddr' variables in favor of the
'uss_uaddr'/'uoss_uaddr' variables (to match other arches).
* tapset/powerpc/syscalls.stp (syscall.sysctl32): Deprecated old probe
name 'syscall.compat_sysctl'.
(syscall.sysctl32.return): Deprecated old probe name
'syscall.compat_sysctl.return'.
(syscall.sigaltstack): Added probe.
(syscall.sigaltstack.return): Ditto.
(syscall.sys32_sigaltstack): Added the kernel function
'compat_sys_sigaltstack' for newer kernels.
* tapset/s390/syscalls.stp (syscall.getresgid16): Added convenience
variables to match 'syscall.getresgid'.
(syscall.getresuid16): Added convenience variables to match
'syscall.getresuid'.
(syscall.mmap): Added convienece variables to match other arches.
(syscall.mmap2): Ditto.
(syscall.sigaltstack): Added probe.
(syscall.sigaltstack.return): Ditto.
(syscall.sys32_sigaltstack): Ditto.
(syscall.sys32_sigaltstack.return): Ditto.
* tapset/x86_64/syscalls.stp (syscall.sigaltstack): Deprecated the
'regs_uaddr' variable in favor of 'regs' (since the address isn't a user
address).
(syscall.mmap32): Added convenience variables to match 'syscall.mmap'.
(syscall.pipe32): Added convenience variables to match 'syscall.pipe'.
* testsuite/buildok/testsuite/buildok/syscalls-arch-detailed.stp: New
testcase.
* tapset/aux_syscalls.stp (__ulong): New function.
* testsuite/buildok/aux_syscalls-embedded.stp: Added __ulong() test.
* NEWS: Mentioned pending deprecations.
* stap.1: Ditto.
Josh Stone [Tue, 17 Aug 2010 20:33:38 +0000 (13:33 -0700)]
Simplify dwfl_assert and dwarf_assert
We don't need template or const efforts for a null pointer check -- just
use const void* for all cases. Make the overloaded variants inline
while I'm at it.
Josh Stone [Tue, 17 Aug 2010 19:42:49 +0000 (12:42 -0700)]
Support DWARF4 linkage names
With -gdwarf-4, gcc outputs DW_AT_linkage_name instead of
DW_AT_MIPS_linkage_name. Semantics are unchanged.
* dwarf_wrappers.h (dwarf_linkage_name): New, retrieves the linkage_name
by either the old or new attribute value.
* dwflpp.cxx (dwflpp::iterate_over_functions): Use dwarf_linkage_name.
(dwflpp::vardie_from_symtable): Ditto.
* tapsets.cxx (dwarf_query::add_probe_point): Ditto.