David Smith [Mon, 23 Nov 2009 20:13:38 +0000 (14:13 -0600)]
Fixed tapset reference manual generation.
* doc/SystemTap_Tapset_Reference/Makefile.am: Check for file existence
before doing compare.
* doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated.
* tapset/ioblock.stp: Fixed comment so that docs can be built.
Prerna Saxena [Sun, 22 Nov 2009 18:10:39 +0000 (23:40 +0530)]
Added tracepoint-based probes to block IO and IO scheduler tapsets.
Added testcases for these probes.
Also, modified comments in ioblock.stp so that tapset docmentation can be automatically generated for this tapset.
Josh Stone [Wed, 18 Nov 2009 21:32:22 +0000 (13:32 -0800)]
PR10983: Give preference to tracepoints in trace/events/
In 2.6.32-rc7, there are two power.h tracepoints headers, and only the
one in trace/events/ is valid. In general, we can expect that
trace/events/ has newer headers, so we should search those first.
David Smith [Wed, 18 Nov 2009 18:53:50 +0000 (12:53 -0600)]
PR 10981. Fixed buildok/netdev.stp for RHEL5.
* tapset/networking.stp: Made 'netdev.change_rx_flag' and
'netdev.get_stats' optional, since those functions don't exist on
RHEL5.
* testsuite/buildok/netdev.stp: Ditto.
David Smith [Wed, 18 Nov 2009 17:16:15 +0000 (11:16 -0600)]
Don't kfail buildok/sched_test.stp and buildok/process_test.stp.
* testsuite/systemtap.pass1-4/buildok.exp: On rhel5 and rawhide, the
buildok/sched_test.stp and buildok/process_test.stp tests pass
sucessfully, so there is no reason to kfail them.
David Smith [Wed, 18 Nov 2009 16:59:37 +0000 (10:59 -0600)]
PR 5150. Fixed nfs tapset by making probes optional.
* tapset/nfs_proc.stp: Made 'nfs.proc.read', 'nfs.proc.write', and
'nfs.proc.commit' optional for newer kernels without those functions.
* testsuite/systemtap.pass1-4/buildok.exp: Expect nfs-all-probes.stp to
pass.
David Smith [Tue, 17 Nov 2009 21:40:59 +0000 (15:40 -0600)]
With tapset/aux_syscalls.stp fixes, test twentyseven.stp is not kfail.
* testsuite/systemtap.pass1-4/buildok.exp: Test twentyseven.stp should
pass now.
Mark Wielaard [Tue, 17 Nov 2009 21:20:32 +0000 (22:20 +0100)]
Search other CUs of the module when resolving declarations.
* dwflpp.h (declaration_resolve_other_cus): New method.
(iterate_over_globals): Mark as static and takes a CU to iterate over.
(global_alias_caching_callback_cus): New method.
* dwflpp.cxx (global_alias_caching_callback_cus): New method.
(declaration_resolve_other_cus): New method.
(declaration_resolve): Call iterate_over_globals() with current cu.
Call declaration_resolve_other_cus() when name not found.
(iterate_over_globals): Takes cu_die to iterate over as argument.
Mark Wielaard [Tue, 17 Nov 2009 09:10:31 +0000 (10:10 +0100)]
Remove caching of emit_address for kernel modules and shared libraries.
Caching of the address is only safe for kernel addresses that can never
change. For kernel module or dynamic shared library addresses it isn't
safe to cache the address since they can be unloaded, reloaded or mapped
differently in separate executables.
* dwflpp.cxx (emit_address): Remove static from addr definition for
kernel and dynamic modules.
Mark Wielaard [Tue, 17 Nov 2009 08:24:41 +0000 (09:24 +0100)]
Explain "cheat" comment in sym.c (_stp_tf_mmap_cb).
We are abusing the "first" section address here to indicate where the
module (actually first segment) is loaded (which is why we are ignoring
the offset). It would be good to redesign the stp_module/stp_section
data structures to better align with the actual memory mappings we are
interested in (especially the "section" naming is slightly confusing
since what we really seem to mean are elf segments (which can contain
multiple elf sections).
Mark Wielaard [Mon, 16 Nov 2009 20:41:13 +0000 (21:41 +0100)]
Add testcase for retrieving $global vars from execs and shared libs.
Explicit testcase for PR10010 and PR10622.
* testsuite/systemtap.base/externalvar.c: New file.
* testsuite/systemtap.base/externalvar.exp: New file.
* testsuite/systemtap.base/externalvar.stp: New file.
* testsuite/systemtap.base/externalvar_lib.c: New file.
Mark Wielaard [Mon, 16 Nov 2009 20:34:00 +0000 (21:34 +0100)]
PR10010 Support $globals in shared libraries.
* dwflpp.cxx (dwflpp::emit_address): Enable task finder and emit a
_stp_module_relocate for the ".dynamic" section when seeing a
user-space dso address.
* runtime/sym.c (_stp_mod_sec_lookup): Remove .dynamic section addr cheat.
(_stp_tf_mmap_cb): Add cheat here.
David Smith [Mon, 16 Nov 2009 18:58:46 +0000 (12:58 -0600)]
PR 5150 partial fix. Support nfs_write_begin()/nfs_write_end().
* tapset/nfs.stp: Added support for nfs_write_begin()/nfs_write_end(),
which replaced nfs_prepare_write()/nfs_commit_write().
Mark Wielaard [Mon, 16 Nov 2009 09:02:50 +0000 (10:02 +0100)]
PR10622 Search for extern $variables in symbol table.
* dwflpp.h (vardie_from_symtable): New method.
* dwflpp.cxx (vardie_from_symtable): New method.
(literal_stmt_for_local): Use vardie_from_symtable when no location
attribute and DW_AT_external.
* testsuite/buildok/xtime.stp: New testcase from PR10622.
Mark Wielaard [Fri, 13 Nov 2009 12:39:24 +0000 (13:39 +0100)]
Accept relative user module paths for -d.
When using relative (non-canonical) paths for user modules one would get
a confusing WARNING: missing unwind/symbol data for module 'bin/test'.
Also unless the path started with '/' the task_finder wouldn't start.
By checking that the given file can be made absolute (canonicalized)
both issues are resolved and the user module will be correctly identified
at both translation and runtime.
* main.cxx (main): case 'd' try canonicalize_file_name() the argument
first to identify user modules.
Josh Stone [Wed, 11 Nov 2009 02:37:02 +0000 (18:37 -0800)]
PR5916: Exploit kretprobe data storage area
Since 2.6.25, kretprobes can carry a data packet to be filled in an
entry_handler. This patch lets us store our implicitly-saved $target
variables in .return probes in that data area.
* tapset/kretprobe.stp: New get/set functions for kretprobe data.
* translate.cxx (c_unparser::emit_common_header): Add context->pi_longs.
* tapsets.cxx
(dwarf_var_expanding_visitor::visit_target_symbol_saved_return): Switch
between the old and new methods of saving $vars in .return probes.
(dwarf_var_expanding_visitor::gen_mapped_saved_return): The old way.
(dwarf_var_expanding_visitor::gen_kretprobe_saved_return): The new way.
(dwarf_derived_probe::join_group): Don't register paired entry-handlers.
(dwarf_derived_probe::dwarf_derived_probe): Remember saved-var details.
(dwarf_derived_probe_group::emit_module_decls): Output saved-var details.
Also split the kretprobe handler whether we're on entry or return.
(dwarf_derived_probe_group::emit_module_init): Prepare the entry handler.
* testsuite/systemtap.base/kretprobe-vars.stp: Test implicit $var saving.
Dave Brolley [Mon, 9 Nov 2009 19:50:52 +0000 (14:50 -0500)]
Don't reference global variable modpath in insert_module and its helpers.
This allows insert_module to to be used for loading the signed uprobes.ko
module.
Allow the use of $$parms and $$return in uprobes based probes for
unprivileged users.
Re-add management of module signatures in the cache. Don't know why
it was removed.
Mark Wielaard [Sun, 8 Nov 2009 21:03:31 +0000 (22:03 +0100)]
PR10923 Handle AT_frame_base given by DW_OP_call_frame_cfa in .debug_frame.
dwarf_cfi_addrframe should not be called with pc adjusted to the bias
of the dwfl_module_dwarf_cfi or dwfl_module_eh_cfi. This just happened to
work in the .eh_frame case because bias was always zero.
* dwflpp.cxx (get_cfa_ops): Don't adjust pc for bias.
Josh Stone [Sat, 7 Nov 2009 00:01:10 +0000 (16:01 -0800)]
Constrain $var-checking for -L of .return probes
Normally, using a $var in a return probe create a matching entry probe
to save the value. We don't want all this machinery though when we're
just checking the accessibility of a $var for -L mode.
* tapsets.cxx (dwarf_derived_probe::saveargs): Save/restore has_return
while the $var accesses are attempted.
David Smith [Tue, 3 Nov 2009 17:04:35 +0000 (11:04 -0600)]
PR 10706 fixed by switching to unbuffered output.
* runtime/staprun/mainloop.c (stp_main_loop): Switched to unbuffered
output (instead of line buffered output).
Breno Leitao [Tue, 3 Nov 2009 16:24:03 +0000 (14:24 -0200)]
I forgot to change the NEWS file when commiting 249534c041971db5e9f89cb11b6d38d311e91f57, and this commit
just adds a line in the NEWS file explaining the commmit above
David Smith [Mon, 2 Nov 2009 18:51:12 +0000 (12:51 -0600)]
PR 6691 fixed by adding support for sys_accept4.
* tapset/aux_syscalls.stp(_sock_type_str): Rewrote in embedded-C and added
socket flags support.
(_sock_flags_str): New function.
* tapset/syscalls.stp: syscall.accept prefers to use sys_accept4 when it
exists. Added support for sys_accept4's 'flag' parameter.
* testsuite/systemtap.syscall/net1.c (main): Updated regular expression to
handle the new 'flags' argument.
Frank Ch. Eigler [Sat, 31 Oct 2009 17:54:41 +0000 (13:54 -0400)]
reorganize app tests; rewrite tcl as sample of improvements
* testsuite/configure.ac (--enable-testapps): New option.
* testsuite/Makefile.am (TESTAPPS): Pass to dejagnu.
* testsuite/systemtap.base/{xulrunner,tcl,mysql,postgres}:
Moved under new systemtap.apps/ subdirectory.
* testsuite/systemtap.apps/stap-tcl.sh: New file to build tcl.
* testsuite/systemtap.apps/stap-tcl.stp: New file to test tcl.
* testsuite/systemtap.apps/tcl.exp: New simplified test driver.
* dtrace.in: Disable STAP_HAS_SEMAPHORES as they don't work on shlibs yet.
* includes/sys/sdt.h (STAP_SEMAPHORE): Include __builtin_expect for unlikely.
David Smith [Thu, 29 Oct 2009 21:12:18 +0000 (16:12 -0500)]
Fix syscall testsuite bugs.
* testsuite/systemtap.syscall/test.tcl: Substitute '[[[[' and ']]]]' for
'(' and ')'. This allows us to get unquoted parens.
* testsuite/systemtap.syscall/test-debug.tcl: Matches substitute logic of
test.tcl.
* testsuite/systemtap.syscall/README: Document '[[[[' and ']]]]'.
* testsuite/systemtap.syscall/chmod.c: Handle optional O_LARGEFILE flag in
open calls.
* testsuite/systemtap.syscall/dir.c: Ditto.
* testsuite/systemtap.syscall/mmap.c: Ditto.
* testsuite/systemtap.syscall/openclose.c: Ditto.
* testsuite/systemtap.syscall/readwrite.c: Ditto.
* testsuite/systemtap.syscall/stat.c: Ditto.