Mark Wielaard [Sun, 3 May 2009 04:49:02 +0000 (06:49 +0200)]
Don't recurse into DW_AT_declaration subprograms in iterate_over_labels.
Newer gcc (4.4) places more DW_TAG_subprograms with DW_AT_declaration
at call sites. iterate_over_labels should only be concerned about
complete declarations.
* tapsets.cxx (dwflpp::iterate_over_labels): Skip DW_TAG_subprogram
that has attribute DW_AT_declaration.
The syscall testsuite uses embedded "// TEXT" markers in the .c files
to designate expected output, kind of like the "dg-" bunch in the gcc
test suite. Unfortunately, "//" is not a unique prefix to systemtap
tests, and in particular it can occur in the system headers that will
be picked up with the "gcc -E -C ..." invocation in test.tcl.
So let's switch to "//staptest//". test.tcl is also modified to
escape a few more mischevious regexp metacharacters that might sneak
past.
* buildrun.cxx (run_make_cmd, kernel_built_uprobes,
copy_uprobes_symbols, run_pass, make_typequery_umod):
Print strerror after a failed stap_system() if verbose.
David Smith [Thu, 30 Apr 2009 15:20:41 +0000 (10:20 -0500)]
Fixed uaddr tapset function for ppc64 by adding task_pt_regs() definition.
PR10117 fix.
* tapset/context.stp: Added ppc64 task_pt_regs() definition if it dooesn't
already exist.
Josh Stone [Wed, 29 Apr 2009 21:00:21 +0000 (14:00 -0700)]
Use sockaddr instead of timeval in @cast test
Using timeval had problems on big-endian multi-arch platforms (ppc64),
because the user tv_sec used in the @cast didn't match the kernel tv_sec
used to provide a pointer. Hopefully reading from a sockaddr should be
more robust, as that type doesn't appear to need any compat wrappers for
multi-archs.
PR 6930: fix flightrec2.exp to handle filesize correctly
* testsuite/systemtap.base/flightrec2.exp: Use stat instead of ls for checking
file size.
* testsuite/systemtap.base/flightrec2.stp: Increase timer interval for some
architecture on which the minimum interval is more than 1 ms (e.g. xen)
* elaborate.cxx: Early return for mismatched optional probe.
* testsuite/systemtap.base/optionalprobe.exp: New test case.
* testsuite/systemtap.base/optionalprobe.stp: Ditto.
Josh Stone [Mon, 27 Apr 2009 21:38:20 +0000 (14:38 -0700)]
Handle more types of types in declaration_resolve
Instead of just structs and unions, we now also process typedefs, enums,
and base types in iterate_over_globals, so declaration_resolve can find
more variations. This especially useful to let @casts reference typedef
names.
David Smith [Mon, 27 Apr 2009 20:53:21 +0000 (15:53 -0500)]
Fixed itrace on RHEL5 (PR10091).
PR10091 fix.
* runtime/itrace.c: Includes ptrace_compatibility.h.
(usr_itrace_report_quiesce): Corrected return value for original version
of utrace.
* runtime/ptrace_compatibility.h: Defines arch_has_single_step() and
arch_has_block_step() in terms of ARCH_HAS_SINGLE_STEP and
ARCH_HAS_BLOCK_STEP.
Jim Keniston [Fri, 24 Apr 2009 20:46:46 +0000 (13:46 -0700)]
PR5273: uprobes_i386.c instruction table
Resynch uprobes1 2-byte-opcode table with uprobes2 x86. Mostly changes a
bunch of mmx instructions from rejected to accepted.
David Smith [Fri, 24 Apr 2009 17:48:29 +0000 (12:48 -0500)]
Cache and retrieve syscall arguments when needed.
* runtime/task_finder.c (__stp_utrace_task_finder_target_syscall_entry):
New function that caches syscall arguments for mmap(), munmap(), and
mprotect() for use in __stp_utrace_task_finder_target_syscall_exit().
(__stp_utrace_task_finder_target_syscall_exit): Uses cached syscall
argument info when making callbacks.
(stap_start_task_finder): Initializes map subsytem for storing syscall
argument data.
* runtime/task_finder_map.c: New file containing functions to save and
retrieve syscall arguments.
utrace/ia64: Fix syscall_get_set_args_cb() to handle syscalls via syscall()
* runtime/syscall.h (syscall_get_set_args_cb): Fix to decode user stack
collectly in case of syscall(), and check the maximum number of syscall
arguments.
PR 6930: Add testcases for on-file flight recorder
* testsuite/systemtap.base/flightrec1.exp: New test case for background mode.
* testsuite/systemtap.base/flightrec2.exp: New test case for file switching.
* testsuite/systemtap.base/flightrec2.stp: Test script for file switching.
Rajan Arora [Wed, 22 Apr 2009 16:10:37 +0000 (12:10 -0400)]
PR 9941: Add predicate function callback to check for an early abort
* tapsets.cxx: Add dwfl_report_offline_predicate to check pending
interrupts for an early abort.
* tapsets.h: Declare it.
* translate.cxx: Add callback to function call.
Stan Cox [Wed, 22 Apr 2009 15:34:14 +0000 (11:34 -0400)]
Make sdt.h big endian aware.
* sdt.h: Use .quad instead of .long for .probe section addresses.
ia64 and s390 require 'nop 0' and x86 tolerates it.
* tapsets.cxx (build): Fetch probe_name in a big endian friendly fashion.
Mark Wielaard [Wed, 22 Apr 2009 10:53:39 +0000 (12:53 +0200)]
Simplify section size logic.
* translate.cxx (dump_unwindsyms): Just check that dwfl_module_relocations()
return more than 1 relocation section bases before calling
dwfl_module_address_section().
Josh Stone [Wed, 22 Apr 2009 02:57:59 +0000 (19:57 -0700)]
[tracepoints] Resolve implicit trace_X use
Some of the tracepoints are actually being called in inlines in the
common headers (e.g. trace_kmalloc), which is causing errors about
implicit function declarations. We don't care about ever running the
code in the tracequery module, so I'm just suppressing that error.
Josh Stone [Wed, 22 Apr 2009 02:55:47 +0000 (19:55 -0700)]
[tracepoints] Don't use TRACE_HEADER_MULTI_READ
At one point that macro was needed to get all of the tracepoints on the
tip tree, but now it's causing us to get duplicate stapprobe_X
definitions. AFAICS, we're now getting all tracepoints even without
MULTI_READ, so I'm pulling that workaround out.
Josh Stone [Tue, 21 Apr 2009 19:08:42 +0000 (12:08 -0700)]
Refine the @cast-with-header syntax
The special syntax to generate a module for type information is now:
- "kernel<path/to/header.h>" to use the kernel's build environment
- "<path/to/header.h>" to use no special build environment, and so use
gcc's default parameters only (for user mode).
Mark Wielaard [Tue, 21 Apr 2009 19:33:24 +0000 (21:33 +0200)]
Set MAXSTRINGLEN to 133 for uprobes_ustack.exp test on 64 bit.
Needs extra space since on 64bit the last ubacktrace string is
7 entries * (16 hex + 2 for 0x + 1 space) = 133 chars.
Default MAXSTRINGLEN is 128 chars.
Mark Wielaard [Tue, 21 Apr 2009 17:44:55 +0000 (19:44 +0200)]
Add uprobes_ustack testcase and bug fixlet.
* runtime/stack.c (_stp_stack_print): Use _stp_usymbol_print when tsk given.
* testsuite/systemtap.base/uprobes_ustack.exp: New test file.
* testsuite/systemtap.base/uprobes_ustack.stp: Likewise.
Mark Wielaard [Tue, 21 Apr 2009 15:16:51 +0000 (17:16 +0200)]
Add ubacktrace(), print_ustack() and print_ubacktrace().
* runtime/sym.c (_stp_usymbol_print): New function.
* tapset/ucontext-unwind.stp (print_ubacktrace): New tapset function.
(ubacktrace): Likewise.
* tapset/ucontext-symbols.stp (print_ustack): Likewise.
* testsuite/buildok/ustack.stp: New test for above three functions.