We used to emit these during dwflpp::express_as_string, after we'd
generated the rest of the body of the embeddedcode node. Emitting
these unconditionally is, for now at least, easier than walking the
tree to figure out if they're needed.
The __attribute__ syntax for labels dates from gcc 4.2.
Cody Santing [Wed, 3 May 2017 16:31:39 +0000 (12:31 -0400)]
Remove duplication in deprecated tapset functions
* Removed systemtap version compile conditions on
deprecated functions. Deprecated functions now refer to their
replacements rather than being a direct copy.
David Smith [Tue, 2 May 2017 17:11:29 +0000 (12:11 -0500)]
Make changes for RHEL6 in the http web service server code.
* configure.ac: Accept version 2.17.0 of the uuid library (for RHEL6).
* httpd/Makefile.am: Add ../util.cxx for regexp support that works on
RHEL6.
* httpd/main.cxx: Ditto.
* httpd/server.cxx: Ditto.
* httpd/server.h: Ditto.
* configure: Regenerated.
* httpd/Makefile.in: Ditto.
David Smith [Mon, 1 May 2017 20:55:51 +0000 (15:55 -0500)]
Added initial http web service server code.
* httpd/Makefile.am
* httpd/Makefile.in: Generated.
* httpd/main.cxx: httpd main program source.
* httpd/server.cxx: httpd server framework
* httpd/server.h: httpd server include file
* configure.ac: Make sure we have the microhttpd and uuid libraries before
trying to build the httpd code.
* Makefile.am: Added 'httpd' subdirectory.
* Makefile.in: Regenerated.
* config.in: Ditto.
* configure: Ditto.
David Smith [Tue, 25 Apr 2017 19:48:13 +0000 (14:48 -0500)]
Avoid server test failures by fixing test server startup/shutdown.
* testsuite/lib/systemtap.exp: Avoid 'output: can't read "logfile": no
such variable' tcl errors when starting systemtap server by properly
handling server logfile.
William Cohen [Mon, 17 Apr 2017 02:57:34 +0000 (22:57 -0400)]
Add aarch64 DWARF register names
To allow systemtap to compile on aarch64 machines with kernels that
supports BPF bpf-translate.cxx needs to have mappings for the DWARF
register names for aarch64.
William Cohen [Sun, 16 Apr 2017 19:44:27 +0000 (15:44 -0400)]
Add ARM DWARF register names
To allow systemtap to compile on 32-bit ARM machines with kernels that
supports BPF bpf-translate.cxx needs to have mappings for the DWARF
register names for ARM.
Mark Wielaard [Fri, 14 Apr 2017 10:44:36 +0000 (12:44 +0200)]
stapbpf/libbpf.c: Define __NR_bpf and initialize anonymous bpf_attr union.
__NR_bpf might not be defined in older headers, if so define it ourselves.
Older GCC have trouble initializing anonymous struct fields in a union
directly. Initialize them more explicitly.
David Smith [Fri, 7 Apr 2017 15:13:41 +0000 (10:13 -0500)]
Fix PR21363 by getting _struct_sched_attr_u() working on rawhide.
* buildrun.cxx (compile_pass): Add autoconf test to check for the
existence of <uapi/linux/sched/types.h>
* tapset/linux/aux_syscalls.stp: Include <uapi/linux/sched/types.h> if
STAPCONF_UAPI_LINUX_SCHED_TYPES is defined.
* runtime/linux/autoconf-uapi-linux-sched-types.c: New autoconf test.
David Smith [Wed, 5 Apr 2017 16:05:04 +0000 (11:05 -0500)]
Add a new tracepoint test to check compile requirements for each group.
* testsuite/systemtap.base/tracepoints_list.exp: Add a new test where we
make sure that each tracepoint group's compile tweaks are sufficient in
itself.
David Smith [Wed, 5 Apr 2017 15:28:39 +0000 (10:28 -0500)]
Fix several small items found by a coverty code scan.
* tapsets.cxx (uprobe_derived_probe_group): Add constructor to initialize
'max_perf_counters'.
* session.cxx (parse_cmdline): Be sure check 'optarg' is NULL before
trying to use it.
* elaborate.cxx (stat_decl_collector::visit_stat_op): Make sure that if
iterator is at the end, we don't try to access it anyway.
Martin Cermak [Tue, 4 Apr 2017 08:25:22 +0000 (10:25 +0200)]
PR21297 Add support for new statx syscall
tapset/linux/aux_syscalls.stp: Add _statx_mask_str()
tapset/linux/i386/syscall_num.stp: Add statx syscall info
tapset/linux/x86_64/syscall_num.stp: Ditto
tapset/linux/sysc_statx.stp: New syscall tapset
testsuite/buildok/nd_syscalls2-detailed.stp: New buildok test
testsuite/buildok/syscalls2-detailed.stp: Ditto
testsuite/systemtap.syscall/stat.c: New statx syscall subtest
David Smith [Fri, 31 Mar 2017 19:36:40 +0000 (14:36 -0500)]
Tweak elfutils version discovery in the testsuite.
* testsuite/lib/systemtap.exp (get_system_info): If we're running a
version of systemtap compiled with version X of elfutils, but running
with version Y of elfutils (where Y > X), the elfutils version gets
reported as 'Y/X'. Make sure to parse this correctly.
David Smith [Tue, 28 Mar 2017 21:36:30 +0000 (16:36 -0500)]
Workaround parser issue in nfs_proc.stp.
* tapset/linux/nfs_proc.stp (nfs.proc3.read_done): To avoid parser issues,
split up @choose_defined() code into two separate if statements. Note
that this is a workaround until we can fix the parser issue.
(nfs.proc4.read_done): Ditto.
David Smith [Mon, 27 Mar 2017 16:16:53 +0000 (11:16 -0500)]
BZ1431263: Remove "too many hardware breakpoint probes" warning.
* tapsets.cxx (hwbkpt_derived_probe_group::enroll): Remove warning about
too many hardware breakpoint probes, since we can't really know how many
this system supports until we try to register them.
* testsuite/systemtap.pass1-4/buildok.exp: Expect hwbkpt.stp compilation
to fail on systems (like arm64) where hwbkpt_probes_p returns false.
* testsuite/systemtap.pass1-4/buildok-interactive.exp: Ditto.
David Smith [Wed, 22 Mar 2017 20:51:56 +0000 (15:51 -0500)]
Fixed BZ1430828 by replacing task_exe_file() with current_exe_file().
* tapset/linux/task.stp (current_exe_file): New function.
(task_exe_file): Deprecate and rewrite in terms of
current_exe_file(). This keeps us from potentially accessing task->mm in
an unsafe manner.
* testsuite/buildok/task-embedded.stp: Updated.
* testsuite/systemtap.base/task_paths.exp: Ditto.
* testsuite/systemtap.base/task_paths.stp: Ditto.
* NEWS: Add deprecation comment.
* doc/SystemTap_Tapset_Reference/man3/function::task_exe_file.3stap:
Ditto.
* doc/SystemTap_Tapset_Reference/man3/function::current_exe_file.3stap:
New file.
Use %w[arg] to request that widened forms of register names be passed
to the sys/sdt.h macro operand strings, so as to avoid nominating
sub-registers such as %sil within -m32 code, which gcc <= 6 sometimes
buggily did.
* 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.