Martin Cermak [Wed, 8 Jun 2016 10:47:00 +0000 (12:47 +0200)]
Fix PR20211 by aimplementing the "resume mode" of the testsuite.
Once the SYSTEMTAP_TESTSUITE_RESUME environmental variable is set
to some non-zero value, the testsuite can run in "resume mode".
In this mode, tests, that have previously been run, are not being
re-executed, and their existing test results are being reused and
merged instead.
This can be useful e.g. when some of the tests causes kernel panic
or stall. Using the "resume mode", it is possible to reboot the
testing box, and re-run the testsuite skipping already executed
tests (incl. the one that caused the panic or stall - which will
stay "unfinished").
The "make list-unfinished" lists all such unfinished testcases.
Those need additional investigation.
The "resume mode" can be used with "make installcheck", or
"make installcheck-parallel".
Martin Cermak [Fri, 27 May 2016 19:41:49 +0000 (21:41 +0200)]
Re-fix PR19926 by simplifying previous implementation.
This reimplementation of the @const() operator (0a7eb12d191)
is based on PR20136, comment 3. It moves all the logic to the
parser. No elaboration involved.
David Smith [Fri, 27 May 2016 16:19:03 +0000 (11:19 -0500)]
Fix PR20158 by updating the runtime for the 4.6 kernel.
* buildrun.cxx (compile_pass): Added autoconf-stacktrace_ops-int-address.c
compile test.
* stack.c: (print_stack_address): If STAPCONF_STACKTRACE_OPS_INT_ADDRESS
is defined, the function returns a int instead of being a void
function.
* runtime/linux/autoconf-stacktrace_ops-int-address.c: New autoconf-style
test.
David Smith [Thu, 26 May 2016 19:17:58 +0000 (14:17 -0500)]
Fix PR20131 by making wildcard library paths work in probe specifications.
* tapsets.cxx (dwarf_builder::build): Fix logic error with commit c30ff77. If the library path isn't fully resolved, then use the path the
user specified.
* testsuite/systemtap.base/listing_mode.exp: Decrease failures by being
more forgiving about getting a full library path in 'stap -l' output.
David Smith [Mon, 23 May 2016 15:26:08 +0000 (10:26 -0500)]
Fix PR17055 by reading perf values in a sleepable context.
* tapsets.cxx (common_probe_entryfn_prologue): Add 'declaration_callback'
and 'pre_context_callback' to allow callers to add to output prologue.
(dwarf_derived_probe::emit_probe_local_init): For perf values, instead
of reading the values here, just copy the values from where we stashed
them when we read them before (when we could sleep).
(uprobe_derived_probe::emit_perf_read_handler): New function.
(uprobe_derived_probe_group::emit_module_perf_read_handlers): Ditto.
(udpg_entryfn_prologue_declaration_callback): Ditto.
(udpg_entryfn_prologue_pre_context_callback): Ditto.
(uprobe_derived_probe_group::emit_module_utrace_decls): Call
new function emit_module_perf_read_handlers().
(uprobe_derived_probe_group::emit_module_decls): Figure out the maximun
number of perf counters used per probe.
* tapsets.h: Add new callbacks to common_probe_entryfn_prologue().
* runtime/linux/uprobes-common.h (stap_uprobe_spec): Add
'perf_read_handler' to actually read perf values.
* runtime/linux/uprobes-inode.c (stapiu_consumer): Ditto.
* runtime/linux/runtime.h: After loading the task_finder code, load the
perf code if needed.
* runtime/common_probe_context.h: Add 'perf_read_values' to the context
structure when we're using perf derived probes.
* testsuite/systemtap.base/perf.sh: Change '/usr/bin/cat' to '/bin/cat' so
that systems (like RHEL6) that don't have 'usrmove' will still work.
Martin Cermak [Thu, 19 May 2016 09:07:19 +0000 (11:07 +0200)]
Fix PR19926 by introducing translator built-in @const() operator.
Tapsets or guru-mode user scripts can access header file constant
tokens, typically macros, using built-in @const() operator. The
respective header file inclusion is possible either via the tapset
library, or using a top-level guru mode embedded-C construct.
This results in appropriate embedded C pragma comments setting.
Felix Lu [Tue, 17 May 2016 18:13:13 +0000 (14:13 -0400)]
new -T timeout option
* cmdline.h: Add -T flag
* elaborate.cxx: New function setup_timeout to create timer probe
* session.cxx: Initialize new timeout variable. Parse -T option
* session.h: New timeout variable
* man/stap.1.in: Documentation
* testsuite/systemtap.base/timeout.exp: Test it
Felix Lu [Wed, 11 May 2016 18:02:27 +0000 (14:02 -0400)]
compile server: use only one server for multiple kernel versions
* stap-serverd.cxx:
- Remove uname_r global
- kernel_build_tree is now a map of kernel version -> build tree
- process_r: Defer adding -r flag
- create_services: Create one service per target kernel version
- handle_request: Pass -r flag to stap based on client's sysinfo field
* stap-server:
- spawn only one server passing -r flags for each kernel version when
using the -i option
Frank Ch. Eigler [Thu, 12 May 2016 15:28:21 +0000 (11:28 -0400)]
elaborate.cxx: add some respect for pending_interrupt
Some wildcardy stap scripts can cause processing for quite awhile
within elaborate.cxx loops, without due respect for ^C. Now respond
quicker, at least in the cases relevant to
Josh Stone [Fri, 6 May 2016 23:43:37 +0000 (16:43 -0700)]
PR20042: support tracepoints with function-pointer args
For example, tracepoint "cpuhp_enter" has "int (*fun)(unsigned int))",
but since dwarf_type_name() didn't handle DW_TAG_subroutine_type, it
would call this "void*", and then the whole tracepoint function
signature would fail -Werror=incompatible-pointer-types.
We can now expand function-pointers in dwarf_type_name(), but we also
need a new dwarf_type_decl() which knows how to insert the name in the
middle of the type string.
Josh Stone [Tue, 3 May 2016 01:43:28 +0000 (18:43 -0700)]
dwflpp: use fixed-size buffers for ldd parsing
The dynamic string allocation causes trouble on RHEL5 -- %as is always
parsed as a float under C++11, but %ms requires glibc >= 2.7. But we
already used a fixed buffer for the line, so additional fixed buffers
are not a big deal for its substrings.
Mateusz Guzik [Mon, 2 May 2016 17:28:55 +0000 (12:28 -0500)]
Plug preempt leak in _stp_runtime_entryfn_put/get_context.
If _stp_runtime_entryfn_get_context returns a context, preemption
counter is always incremented. On the other hand
_stp_runtime_entryfn_put_context only decrements the counter if the
passed context matches the one currently set on the cpu.
The context can be set to NULL by _stp_runtime_contexts_free, making the
comparison false and in effect leading to a leak, e.g.:
timer: _stp_ctl_work_callback+0x0/0x1e0[stap_af8544c7eb51251ef8c
377abff659b05_25070] preempt leak: 00000101 -> 00000102
David Smith [Thu, 28 Apr 2016 15:59:50 +0000 (10:59 -0500)]
Improved fake utrace locking.
* runtime/stp_utrace.c: Fixed potential locking issues by changing the
'task_work_added' and 'report_work_added' members of 'struct
utrace' to be atomic variables. In the process, I also renamed
'task_work_added' to 'resume_work_added'. As atomice variables, they can
be modified without locking the utrace struct. Also renamed the 'work'
member of 'struct utrace' to 'resume_work' (to match up with
'resume_work_added').
PR14245 created a new relay_basedir_fd variable, for use when
staprun/stapio passes staprun a file descriptor for the base directory
of the sysfs systemtap-module directory. (This is necessary in order
to get around 0700 mount-dir permissions.) This broke staprun -d '*'
operation, since that variable got set (badly) once within the readdir
loop, and thence made actual removes inoperative. Now we clear out
that variable so each actual module subdirectory will get a good
cleaning.
David Smith [Mon, 25 Apr 2016 15:02:36 +0000 (10:02 -0500)]
Fix PR19990 by updating runtime/linux/access_process_vm.h.
* runtime/linux/access_process_vm.h (__access_process_vm_): Use
get_user_pages_remote() when available.
* buildrun.cxx (compile_pass): Added export test for
'get_user_pages_remote()'.
William Cohen [Fri, 15 Apr 2016 19:15:22 +0000 (15:15 -0400)]
Avoid using tcl exec command "-ignorestderr" option
In older versions of tcl the exec command does not support the
"-ignorestderr" option. Changed the code to redirected the stderr
output to /dev/null which works on both older and newer versions of
tcl.
David Smith [Wed, 13 Apr 2016 15:11:17 +0000 (10:11 -0500)]
Remove a blacklist regular expression that wasn't needed.
* dwflpp.cxx (build_kernel_blacklist): Removed a blacklist regexp,
"|raw_.*", since it didn't seem to match any locking functions as it was
supposed to do.
Martin Cermak [Wed, 13 Apr 2016 13:31:33 +0000 (15:31 +0200)]
Move the testsuite's artifacts directory to the builddir.
This update is a response to PR10791#c15. It moves the artifacts
directory, introduced in commit 8093ef39b, to the build directory
avoiding writes to the source directory.
Martin Cermak [Wed, 13 Apr 2016 13:22:10 +0000 (15:22 +0200)]
Modify the dry run mode for the network/socktop example.
We want to avoid testsuite writing into the source directory.
Before this update, when socktop has been run by check.exp as
a part of the testsuite run, it was copying the module to the
working directory. We want to avoid this.
Martin Cermak [Mon, 11 Apr 2016 07:55:20 +0000 (09:55 +0200)]
Terminate testsuite run if compiler sanity test fails.
Ensure that the testsuite run terminates right at the beginning
if compiler sanity test fails. This notably ensures that required
headers, object files and libraries are in place for the main arch,
as well as for the compat arch in the multilib environment.
David Smith [Fri, 8 Apr 2016 18:40:04 +0000 (13:40 -0500)]
Improve 64-bit file offset handling in syscall.preadv and syscall.pwritev.
* tapset/linux/syscalls2.stp (syscall.preadv): Improve handling of 64-bit
offsets.
(syscall.pwritev): Ditto.
* testsuite/systemtap.syscall/preadv.c: Turn on 64-bit file offsets and
add tests to make sure we're decoding them properly.
* testsuite/systemtap.syscall/pwritev.c: Ditto.
Vincent Bernat reported problems building with --enable-htmldocs due
to the newly overloaded ctime() function docs. Tweak the /** */
docs for the second overload, so as to suffer errors in neither
html nor pdf build phases.
Abegail Jakop [Tue, 29 Mar 2016 23:03:32 +0000 (19:03 -0400)]
PR19882: add copy_file_range syscall supportt
tapset/linux/nd_syscalls.stp: kprobe based syscall probe for
copy_file_range syscall
tapset/linux/syscalls.stp: kernel function based syscall probe for
copy_file_range syscall
buildok/[nd_]syscalls-detailed.stp: basic buildok tests for the new
probe points
copy_file_range.c: test file to check new tapset functionality