* tapsets.cxx (hwbkpt_derived_probe_group::emit_module_decls): Fix
hardware breakpoint probe handler return type - changed from 'int' to
'void' to match the kernel.
(hwbkpt_derived_probe_group::emit_module_init): Ditto.
sched/headers: Prepare for new header dependencies before moving
code to <linux/sched/mm.h>
* runtime/linux/access_process_vm.h: Include <linux/sched.h> and, if it
exists, <linux/sched/mm.h>.
* runtime/linux/autoconf-sched-mm.c: New file.
David Smith [Fri, 10 Mar 2017 16:15:48 +0000 (10:15 -0600)]
Fix BZ1425568 by updating task_dentry_path() to handle chroot().
* tapset/linux/dentry.stp (task_dentry_path): Fix task_dentry_path when
called on a target executable that has run chroot().
* testsuite/systemtap.base/task_dentry_path.exp: Add test for chroot'ed
executable.
* testsuite/systemtap.base/task_dentry_path3.stp: New test.
For custom built upstream kernels on Debian, fix version detection
Debian Bug: 856461
rrs@learner:~$ stap-prep
dpkg: warning: version '(gcc' has bad syntax: version number does not start with digit
Package linux-image-4.10.1+ version 4.10.1+-20 does not match version of currently running kernel: (gcc
Consider apt-get upgrade && reboot
dpkg: warning: version '(gcc' has bad syntax: version number does not start with digit
Package linux-headers-4.10.1+ version 4.10.1+-20 does not match version of currently running kernel: (gcc
Consider apt-get upgrade && reboot
You need package linux-image-4.10.1+-dbgsym but it does not seem to be available
Debian -dbgsym packages are typically in a separate repository
Follow https://wiki.debian.org/AutomaticDebugPackages to add this repository
2017-03-02 / 23:32:37 ♒♒♒ ☺
Debian now provides debug symbol packages for all its packages,
including for the Linux kernel.
There is a separate repository for debug symbol packages.
This patch updates those details.
Thanks to Jack Henschel for reporting the bug and the fix
David Smith [Mon, 6 Mar 2017 22:31:12 +0000 (16:31 -0600)]
Improve syscall test case results on newer powerpc kernels.
* testsuite/systemtap.syscall/getrandom.c: Improved.
* testsuite/systemtap.syscall/kexec_load.c: Add support for
kexec_file_load() to be unimplemented.
* testsuite/systemtap.syscall/tapset/syscall.stp: Mark kexec_file_load()
as unimplemented on powerpc.
* scripts/dump-syscalls.sh: Added comment about how to obtain strace
source.
* tapset/linux/arm/syscall_num.stp: Regenerated from the v4.16-27-gdb316ec
version of strace.
* tapset/linux/arm64/syscall_num.stp: Ditto.
* tapset/linux/i386/syscall_num.stp: Ditto.
* tapset/linux/mips/syscall_num.stp: Ditto.
* tapset/linux/powerpc/syscall_num.stp: Ditto.
* tapset/linux/x86_64/syscall_num.stp: Ditto.
David Smith [Thu, 2 Mar 2017 21:25:17 +0000 (15:25 -0600)]
Fix s390x-specific syscall tests.
* testsuite/buildok/syscalls-arch-detailed.stp: Made s390x probe tests
optional, since the underlying probes don't exist on the 4.10 kernel.
* testsuite/buildok/nd_syscalls-arch-detailed.stp: Ditto.
David Smith [Thu, 2 Mar 2017 21:23:28 +0000 (15:23 -0600)]
Fix s390x compile error in runtime/stack-s390.c.
* runtime/stack-s390.c (__stp_stack_print): Update code to let it compile
on the 4.10 kernel. Kernel commit d5c352c moved 'thread_info' into
task_struct.
David Smith [Wed, 22 Feb 2017 16:04:00 +0000 (10:04 -0600)]
Update the vfs.stp tapset for newer kernels.
* tapset/linux/vfs.stp: Since the __block_write_begin() function can be
inlined on newer kernels, we'll also probe
__block_write_begin_int(). Also, check to see if '$file' is defined
before using it in _vfs.block_write_begin.return.
Cody Santing [Fri, 17 Feb 2017 18:49:19 +0000 (13:49 -0500)]
Begin next release cycle
* NEWS: Add section for version 3.2
* configure.ac: Bump version to 3.2
* doc/SystemTap_Beginners_Guide/en-US/Book_Info.xml: same
* systemtap.spec: same
* testsuite/configure.ac: same
Cody Santing [Fri, 17 Feb 2017 17:04:27 +0000 (12:04 -0500)]
Prerelease updates
* .../SystemTap_Beginners_Guide: Update docs using ./scripts/update-docs
* .../syscalls.3stap: same
* .../syscalls.xmlpart: same
* session.cxx: Update copyright year
* stapdyn/stapdyn.cxx: same
* staprun/common.c: same
Frank Ch. Eigler [Fri, 17 Feb 2017 15:12:30 +0000 (10:12 -0500)]
PR20236 cont'd: runtime: preempt_disable* around strncpy_from_user()
After commit 906d6fe632cc9, we delegate to normal kernel routines for
some more userspace-kernelspace copying jobs. On some old kernels, on
some architectures, these functions make more assumptions about
atomicity than other stap runtime was guaranteeing. Out of abundance
of caution (and positive test results on conversions.exp), we add a
manual (redundant?) preempt_disable/enable wrap around this call.
Frank Ch. Eigler [Wed, 15 Feb 2017 19:20:37 +0000 (14:20 -0500)]
ip tapset: separate @cast alternative headers
The @cast(x,y,"<A><B>") construct is not an alternation facility
between headers A and B. It's a conjunction. If a structure is
declared either in A or B, separate @cast()s are required. Adapt to
this corrected understanding for three iphdr disassembly functions.
David Smith [Tue, 14 Feb 2017 22:44:01 +0000 (16:44 -0600)]
Better PR21102 fix: Smarter ioblock.stp tapset update for newer kernels.
* tapset/linux/ioblock.stp: Updated copyright dates. Better fix for
PR21102 by handling 4.9 kernels properly. Added a new 'opf' field to the
ioblock probes.
(bio_op): New function.
* testsuite/buildok/ioblock-embedded.stp: Added bio_op() test.
Frank Ch. Eigler [Tue, 14 Feb 2017 19:57:01 +0000 (14:57 -0500)]
symbol resolution: tweak levenshtein suggestions for private symbols
Attempted or typo'd access to a private function or variable properly
fail, but the levensthein suggestions should not include the
not-visible private symbols in the tapset. This patch excludes the
private ones from suggestion lists. But it is overbroad: a private
variable in the user script may also be excluded.
David Smith [Mon, 13 Feb 2017 19:04:29 +0000 (13:04 -0600)]
Tweak systemtap.stress/tapset_functions.exp.
* testsuite/systemtap.stress/tapset_functions.exp: Take 'qsq_start' off
the blacklist, since without it we get 'never-assigned global variable'
warnings.
David Smith [Mon, 13 Feb 2017 16:42:23 +0000 (10:42 -0600)]
Get systemtap.base/vars.exp working on newer kernels.
* testsuite/systemtap.base/vars.exp: Test for function existence before
trying to list function variables. Test 'bio_copy_user_iov', which
exists on newer kernels.
The 'pypath' tcl global variable could leak from one test into the
next, causing an inappropriate attempt to remove a test source file.
Pro tip: all .exp files run in the same tcl/expect interpreter, so
global variables set in one persist to others.
David Smith [Fri, 10 Feb 2017 16:26:23 +0000 (10:26 -0600)]
Update systemtap.base/utf_user_trunc.exp test case for gcc 7.
* testsuite/systemtap.base/utf_user_trunc.c: Lengthen MAXSTRINGLEN value
to 41 characters to ensure that systmetap's error buffer is large enough
to handle the "read fault" error messages (for example). Otherwise the
test will fail when gcc 7 rightly complains that the error buffer isn't
big enough.
* testsuite/systemtap.base/utf_user_trunc.stp: Ditto.
David Smith [Thu, 9 Feb 2017 18:39:17 +0000 (12:39 -0600)]
Fix/update the cast-scope testcase for gcc 7.
* testsuite/systemtap.base/cast-scope.exp: Update expected output for
cast-scope.cxx change. This way we're depending on our own class instead
of the internal details of the std::string class (which changed with gcc
7).
* testsuite/systemtap.base/cast-scope.cxx: Instead of using the
std::string class, define our own test class.
* testsuite/systemtap.base/cast-scope.stp: Update for cast-scope.cxx change.
David Smith [Tue, 7 Feb 2017 16:01:22 +0000 (10:01 -0600)]
Update systemtap.base/utf_kernel_trunc.exp test case for gcc 7.
* testsuite/systemtap.base/utf_kernel_trunc.exp: Lengthen MAXSTRINGLEN
value to 41 characters to ensure that systemtap's error buffer is large
enough to handle the "read fault" error messages (for
example). Otherwise the test will fail when gcc 7 rightly complains that
the error buffer isn't big enough.
* testsuite/systemtap.base/utf_kernel_trunc.stp: Ditto.
Passing $CFLAGS with embedded \" sequences is OK, so tune the previous
CFLAGS sanitization logic to nuke only backslash-newline sequences.
Modified dtrace.exp test covers this case as well as previous one.
David Smith [Thu, 2 Feb 2017 18:25:14 +0000 (12:25 -0600)]
Fix PR21102 by updating the ioblock tapset.
* tapset/linux/ioblock.stp: Update tapset for newer kernels. Upstream
kernel commits (like commit 1eff9d322a444245c67515edb52bc0eb68374aa8)
renamed and reworked the 'bi_rw' field of the bio structure.
The new python expanding visitors take probe-python bodies and intend
to generate probe-process bodies, expanding python $var references to
uprobe marker $var ones. During the expansion process however, the
code can get confused as to whether the new $arg3 is fish or foul.
If asked, it will map $arg3 -> foo($arg3, "arg3"), then recurse,
which is a recipe for stack exhaustion.
So now we map the generated $arg3 with a new hacky target_symbol flag,
"synthetic", to prevent infinite recursion there. (Note that using
the recently added abort_provide() response from the expander is not
enough, because an outer relaxation loop would then trigger infinite
looping rather than infinite recursion.)
A better solution could be to have a *not-in-place* rewriting visitor,
so that the output tree is never reprocessed by the invoking visitor.
Frank Ch. Eigler [Wed, 25 Jan 2017 15:00:11 +0000 (10:00 -0500)]
PR20627: rework several code rewriting passes
The translator depends on some staptree rewriting passes not only for
optimization but also for correctness.
The @defined() construct is one where its timely execution and
implication handling is important, so that other constructs protected
by false-valued if(@defined()) guards are not even processed. In
other places, @defined() nodes are collapsed to zero under heuristic
conditions. This has all been a mash of uncomfortable probe-specific
and probe-independent code, running the same visitors in different
modes at different times, looping or not.
So we take a step forward in recognizing that some visitors
necessarily operate partially, and must be rerun, interleaved with
others. New functions in tapsets.h:
update_visitor_loop() -- given a vector of update_visitors, loop till relaxed
var_expand_const_fold_loop() -- same specialized to const-folder
... are now used from general elaborator driver as well as
probe-derivation logic. Some heuristic code regarding @defined()
can be removed.
This extends the update_visitor base template with its own notion of
relaxed-ness, which is naturally that if a staptree node/pointer has
been replaced (changed to a different value) during the visiting
traversal, then it is -not- relaxed yet, and this is saved in a new
instance variable. (A reset() function resets this so the same
visitor object can be reused.)
This makes it unnecessary to track count_replaced_defined_ops()
separately. It should make it possible to drop some other bool& flags
in some other older optimization passes; this is left for later.
Frank Ch. Eigler [Wed, 25 Jan 2017 15:36:57 +0000 (10:36 -0500)]
testsuite: tweak bz1027459
On a multi-CPU box, it's possible for two syscall.* probes to start
firing at the same time, this print two or more "hi"s, before the
exit() stops further new probes.
David Smith [Tue, 24 Jan 2017 16:44:12 +0000 (10:44 -0600)]
Update lookup_bad_addr() to avoid a kernel warning.
* runtime/linux/addr-map.c (lookup_bad_addr): Handle kernel commit 7c4788950ba which adds a kernel warning if access_ok() is called when
not in task context.
Allow our /usr/bin/dtrace-impersonating usdt-.d file parser to take in
those .d files that use the "arguments passed to probe consumers"
extended syntax:
Frank Ch. Eigler [Fri, 20 Jan 2017 03:04:48 +0000 (22:04 -0500)]
runtime/unwind: don't warn about self-unwinding
If a kernel backtrace traversed the stap module itself, until this
patch, the runtime emitted a pair of _stp_warn()'s complaining about
not-quite-perfect unwind data. This is noisy and unhelpful, since a
user can't do anything about it, so we switch over to a dbug(1) type
message.
David Smith [Fri, 20 Jan 2017 19:06:40 +0000 (13:06 -0600)]
Handle F24 dropping ppc64 32-bit exe support in the testsuite.
* testsuite/lib/compile_flags.exp (arch_compile_init): New
function. Fedora 24 ppc64 has dropped 32-bit exe support. Now on ppc64
systems, we test the 32-bit support. If it doesn't work (or isn't
present), assume only 64-bit exe support.
(arch_compile_flags): For ppc64, return the number of compile flags
arch_compile_init() determined for this system.
(arch_compile_flag): Ditto.
* testsuite/lib/systemtap.exp (setup_systemtap_environment): Call
arch_compile_init().
Frank Ch. Eigler [Mon, 16 Jan 2017 18:23:57 +0000 (13:23 -0500)]
tweak python helper installation paths
Since our python helper includes C shared libraries, all the files
(including .egg-info) will get put under %python_sitearch
(/usr/lib64/...) rather than %python_sitelib (/usr/lib/...).
The translate-time stap-resolve-module-function* file belongs in
the -devel subrpm, not -runtime.
David Smith [Mon, 16 Jan 2017 15:29:38 +0000 (09:29 -0600)]
Fix the python helper module compiliation.
* python/Makefile.am: Fix a problem where we were using the system's copy
of sdt.h, instead of the source tree's copy of sdt.h.
* python/Makefile.in: Regenerated.
Frank Ch. Eigler [Mon, 16 Jan 2017 15:24:45 +0000 (10:24 -0500)]
testsuite infrastructure: change stap_run api
Formerly, the stap_run tcl proc accepted a target stap script file
name both as its first argument, as well as in the general stap
argument list at the end. It passed the former name as an extra file
name iff it existed in the $srcdir/$testdir. Some tests happened to
use test names that matched files, so triggered this stap_run
heuristic, even if the .stp files were specified some other way. This
led to extra stap arguments, leading to "unused $0/@0 ..." warnings,
leading to test failures.
Now, stap_run never does anything clever with its first parameter - it
just uses it to construct the dejagnu test case id/name. The .stp
file name (if any - if not using -e SCRIPT for example) is now
expected to be included by the testcase.exp as arguments at the end.
Frank Ch. Eigler [Mon, 16 Jan 2017 15:23:23 +0000 (10:23 -0500)]
tweak unused $n/@n warning for argv tapset users
Use the demangled (original) names in s.globals[] rather than mangled
name to heuristically identify use of the argv tapset (and thus
suppression of the warnings).
Martin Cermak [Fri, 13 Jan 2017 10:09:54 +0000 (11:09 +0100)]
PR20333: Add new convenience variables to the buildok tests.
* nd_syscalls2-detailed.stp, syscalls2-detailed.stp: Drop the
compat_pselect7a versus compat_pselect7 typo handling which was
systemtap_v <= "1.3".
* nd_syscalls2-detailed.stp: Add nd_syscall.sched_yield and
nd_syscall.userfaultfd test to align with syscalls2-detailed.stp
* The rest of the changes is adding new convenience variables.