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.
David Smith [Wed, 11 Aug 2010 19:37:07 +0000 (14:37 -0500)]
Updated stap_get_arch().
* stap-env (stap_get_arch): If we don't have a special renaming rule for
an arch, just use the output of 'uname -m'. Added a comment stating the
code needs to match the code in session.cxx.
* session.cxx (systemtap_session): Added a comment stating the code for
determining the arch needs to match the code in stap_get_arch.
Josh Stone [Tue, 10 Aug 2010 00:22:33 +0000 (17:22 -0700)]
PR11880: Allow function matching on the MIPS_linkage_name
When a function pattern starts with "_Z", we can assume that it is
trying to match the mangled C++ name. Without actually implementing a
mangler ourselves, we can do pretty well using the MIPS_linkage_name.
* dwflpp.cxx (dwflpp::iterate_over_functions): Match _Z patterns against
the MIPS_linkage_name of each function die.
* tapsets.cxx (dwarf_query::query_module_dwarf): As with wildcards,
don't use the query_module_functions for _Z patterns.
(dwarf_query::add_probe_point): For _Z queries, use the linkage name
for the final probe product too.
* testsuite/semok/mangled.stp: Probe mangled names in stap itself.
David Smith [Tue, 10 Aug 2010 19:35:57 +0000 (14:35 -0500)]
BZ607232: Fixed 'service systemtap restart' and added required commands.
* initscript/systemtap.in: Fixed 'restart' by making using local copies of
the $SCRIPTS global variable. Also brought it up to speed with current
Fedora packaging guidelines by adding 'force-reload', 'reload',
'condrestart' and 'try-restart' commands.
Josh Stone [Fri, 6 Aug 2010 17:55:32 +0000 (10:55 -0700)]
Ignore empty files in the cache
Sometimes crashes can leave just-written files at zero length, so we
should be a little paranoid that our cached files are ok. The stapconf
header is especially vulnerable, as it will prevent all scripts from
being compiled if it gets bad.
* util.cxx (get_file_size(int)): Read the size from a file descriptor.
* cache.cxx (get_stapconf_from_cache, get_script_from_cache): Check that
cached files are non-empty before using them.
David Smith [Fri, 30 Jul 2010 19:51:54 +0000 (14:51 -0500)]
nd_syscalls.stp/nd_syscalls2.stp fixups and deprecations. Added testcases.
* tapset/nd_syscalls.stp (nd_syscall.accept): Added a pending deprecation
of 'flag_str'. Added 'flags_str'.
(nd_syscall.dup): Added a pending deprecation of 'old_fd'. Added
'oldfd'.
(nd_syscall.fadvise64): At some point, x86_64 kernels couldn't find
dwarf parameters. But, the nd_syscall tapset doesn't care about dwarf
parameters, so delete the special x86_64 version.
(nd_syscall.fadvise64_64): Ditto.
(nd_syscall.fgetxattr): Added pending deprecation of 'name2' and added
'name_str'.
(nd_syscall.fremovexattr): Ditto.
(nd_syscall.fsetxattr): Ditto.
(nd_syscall.getxattr): Ditto.
(nd_syscall.lremovexattr): Ditto.
(nd_syscall.compat_sys_msgctl): Add convenience variables to match
non-'compat' probe.
(nd_syscall.compat_sys_msgrcv): Ditto.
(nd_syscall.compat_sys_msgsnd): Ditto.
* tapset/nd_syscalls2.stp (nd_syscall.pipe): Added convenience variables
to match 'syscall' probe alias.
(nd_syscall.compat_sys_recvmsg): Ditto.
(nd_syscall.signalfd): Ditto.
(nd_syscall.ustat32): Ditto.
(nd_syscall.compat_pselect7a): Started a pending deprecation of
incorrect 'syscall.compat_pselect7a' probe alias name. Correct name is
'syscall.compat_pselect7'.
(nd_syscall.sched_setaffinity): Removed special x86_64 version.
(nd_syscall.compat_sys_semctl): Make sure it supports the same
variables as the non-compat probe.
(nd_syscall.compat_sys_sendmsg): Ditto.
(nd_syscall.compat_signalfd): Ditto.
* testsuite/buildok/nd_syscalls-all-probes.stp: New testcase.
* testsuite/buildok/nd_syscalls-detailed.stp: Ditto.
* testsuite/buildok/nd_syscalls2-detailed.stp: Ditto.
* testsuite/lib/stap_buildok.exp (buildok_known_failures): KFail the
tests that use nd_syscalls probes on ia64 (PR6971).
* NEWS: Mentioned pending deprecations.
* stap.1: Ditto.
Mark Wielaard [Wed, 28 Jul 2010 11:19:07 +0000 (13:19 +0200)]
Add dieoffset to missing location error messages.
* dwflpp.h (translate_location): Take die as argument.
(find_struct_member): Take dies vector as argument.
* dwflpp.cxx (translate_location): Take die as argument and output dieoffset
in error message.
(find_struct_member): Take dies vector as argument and fill it with the
dies found.
(literal_stmt_for_local): Call translate_location with vardie.
David Smith [Mon, 26 Jul 2010 19:19:32 +0000 (14:19 -0500)]
Many small tapset/syscalls.stp fixups. Deprecate misnamed vars. Added testcase.
* tapset/syscalls.stp (syscall.add_key): Added a pending deprecation of
'description_auddr'. Added 'description_uaddr'.
(syscall.clock_nanosleep): Added 'flags' convenience variable (to go
along with existing 'flag_str' variable).
(syscall.compat_clock_nanosleep): Ditto.
(syscall.fadvise64): At some point, x86_64 kernels couldn't find
parameters, so a special version of this probe was written for x86_64.
Now just uses @defined().
(syscall.fadvise64_64): Ditto.
(syscall.fremovexattr): Add 'name_str' and fix 'argstr'.
(syscall.fgetxattr): Added pending deprecation of 'name2' and added
'name_str'.
(syscall.fsetxattr): Ditto.
(syscall.getxattr): Ditto.
(syscall.lgetxattr): Ditto.
(syscall.lremovexattr): Ditto.
(syscall.futex): Use dwarf variable in comparison instead of convenience
variable (to let convenience variable be optimized away).
(syscall.compat_futex): Ditto.
(syscall.compat_sys_msgctl): Add convenience variables to match
non-'compat' probe.
(syscall.compat_sys_msgrcv): Ditto.
(syscall.compat_sys_msgsnd): Ditto.
* testsuite/buildok/syscalls-detailed.stp: New testcase.
* NEWS: Mentioned pending variable deprecations.
* stap.1: Ditto.