Josh Stone [Thu, 2 Apr 2009 00:01:53 +0000 (17:01 -0700)]
Move testcase itrace3's warning into expect
As it was, the ATTENTION was causing expect mismatches even when the
test worked fine. The warning is served just as well from the expect
script before starting the test.
Maynard Johnson [Wed, 1 Apr 2009 16:22:53 +0000 (11:22 -0500)]
Add insn.block testcase to itrace.exp in testsuite
Earlier today, I posted a runtime patch for the insn.block probe point.
Once that patch is committed, the insn.block probe can be safely tested
on any architecture. The attached patch adds such a testcase to the
testsuite.
Maynard Johnson [Wed, 1 Apr 2009 14:51:57 +0000 (09:51 -0500)]
Fix runtime/itrace.c to call arch_has_*_step() prior to calling utrace_control
As Roland pointed out in his Mar 31 reply to a posting of mine (subject:
Re: Testing insn.block probe point uncovers possible utrace bug),
utrace_control() documents that the caller must ensure that
arch_has_single_step and arch_has_block_step are defined before trying
to use those step modes. The attached patch addresses that issue. I've
tested this patch on x86_64 arch, and a block step test runs
successfully, since block step is supported on that arch. Testing on
ppc64 arch, the test fails as expected (since block step is not
supported on ppc64 yet) with:
"ERROR: callback for <pid> failed: 1"
which is sent to stdderr and
"usr_itrace_init: arch does not support block step mode"
which is sent to the system log.
This isn't the most user-friendly way of surfacing an error. Perhaps
the stap runtime could have a set of defined return codes that would be
mapped to strings so the user can get an idea of what the error is
without looking in the system log. But that's a side issue, of course.
Josh Stone [Wed, 1 Apr 2009 21:49:12 +0000 (14:49 -0700)]
PR10016: Purge stap of all pgrp and system() usage
We hereby no longer try to manipulate process groups in any way. We
don't set a private process group, and we never kill() our entire group
either. Instead of using system(), we now have a stap_system() which
saves the child PID, so when we get a terminating signal we can pass it
along to the child.
Signals sent through the TTY have always worked, since the TTY sends it
to the entire pgrp. However, if we're running as part of a wrapper
script or GUI, which may not have a separate process group for stap, we
still would like to allow "kill -TERM $STAPPID" to terminate stap
nicely.
There's still a short window of failure in the time that staprun is
active, because we can't kill a setuid process from a user process.
Once staprun drops privileges and execs to stapio though, everything
should work fine.
The new code uses a %( kernel_v < "2.6.29" %) conditional to look at
the passed pt_regs instead of named *bx parameters. A more general
solution will be needed at some point.
Mark Wielaard [Wed, 1 Apr 2009 20:40:04 +0000 (22:40 +0200)]
Wrap vma callbacks in STP_NEED_VMA_TRACKER.
Will be defined by new ucontext symbol stapset.
* tapset.cxx: Wrap all vma callbacks in STP_NEED_VMA_TRACKER.
* testsuite/systemtap.context/usymbols.exp: Define STP_NEED_VMA_TRACKER
explicitly for now.
Stan Cox [Tue, 31 Mar 2009 15:54:26 +0000 (11:54 -0400)]
Customize .mark -l output.
* tapsets.cxx (dwarf_builder::build): Add .mark name wildcard check.
Customize -l handling.
* testsuite/systemtap.base/static_uprobes.exp: Test .mark name wildcard.
Mark Wielaard [Tue, 31 Mar 2009 10:15:09 +0000 (12:15 +0200)]
PR10016: Run stap in its own process group with waiter process for signals.
* main.cxx (runner): New main function.
(waiter_handler): Signal handler for waiter process.
(waiter): Waiter process waitpid function.
(main): Fork and run wait and runner in their own processes.
Stan Cox [Mon, 30 Mar 2009 14:23:27 +0000 (10:23 -0400)]
Test marker probe parameter types.
* testsuite/systemtap.base/sdt_types.c: New file.
* testsuite/systemtap.base/sdt_types.stp: New file.
* testsuite/systemtap.base/static_uprobes.exp: Use sdt_types for type testing.
Frank Ch. Eigler [Fri, 27 Mar 2009 15:54:42 +0000 (11:54 -0400)]
PR10000: emit _stp_relocate* calculations correctly for kernel/module global $data
* translate.cxx (dump_unwindsyms): Also emit STT_OBJECT symbols,
therefore .data etc. sections into stap-symbols.h.
* tapsets.cxx (iterate_over_modules): Omit a dwfl_getmodules()
RC-checking assertion that blocked meaningful $context var
error messages.
(dwflpp::emit_address): Bypass dwfl_module_relocate_address()
for kernel symbols as it has been unreliable; subtract sess.sym_stext
manually.
* testsuite/buildok/seventeen.stp: Extend test with module $global.
Josh Stone [Thu, 26 Mar 2009 21:09:43 +0000 (14:09 -0700)]
Skip the git-rev in the hash for now (from a5e8d632)
It may be potentially expensive to fork-exec a git call to get the HEAD
revision, and it's not clear whether it's even needed. We can always
throw this back on if we find a meaningful usage scenario.
Josh Stone [Thu, 26 Mar 2009 16:20:16 +0000 (09:20 -0700)]
PR10001: Use the kernel's strlcpy & strlcat
We had our own implementations of these which were triggering gcc
bug38480 in some particular cases. It's easier for us to use the
kernel's strlcpy and strlcat anyway, which avoids the bug.
Josh Stone [Wed, 25 Mar 2009 22:47:21 +0000 (15:47 -0700)]
Add more file stats to the hash
For kernel developers, it may be common practice to reuse the same
kernel build tree for several kernel variants. Our previous hashing
only considered the release version, architecture, and build path, which
may all remain constant for such a developer.
This change adds the file size and mtime of several kernel version files
to the hash, so it should be a bit more robust against collisions.
Rajan Arora [Wed, 25 Mar 2009 02:30:37 +0000 (22:30 -0400)]
PR 9922 fix, make --disable-pie the configure default
*configure.ac: Change the default to compiling without fPIE.
*systemtap.spec: Add --enable-pie as the default option (set
pie_supported to 1).
*configure: Regenerated with autoconf 2.61.
Mark Wielaard [Tue, 24 Mar 2009 20:37:30 +0000 (21:37 +0100)]
Add testcase for uprobe on shared library (PR9940).
* testsuite/systemtap.base/uprobes_exe.c: New file.
* testsuite/systemtap.base/uprobes_lib.c: New file.
* testsuite/systemtap.base/uprobes_lib.exp: New file.
* testsuite/systemtap.base/uprobes_lib.stp: New file.
David Smith [Tue, 24 Mar 2009 19:43:08 +0000 (14:43 -0500)]
PR 9989 fix.
2009-03-24 David Smith <dsmith@redhat.com>
PR 9989.
* runtime/task_finder.c (stap_utrace_detach): Ignores
-EINPROGRESS.
(stap_utrace_detach_ops): Ignores errors from
stap_utrace_detach(), so that other tasks will get detached from
this utrace engine.
(__stp_utrace_attach): Better error handling from
utrace_barrier().
(__stp_utrace_task_finder_target_quiesce): Ditto.
Frank Ch. Eigler [Tue, 24 Mar 2009 16:53:17 +0000 (12:53 -0400)]
PR9993: tracepoint toleration for undeclared types in trace/*.h headers
* tapsets.cxx (tracepoint_extra_headers): New function to return
needed header file names.
(emit_module_decls): Emit them.
* buildrun.cxx (make_tracequery): Emit them.
* testsuite/systemtap.base/tracepoints.exp: Rewrite to exercise
building each tracepoint.
Stan Cox [Tue, 24 Mar 2009 16:40:05 +0000 (12:40 -0400)]
Keep static probe parameters visible while inlining.
* includes/sys/sdt.h (STAP_PROBEN): Revive the STAP_LABEL macro to
prevent inlining to keep probe parameters visible. Use +rm
constraints.
* tapsets.cxx (build): Use .probes section for all uses of static
probes.
Stan Cox [Mon, 23 Mar 2009 14:10:03 +0000 (10:10 -0400)]
Make .probes 32 bit aware and simplify label handling.
* includes/sys/sdt.h (STAP_PROBE_DATA_): Use gas local labels which
avoids a mysql problem when a function containing a probe is inlined.
Make the data placement 32 bit aware.
Frank Ch. Eigler [Sat, 21 Mar 2009 12:39:57 +0000 (08:39 -0400)]
sdt.exp: save intermediate sdt.h-client executables for analysis
* testsuite/lib/stap_run2.exp (stap_run3): Put supplied stap
extra arguments after the .stp script name, not before, so
that @1/such arguments can be substituted within.
Josh Stone [Fri, 20 Mar 2009 23:35:06 +0000 (16:35 -0700)]
Cache the tracepoint query results
To use tracepoints, we build a "tracequery" module that compiles
debuginfo for all available tracepoints in the user's kernel. That's a
bit of a cumbersome step to do during pass-2 though. This change adds
tracequery caching so we only need to compile it once.
Stan Cox [Fri, 20 Mar 2009 20:30:19 +0000 (16:30 -0400)]
Define static user probe point using asm instead of c.
* includes/sys/sdt.h (STAP_PROBE_DATA): New. Define the probe point
using asm instead of c.
(STAP_PROBEN): Use it.
* testsuite/systemtap.base/sdt.exp: Continue if a compile fails.
* testsuite/systemtap.base/static_uprobes.exp: Don't test setting
probe without .probes section.
Frank Ch. Eigler [Fri, 20 Mar 2009 20:30:02 +0000 (16:30 -0400)]
PR9967: don't count -DINTERRUPTIBLE=1 reentrancy against MAXSKIPPED
* tapsets.cxx (common_probe_entryfn_prologue): Become conditional on
!INTERRUPTIBLE.
* translate.cxx (emit_module_exit): Still print skipped_count_reentrant
with -t, even if skipped_count was zero.
Add on-file flight recorder options (the combination of -F and -o,
and -S option) to stap command, and change manpages and NEWS.
- Both of -F and -o is specified, stap passes -D option to staprun.
- stap just passes -S option to staprun.
Masami Hiramatsu [Fri, 20 Mar 2009 16:11:30 +0000 (12:11 -0400)]
PR6930: stapio: support file switching
Add file-switching option(-S size[,N]) to stapio. This option has two
arguments, 'size' and 'N', and requires -o option.
- When the size of output file exceeds specified 'size'MB, staprun switches
output file to the next file. For this purpose, all output file has a serial
number as a suffix only when user specifies this option.
- Using this option in bulk mode, the output file name will be
'FILE_cpuX.SERIAL'.
- When the number of files exceeds specified N, staprun removes the oldest
file. This argument can be omitted.
Masami Hiramatsu [Fri, 20 Mar 2009 15:59:06 +0000 (11:59 -0400)]
PR6930: stapio: run in background as a daemon
Add '-D'(daemon mode) option to staprun/stapio for daemon mode.
In this mode, stapio shows just its pid and detachs from console.
Since it has no stdio, this mode requires -o option. stapio will
exit when it receives SIGTERM or detects some error.
Mark Wielaard [Fri, 20 Mar 2009 13:57:00 +0000 (14:57 +0100)]
Emit vma callbacks for uprobes.
* tapsets.cxx (uprobe_derived_probe_group::emit_module_decls): Emit vma
callbacks.
(uprobe_derived_probe_group::emit_module_init): Activate vma callbacks.
* testsuite/systemtap.context/usymbols.exp: Track through uprobes,
so as to make sure we have the symbols.