Mark Wielaard [Sun, 10 May 2009 18:24:40 +0000 (20:24 +0200)]
Get .probes section through dwarf debuginfo file if necessary.
* tapsets.cxx (dwarf_builder::build): Add some comments, verbose log
messages and get Elf through dwarf_getelf if it exists before searching
for .probes section.
Josh Stone [Sat, 9 May 2009 02:30:42 +0000 (19:30 -0700)]
Allow @cast failures to get optimized away
We have the saved_conversion_error field, but I wasn't using it. Now
@cast errors are saved in that field, so they're only seen if the
optimizer doesn't remove the @cast.
Josh Stone [Sat, 9 May 2009 01:32:17 +0000 (18:32 -0700)]
PR10054: Unify the translate_components errors
Since translate_components is the one that knows the details of its
failures, it makes more sense to let it throw its own errors, instead of
relying on each caller to do it. The function now always either returns
successfully or throws an error.
Josh Stone [Sat, 9 May 2009 00:50:28 +0000 (17:50 -0700)]
Refactor anonymous lookups in translate_components
The previous code recursed the entirety of translate_components, and
it seemed to be restarting the components list every time, so it would
only work if the anonymous portion was the first component. Even then,
examining the code output by semok/thirtythree revealed that it wasn't
fully translating the locations when multiple anonymous pieces were
involved.
Instead, it now recurses in a separate function, find_struct_member,
which does just enough to find the member die and return. It also
builds a vector of the locations passed through, so translate_components
can output code for the full chain of anonymity.
The generated code for semok/thirtythree's $page->mapping now appears to
match the offsets from my manual inspection of struct page. I also
added a test for $page->first_page->mapping, which works now but would
segfault the old code.
Josh Stone [Fri, 8 May 2009 19:40:43 +0000 (12:40 -0700)]
Simplify buildok/context_test.stp
The test was using optional probes on uptime_read_proc, which doesn't
exist anymore on 2.6.30. The problem is that when those optional probes
are skipped, the test doesn't really do anything.
For a buildok test of the context functions, the actual probe point
doesn't matter, so I've changed it to just a begin probe that calls all
of the functions.
Mark Wielaard [Fri, 8 May 2009 08:30:41 +0000 (10:30 +0200)]
Search for only under $(SRCDIR)/tapsets for tapsets.xml and cleanup.
* doc/SystemTap_Tapset_Reference/Makefile.am (tapsets.xml): Only search
under $(SRCDIR)/tapsets for .stp files. Cleanup tapsets.xml.new.
* doc/SystemTap_Tapset_Reference/Makefile.in: Regenerated.
Josh Stone [Fri, 8 May 2009 02:06:52 +0000 (19:06 -0700)]
Merge branch 'tapsets-cleanup'
This merge splits some of the built-in tapsets into their own files, so
we can better maintain clean interfaces. Still TODO are the dwarf-
dependent tapsets though, because that's a much bigger mess to untangle.
Josh Stone [Wed, 6 May 2009 23:43:51 +0000 (16:43 -0700)]
Separate built-in timer tapsets
All of the timer.* tapsets are now built and handled in their own
tapset-timers.cxx, as the first step of many to pare down the current
monolithic tapsets.cxx.
Wenji Huang [Tue, 5 May 2009 23:26:38 +0000 (19:26 -0400)]
PR10102: tolerate the failure related to optional probe
This patch will make stap silently accept the
failure related to optional probe. It puts try/catch
around find_and_build which can cover most probe types.
The specific treatment for dwarf_derived_probe in
commit ed82b7c902d6a2e26452ec51c9cdb9665dbf9e97 is
reverted.
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.