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.
Dave Brolley [Wed, 21 Jul 2010 18:44:27 +0000 (14:44 -0400)]
PR 11441, PR 10772: Support specified servers on --use-server option to stap.
Implement the direct specification of servers by hostname/ip address with an
(optionally) port in the integrated compile-server client, as implemented by
stap-client.
William Cohen [Fri, 23 Jul 2010 15:45:21 +0000 (11:45 -0400)]
Make the beginner's guide use the iotime.stp example
In effort to clean out the extras directory in systemtap beginner's guide
use the existing iotime.stp example in the examples rather than a local
version in the extras directory.
William Cohen [Thu, 22 Jul 2010 21:35:31 +0000 (17:35 -0400)]
Use the para-callgraph.stp example in the examples in the beginner's guide
Use the tested examples rather than extras scripts where possible. So in this
case use the para-callgraph.stp example which has the same functionality as
para-callgraph-simple.stp.
William Cohen [Thu, 22 Jul 2010 20:47:58 +0000 (16:47 -0400)]
Move inodewatch.stp into the examples
Originally inodewatch.stp was in the beginner guide's extras directory.
Moving inodewatch.stp into the examples directory to get regular testing
of the script.
Mark Wielaard [Wed, 21 Jul 2010 20:24:33 +0000 (22:24 +0200)]
Extend vta-test.exp testcase for PR11825 and add 32-on-64 for fun.
* testsuite/systemtap.base/vta-test.c: Provide constants through struct.
* testsuite/systemtap.base/vta-test.exp: Build/Test also for 32-on-64 if
available.
* testsuite/systemtap.base/vta-test.stp: Take program under probe as @1.
Mark Wielaard [Wed, 21 Jul 2010 13:59:27 +0000 (15:59 +0200)]
rhbz#616040 loc2c deref on 32bit address fails.
* runtime/loc2c-runtime.h (deref): For __x86_64__ case cast address to
(unsigned long) everywhere in case we got a 32 bit address of a 32-on-64
but process.
Josh Stone [Tue, 20 Jul 2010 22:10:29 +0000 (15:10 -0700)]
Make sure Dwarf_Ops don't have garbage
We synthesize a Dwarf_Op in a couple of places, but we were only setting
the fields we care about, ".atom" and ".number". The garbage in
".number2" would survive into "DWARF expression:" comment in loc2c,
which made it look unique and subverted caching.
Josh Stone [Tue, 20 Jul 2010 21:06:10 +0000 (14:06 -0700)]
Update bkl examples with newer syntax
* testsuite/systemtap.examples/locks/bkl.stp: Use '!' to alternate
kernel probepoints between lock_kernel and _lock_kernel (and unlock).
* testsuite/systemtap.examples/locks/bkl_stats.stp: Ditto, and use
@entry to get timestamps.
Merge branch 'master' of git://sources.redhat.com/git/systemtap
* 'master' of git://sources.redhat.com/git/systemtap:
* tapset/syscalls2.stp: Started a pending deprecation of incorrect 'syscall.compat_pselect7a' probe alias name. Correct name is 'syscall.compat_pselect7'. * testsuite/buildok/syscalls2-detailed.stp: Checks for correct probe alias name. * NEWS: Mentioned 'syscall.compat_pselect7a' deprecation. * stap.1: Ditto. * HACKING: Updated deprecation description.
Many small tapset/syscalls2.stp fixups. Added testcase.
Fix spurios testcase failure from systemtap.examples/network/socktop.
added the procfs.umask(UMASK) feature to the NEWS file.
* tapsets.cxx (sdt_uprobe_var_expanding_visitor ctor): Use %-adorned
register names. Accept other architectures.
(visit_target_symbol): Rewrite regexp matching / parsing. Fall back to
DWARF in case of parse failure.
* testsuite/systemtap.base/cxxclass.exp: Use -w to suppress dwarf warning.
* util.cxx (regexp_match): New function.
* util.h: Declare it.
David Smith [Mon, 19 Jul 2010 21:44:20 +0000 (16:44 -0500)]
* tapset/syscalls2.stp: Started a pending deprecation of incorrect
'syscall.compat_pselect7a' probe alias name. Correct name is
'syscall.compat_pselect7'.
* testsuite/buildok/syscalls2-detailed.stp: Checks for correct probe alias
name.
* NEWS: Mentioned 'syscall.compat_pselect7a' deprecation.
* stap.1: Ditto.
* HACKING: Updated deprecation description.
David Smith [Mon, 19 Jul 2010 21:19:49 +0000 (16:19 -0500)]
Many small tapset/syscalls2.stp fixups. Added testcase.
* tapset/syscalls2.stp (syscall.compat_sys_recvmsg): Make sure it supports
the same variables as the non-compat probe.
(syscall.compat_sys_semctl): Ditto.
(syscall.compat_sys_sendmsg): Ditto.
(syscall.sched_setaffinity): At some point, x86_64 kernels couldn't
find $len, so a special version of this probe was written for it. Now
just uses @defined().
(syscall.compat_signalfd): Prefers compat_sys_signalfd4 over
compat_sys_signalfd.
(syscall.ustat32): Merged the 2 probes into 1.
* testsuite/buildok/syscalls2-detailed.stp: New testcase.
David Smith [Wed, 14 Jul 2010 15:33:01 +0000 (10:33 -0500)]
Minor timestamp.stp/timestap_gtod.stp/ucontext.stp buildok test improvements.
* testsuite/buildok/timestamp-embedded.stp: Renamed from
buildok/timestamp.stp. Only covers function from timestamp.stp.
* testsuite/buildok/timestamp_gtod-embedded.stp: New testcase.
* testsuite/buildok/ucontext-embedded.stp: Renamed from ucontext.stp
Josh Stone [Tue, 13 Jul 2010 17:25:48 +0000 (10:25 -0700)]
Allow pretty-printing with partial availability
Especially with local structs, DWARF may only have parts of a variable
available at runtime. This change lets us print '?' for inaccessible
parts, so we can still print the parts we do have.
* tapsets.cxx (dwarf_pretty_print::push_deref): New, try a deref and
push a '?' instead if it fails.
(dwarf_pretty_print::recurse): Use push_deref instead of deref.
(dwarf_pretty_print::recurse_base): Ditto.
(dwarf_pretty_print::recurse_pointer): Ditto.
(dwarf_pretty_print::print_chars): Ditto.
Roland McGrath [Tue, 13 Jul 2010 02:40:15 +0000 (19:40 -0700)]
PR11809: loc2c: handle empty pieces
* loc2c.c (struct location): Add new type loc_unavailable.
(translate): Generate that for an empty DW_OP_piece.
(location_relative): Handle it.
(c_translate_location, c_translate_addressof): Likewise.
(c_translate_array, emit_base_fetch, emit_base_store): Likewise.
Josh Stone [Mon, 12 Jul 2010 22:05:40 +0000 (15:05 -0700)]
Anchor bz10078.exp's regexp patterns
If we are unlucky in buffering, then the test output could be read
into expect as a single buffer. Then one of our regexps could match the
end of the buffer and consume the whole thing, even if we also wanted to
match something earlier in the buffer.
The solution is to anchor the patterns to the beginning of the buffer
with '^', so we're sure to match everything we can.
Josh Stone [Mon, 12 Jul 2010 21:51:10 +0000 (14:51 -0700)]
Better catch server errors in the testsuite
If "avahi-browse ... | grep ..." doesn't find anything, like when a
firewall blocks the way, we should catch that gracefully. Use tcl's
"catch" instead of "set" for this.
* testsuite/lib/systemtap.exp (setup_server): Catch avahi-browse|grep
when it falls.
David Smith [Mon, 12 Jul 2010 20:28:26 +0000 (15:28 -0500)]
Minor task_time.stp and tcpmib.stp buildok test improvements.
* testsuite/buildok/task_time-embedded.stp: Added missing function.
* testsuite/buildok/tcpmib-all-probes.stp: Moved function tests to
tcpmib-embedded.stp.
* testsuite/buildok/tcpmib-embedded.stp: New test.
Josh Stone [Mon, 12 Jul 2010 20:01:51 +0000 (13:01 -0700)]
Add all the weirdness to compat-%p
I thought the old %p behavior was as simple as %#.8x or %#.16x, but it
was even weirder than that, as the ptr.exp test reveals. The compat
path is now able to pass that test, and a new test makes sure of the new
code behaves as expected too.
* runtime/vsprintf.c (_stp_vsnprintf): compat-%p is better preserved.
* testsuite/systemtap.printf/ptr.exp -> ptr-1.2.exp: Keep as a compat
test, and add a check that %.Np precision is ignored.
* testsuite/systemtap.printf/ptr-1.3.exp: New, make sure that %p really
does act like %#x now, with various field_width.precision combos.
Mark Wielaard [Fri, 9 Jul 2010 21:33:48 +0000 (23:33 +0200)]
Keep track of name, not dentry, in vma tracker.
Now even the vdso has a module name.
* runtime/task_finder_vma.c (__stp_tf_vma_entry): Remove dentry, add name.
(stap_add_vma_map_info): Take and store name argument, not dentry.
(stap_find_vma_map_info): Likewise.
(stap_find_vma_map_info_user): Likewise.
* runtime/sym.c (_stp_umod_lookup): Lookup name directly with
stap_find_vma_map_info.
* runtime/vma.c (_stp_vma_match_vdso): Pass "vdso" as name.
(_stp_vma_mmap_cb): Extract and store name from dentry.
David Smith [Fri, 9 Jul 2010 19:19:48 +0000 (14:19 -0500)]
Improvements to the scsi tapset and build testcases.
* tapset/scsi.stp: Added missing convenience variable documentation.
* testsuite/buildok/scsi-detailed.stp: Renamed from buildok/scsi.stp and
updated with the rest of the convenience variables.
* testsuite/buildok/scsi-embedded.stp: Updated with the rest of the
functions.
Mark Wielaard [Fri, 9 Jul 2010 16:02:33 +0000 (18:02 +0200)]
PR10080 Add vdso tracking (x86).
The translator will now pick up all the possible vdso.so files (luckily
they are small). At runtime when the task finder notifies us of a new
process we will check against the build id an add the vdso to the vma map.
* translate.cxx (find_vdso): New function.
(add_unwindsym_vdso): Likewise.
(emit_symbol_data): If vma tracker enabled call add_unwindsym_vdso.
* buildrun.cxx (compile_pass): Check STAPCONF_MM_CONTEXT_VDSO.
* runtime/autoconf-mm-context-vdso.c: New test.
* runtime/vma.c (_stp_vma_match_vdso): New function.
(_stp_vma_exec_cb): Call _stp_vma_match_vdso when register_p && process_p.
Josh Stone [Fri, 9 Jul 2010 00:09:20 +0000 (17:09 -0700)]
PR11785: Fix pretty-printing for tracepoint base types
We need slightly special code to deal with tracepoint base types, which
should not be dereferenced at all, but just used as-is.
* tapsets.cxx (dwarf_pretty_print): Add deref_p, which is usually true,
but is false for tracepoints if "pointer" is really a direct value.
(dwarf_pretty_print::deref): Copy the value directly if !deref_p.
(dwarf_pretty_print::recurse_pointer): Detect void pointees more
reliably, e.g. in case of a const node with no type -> const void.
(dwarf_cast_query::handle_query_module): @cast always has deref_p.
(tracepoint_var_expanding_visitor::visit_target_symbol_arg): Permit
pretty-printing on !isptr args, and use that to set deref_p.
(tracepoint_derived_probe::resolve_tracepoint_arg_type): Check
pointers more carefully for a pointee type, again for const void.
William Cohen [Thu, 8 Jul 2010 22:50:15 +0000 (18:50 -0400)]
Adjust systemtap.example checks for the current behavior of "stap -l ..."
The -l option only return an error if no matches are found. A number of
the tests would falsely pass because some of the probe points would match.
The tests need to check each probe point individually to avoid missing a
needed probe point.