David Smith [Fri, 26 Feb 2016 19:32:27 +0000 (13:32 -0600)]
Add multiarch testing to testsuite/systemtap.base/callee.exp.
* testsuite/systemtap.base/callee.exp: Revamp test case to test all
supported executable sizes on multiarch systems. Standardize on a
4-character indent.
David Smith [Wed, 24 Feb 2016 22:10:16 +0000 (16:10 -0600)]
Fix the threadstacks.stp example and testcase for ppc64.
* testsuite/systemtap.examples/process/threadstacks.stp: Add ppc64 support
by also probing "/lib*/*/libpthread.so.*", since RHEL7 ppc64 puts the
pthread library in /lib64/power8/.
* testsuite/systemtap.base/pthread_stacks.exp: Choose the new stack size
based on architecture, since 0x10000 is invalid for ppc64.
David Smith [Wed, 24 Feb 2016 19:02:55 +0000 (13:02 -0600)]
Update 2 test cases to work on ppc64, which can inline vfs_{read,write}.
* testsuite/systemtap.base/onoffprobe.stp: Switch from probing the return
of vfs_write() (which can be inlined) to probing the return of
syscall.write.
* testsuite/systemtap.base/listing_mode_sanity.exp: Make sure we use
'.call' when listing kernel.function("vfs_read"), since on some kernels
that function can be inlined.
David Smith [Wed, 24 Feb 2016 17:14:41 +0000 (11:14 -0600)]
Get more passes in semok.exp and semko.exp on ppc64.
* dwflpp.cxx (build_kernel_blacklist): Add ppc64-specific
include/asm/io-defs.h file to the blacklist.
* testsuite/systemtap.pass1-4/semko.exp: Make sure vfs_read() doesn't have
an inlined version before running twentytwo.stp.
* testsuite/systemtap.pass1-4/semok.exp (dyninst_kfails): Check for plt
probe support before running plt[12].stp.
David Smith [Tue, 23 Feb 2016 19:23:14 +0000 (13:23 -0600)]
Fix rawhide compile problems in aux_syscalls.stp.
* tapset/linux/aux_syscalls.stp (_stp_siginfo_u): Removed extra "break"
statements that gcc version 6 complains about on rawhide.
(_stp_compat_siginfo_u): Ditto.
William Cohen [Thu, 18 Feb 2016 22:08:12 +0000 (17:08 -0500)]
Accept other error codes returned by socket syscall in socket.c syscall test
On aarch64 the last socket syscall in socket.c return EINVAL rather
than EPROTONOSUPPORT. Adjust the test to be a bit more flexible. An
error is an error.
David Smith [Tue, 16 Feb 2016 20:54:49 +0000 (14:54 -0600)]
Make some small improvements to systemtap.base/callee.exp.
* testsuite/systemtap.base/callee.exp: Made the test more verbose for
debugging purposes. Reports the desired output and shows the compile
commands used.
* testsuite/systemtap.base/callee.inlined.c: Has a better return status so
stap doesn't complain about the target exiting with a non-zero status.
David Smith [Tue, 16 Feb 2016 17:06:58 +0000 (11:06 -0600)]
Fix PR19644 by updating the runtime to handle linux 4.5 commit 8244062ef1.
* runtime/transport/symbols.c (_stp_module_update_self): Handle kernel
change moving module symbol table information into a 'struct
mod_kallsyms'.
* runtime/linux/autoconf-mod_kallsyms.c: New autoconf test.
* buildrun.cxx (compile_pass): Add autoconf test for 'struct
mod_kallsyms'.
Nikolay Borisov [Thu, 11 Feb 2016 15:34:50 +0000 (17:34 +0200)]
Add ability to override kernel release check
In some situation it might be useful to disable checking the
kernel release. This happens when a kernel module is being rebuilt
and then probed. Without this override one has to reboot the machine
with the new kernel (and module) and then use systemtap.
To rectify the situation add a new define STP_NO_VERREL_CHECK,
which disables the relevant code in the resulting systemtap module.
This can be used with the following syntax:
stap -DSTP_NO_VERREL_CHECK script.stp
Signed-off-by: Nikolay Borisov <n.borisov@siteground.com>
David Smith [Fri, 12 Feb 2016 14:42:58 +0000 (08:42 -0600)]
Add a couple of dyninsg KFAILs to buildok-dyninst.exp and semok.exp.
* testsuite/systemtap.pass1-4/buildok-dyninst.exp: Add
buildok/profiletimer.stp as a dyninst KFAIL.
* testsuite/systemtap.pass1-4/semok.exp (dyninst_kfails): Add
semok/transko.stp as a dyninst KFAIL.
David Smith [Fri, 12 Feb 2016 14:21:53 +0000 (08:21 -0600)]
Improve tracepoint support on systems with self-built kernels.
* tapsets.cxx (header_exists): New function
(tracepoint_extra_decls): Look for headers in the kernel build tree and
kernel source tree (instead of just the kernel source tree). On systems
with self-built kernels, we were failing to find tracepoint headers.
* buildrun.cxx (compile_pass): Add kernel build tree directory to include
path.
(make_tracequeries): Ditto.
David Smith [Wed, 10 Feb 2016 19:06:51 +0000 (13:06 -0600)]
Fix PR19560 by improving the relay code.
* staprun/relay.c (reader_thread): Use mutex when accessing state
variable.
(switchfile_handler): Ditto. Also don't send the USR2 signal to the same
thread running the signal handler.
(init_relayfs): Initialize the mutexes.
(close_relayfs): Destroy the mutexes.
David Smith [Wed, 10 Feb 2016 18:49:09 +0000 (12:49 -0600)]
Better test for hardware breakpoint support in the examples.
* testsuite/systemtap.examples/memory/hw_watch_addr.meta: Move the
hardware breakpoint test to the associated tcl file.
* testsuite/systemtap.examples/memory/hw_watch_sym.meta: Ditto.
* testsuite/systemtap.examples/memory/hw_watch_addr.tcl: New file.
* testsuite/systemtap.examples/memory/hw_watch_sym.tcl: New file.
Martin Cermak [Wed, 10 Feb 2016 18:35:27 +0000 (19:35 +0100)]
Add more czech localized manpages.
configure.ac: Process man/cs/{stappaths.7,systemtap.8} with automake.
man/cs/Makefile.am: Put individual manpages into correcponding folders.
man/dtrace.1: Add BUGS section.
man/error::dwarf.7stap: Fix typos.
man/cs/*: New manpages.
NEWS: An advertisement.
Abegail Jakop [Thu, 28 Jan 2016 20:33:49 +0000 (15:33 -0500)]
PR13643: log client options passed to compile server
Log the options that a stap client passes to the stap compile server.
This will include logging the script file name or the -e script,
depending on what is used by the client.
David Smith [Tue, 2 Feb 2016 19:46:25 +0000 (13:46 -0600)]
Fix PR19536 by making more synthetic functions "private".
* tapsets.cxx (dwarf_pretty_print::expand): Treat internal synthetic
functions as private.
(sdt_uprobe_var_expanding_visitor::try_parse_arg_varname): Set
'unmangled_name' when creating a synthetic function.
* elaborate.cxx (create_monitor_function): Set 'unmangled_name' when
creating a synthetic function.
* tapset-procfs.cxx (procfs_var_expanding_visitor::visit_target_symbol):
Ditto.
* testsuite/semok/kretprobe-data.stp: Fix typo.
typeof() and auto_ptr() needed some #ifdef love so that the code
compiles with
CXXFLAGS="-std=c++11 -O2 -g -Wextra -Wall -Werror"
and CXXFLAGS="-O2 -g -Wextra -Wall -Werror"
David Smith [Mon, 1 Feb 2016 19:58:02 +0000 (13:58 -0600)]
Fixed PR19537 by writing a new parse semko test.
* testsuite/systemtap.pass1-4/parse-semko.exp: New test case, similar to
the old parseok/semko.stp case, that makes sure that we can parse all
the semko test cases.
* testsuite/parseok/semko.stp: Deleted.
* testsuite/semko/netfilter09.stp: Corrected pass number to '-p2'.
* testsuite/semko/netfilter10.stp: Ditto.
* testsuite/semko/netfilter11.stp: Ditto.
David Smith [Thu, 28 Jan 2016 20:21:37 +0000 (14:21 -0600)]
Change the way the interactive mode reads scripts.
* interactive.cxx (load_cmd:handler): Instead of using stap's parser to
read in the script, just read in the script as a series of
strings. Using the parser discards comments, preprocessor directives,
and rearranges the script.
David Smith [Thu, 28 Jan 2016 18:36:32 +0000 (12:36 -0600)]
Remove the 'compatible_version' interactive mode option.
* interactive.cxx: Remove the "compatible_version" option, since
implementing it would require re-reading the tapset library.
* testsuite/systemtap.pass1-4/buildok-interactive.exp: Remove
"compatible_version" option support. If a script uses "--compatible",
just skip the script.
Felix Lu [Thu, 28 Jan 2016 16:31:26 +0000 (11:31 -0500)]
Fix build
The new documentation changes were causing the build to fail when
build directory is the same as the source directory.
The documents are now copied from source to install directory only.
Josh Stone [Wed, 27 Jan 2016 22:20:06 +0000 (14:20 -0800)]
PR19525: always use a SIGUSR2 handler in stapio
It was conditionally ignored by commit 62d2a73ee995, to avoid confusing
error messages about file rotation when there's no output file.
But bulk-mode close_relayfs() still needs the signal to cause EINTR on
the waiting threads, so SIG_IGN is too much. Now we just return from
the handler immediately if there's no output file to rotate.
Also add a SIGUSR2 test for the original error and with bulk mode.
David Smith [Wed, 27 Jan 2016 22:29:01 +0000 (16:29 -0600)]
Improve systemtap.base/stmt_rel.exp for rawhide systems.
* testsuite/systemtap.base/stmt_rel.exp: Improve testcase by handling move
of fs/bio.c to block/bio.c on rawhide kernels. Actually fail if we can't
get line numbers for a function.
David Smith [Wed, 27 Jan 2016 22:26:09 +0000 (16:26 -0600)]
Update tracepoint support for rawhide kernels.
* tapsets.cxx (tracepoint_extra_decls): Get more tracepoints working on
rawhide kernels (4.5.0-0.rc0.git9.1.fc24.x86_64).
(tracepoint_builder::init_dw): Ditto.
David Smith [Wed, 27 Jan 2016 17:16:17 +0000 (11:16 -0600)]
Make timers.exp less random by improving its test script.
* testsuite/systemtap.base/timers.stp: Improve test case by lowering the
value of randomized jiffies probe. On systems (such as s390x) with
CONFIG_HZ of 100 (a jiffies value of 0.01 seconds), the probe could
reasonably not fire in 10 seconds.
David Smith [Wed, 27 Jan 2016 16:52:44 +0000 (10:52 -0600)]
Make pthread_stacks.exp less random by improving its test program.
* testsuite/systemtap.base/pthread_stacks.c: Improve the test program by
no longer calling 'sleep()' (whose behavior is undefined in a pthreads
program). Also, be sure to wait on all the threads to finish, so we can
be sure a thread has the chance to print the stack size before we exit.
Felix Lu [Tue, 26 Jan 2016 21:37:49 +0000 (16:37 -0500)]
PR19346: Remove html from source tree
autoreconf 2.69, Fedora 22
HTML pages for the SystemTap_Beginners_Guide and Tapset_Reference
are only built when provided with the --enable-htmldocs configure
flag.
* configure.ac: new configure option --enable-htmldocs to build
HTML docs. xmlto check restored for --enable-htmldocs condition
* doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts*: restored
href link to allow building from both the generate-docs script
and Makefile.
* doc/SystemTap_Beginners_Guide/en-US/html/: deleted
* doc/SystemTap_Tapset_Reference/tapsets/: deleted
* scripts/generate-docs: remove building of HTML docs
* scripts/update-docs: pass --enable-htmldocs flag to build HTML docs
* doc/SystemTap_Tapset_Reference/Makefile.am: only build HTML
if BUILD_HTMLDOCS macro defined
* doc/beginners/Makefile.am: only build HTML if BUILD_HTMLDOCS macro
defined
* doc/SystemTap_Beginners_Guide/testsuite: new symlink to allow
building from both Makefile and generate-docs
Felix Lu [Tue, 19 Jan 2016 20:07:13 +0000 (15:07 -0500)]
PR19346: escape xml documentation
SystemTap_Beginners_Guide and SystemTap_Tapset_Reference docs are
now prebuilt in the source tree to avoid xmlto at build time.
The prebuilt SystemTap_Beginners_Guide docs are stored in
doc/SystemTap_Beginners_Guide/en-US/.
The prebuilt tapset reference docs are stored in
doc/SystemTap_Tapset_Reference.
* configure.ac: Skip symlinking examples directory, remove checking
for xmlto when building reference docs, remove BUILD_PDFREFDOCS
condition.
* scripts/generate-docs: new script to update the prebuilt documentation.
* doc/beginners/Makefile.am: updated to copy prebuilt docs from
source tree.
* doc/SystemTap_Reference/Makefile.am: updated to copy prebuilt
* doc/SystemTap_Beginners_Guide/en-US/Useful_scripts*: updated href links
for generation in source tree.
* doc/SystemTap_Beginners_Guide/en-US/html: prebuilt html pages
* doc/SystemTap_Beginners_Guide/en-US/SystemTap_Beginners_Guide.pdf:
prebuilt pdf
* doc/SystemTap_Reference_guide/{man3, man_pages}: prebuilt man
pages
* doc/SystemTap_Reference_guide/tapsets: prebuilt html pages
* doc/SystemTap_Reference_guide/tapsets.pdf: prebuilt pdf
David Smith [Tue, 26 Jan 2016 19:06:55 +0000 (13:06 -0600)]
Don't test hardware breakpoint examples where they aren't supported.
* testsuite/systemtap.examples/memory/hw_watch_addr.meta: Make sure the
kernel supports hardware breakpoints before trying the test case.
* hw_watch_sym.meta: Ditto.
David Smith [Tue, 26 Jan 2016 16:37:17 +0000 (10:37 -0600)]
Make some interactive mode test case improvements.
* testsuite/systemtap.pass1-4/buildok-interactive.exp: Only run the test
if stap was compiled with the readline library. Add support for the
"compatible_version" option.
* session.cxx (systemtap_session::version): Report whether stap was
compiled with the readline library.
* testsuite/lib/systemtap.exp (readline_p): Add a new function that
reports if systemtap was compiled with the readline library.
Martin Cermak [Tue, 26 Jan 2016 14:55:25 +0000 (15:55 +0100)]
Make xgettext scan for all the NLS macros we use.
Before this update, xgettext, which is run as a part of `make update-po`
was only scanning for the '_()' macro (the other one mentioned in there,
'N_()', was not really used in our sources, it's probably some unused
relict). So now we scan for '_()', '_N()', '_F()', and '_NF()' as defined
in util.h.
From now on, the '_N()' and '_NF()' macros are correctly processing the
plural forms too. Relevant documentation is: https://www.gnu.org/softwa-
re/gettext/manual/html_node/xgettext-Invocation.html#Language-specific-options
Martin Cermak [Mon, 25 Jan 2016 10:25:56 +0000 (11:25 +0100)]
Fix PR19502 by adding the "GETTING HELP" section to the stap.1 manpage.
Move stap.1 to stap.1.in so that it can contain autoconf macros. Add
the "GETTING HELP" section to it. Do the same with the czech version
of the manpage.
Lukas Berk [Fri, 22 Jan 2016 23:40:33 +0000 (18:40 -0500)]
Add tapset support for mlock2 syscall in 4.4
aux_syscalls.stp - flags to str function
nd_syscalls.stp - add kprobe based syscall probe point
syscalls.stp - add kernel function based syscall probe point
David Smith [Fri, 22 Jan 2016 20:05:30 +0000 (14:05 -0600)]
Output semi-colons between statements when printing a script.
* staptree.cxx (print): Add a semi-colon after every statement in a
block. This helps when using parser output as input back to systemtap
by separating statements appropriately.
* testsuite/systemtap.base/optim_arridx.exp: Update test to expect a
semi-colon after statements in parser output.
* testsuite/systemtap.server/client_args.exp: Ditto.
* testsuite/systemtap.examples/memory/hw_watch_addr.stp: Only try hardware
breakpoints (i.e. 'kernel.data') probes if CONFIG_HAVE_HW_BREAKPOINT is
on.
* testsuite/systemtap.examples/memory/hw_watch_sym.stp: Ditto.
David Smith [Thu, 21 Jan 2016 19:54:50 +0000 (13:54 -0600)]
PR19510 partial fix - improve '-p1' output.
* testsuite/systemtap.pass1-4/parse-semok.exp: New testcase.
* staptree.h: Add the 'unmangled_name' field to the 'symboldecl' class.
* staptree.cxx (vardecl::print): Print the 'unmangled_name' field, instead
of the 'name' field (which could have been mangled).
(vardecl::printsig): Ditto.
(functiondecl::print): Ditto.
(functiondecl::printsig): Ditto.
* parse.cxx (do_parse_global): Set the new 'unmangled_name' field.
(do_parse_functiondecl): Ditto.
* elaborate.cxx (add_global_var_display): Use the 'unmangled_name' field
instead of 'tok->content'.
Martin Cermak [Thu, 21 Jan 2016 15:57:25 +0000 (16:57 +0100)]
Preparation for the czech localization of manpages.
Following changes were inspired by the shadow utils project:
https://github.com/shadow-maint/shadow
configure.ac: Add man/cs/Makefile to AC_CONFIG_FILES.
man/Makefile.am: Include processing the cs folder with automake.
man/cs/Makefile.am: Add the cs folder to the mandir.
systemtap.spec: Include localized manpages in the expected file list.
The specfile change aims to also cover possible future
localizations that might include the "region" specification.
Jonathan Lebon [Thu, 21 Jan 2016 01:10:44 +0000 (20:10 -0500)]
tapsets.cxx: fix indentation to appease GCC 6
The new -Wmisleading-indentation complains about the indentation of
these braces because of the if-statement right before. We can squash
that warning by simply unindenting the braces.
Whether this scoping should even exist is another question. I like it
there because that whole scope is related to variable expansion. It
should probably be moved to a function.
David Smith [Wed, 20 Jan 2016 16:48:55 +0000 (10:48 -0600)]
Get systemtap.base/at_var.exp to pass on s390x.
* testsuite/systemtap.base/at_var.exp: Make changes needed to get test to
pass on s390x. On s390x all syscalls args are longs, so you can't print
them as a struct.
* testsuite/systemtap.base/at_var.stp: Ditto.
Abegail Jakop [Tue, 19 Jan 2016 20:35:09 +0000 (15:35 -0500)]
PR17741: add a try_assign macro
add a try_assign macro that stores in a provided variable the value
from evaluating the body of the try or catch statement.
tapset/try_assign.stpm: define a try_assign macro
testsuite/../try_assign.*: basic testcase checking that the try_assign
macro's functionality works as expected.