]> sourceware.org Git - systemtap.git/log
systemtap.git
5 years agostapbpf assembler WIP #3 :: additional assembly test cases
Serhei Makarov [Tue, 16 Oct 2018 22:13:47 +0000 (18:13 -0400)]
stapbpf assembler WIP #3 :: additional assembly test cases

5 years agostapbpf assembler WIP #2 :: testcases (no driver so far)
Serhei Makarov [Mon, 1 Oct 2018 19:39:00 +0000 (15:39 -0400)]
stapbpf assembler WIP #2 :: testcases (no driver so far)

5 years agostapbpf assembler WIP #1 :: basic parser and control flow
Serhei Makarov [Mon, 1 Oct 2018 19:38:16 +0000 (15:38 -0400)]
stapbpf assembler WIP #1 :: basic parser and control flow

5 years agoAdd some Tcl examples.
William Cohen [Mon, 1 Oct 2018 15:45:22 +0000 (11:45 -0400)]
Add some Tcl examples.

5 years agoCorrect to use @hist_log in description.
William Cohen [Mon, 1 Oct 2018 15:16:41 +0000 (11:16 -0400)]
Correct to use @hist_log in description.

6 years agoFix a typo in api.cxx
Masanari Iida [Wed, 19 Sep 2018 04:03:51 +0000 (13:03 +0900)]
Fix a typo in api.cxx

This patch fix a spelling typo in error message.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
6 years agoChange the tapset file name to get matching tapset::syscall_any manpage
William Cohen [Thu, 27 Sep 2018 14:48:14 +0000 (10:48 -0400)]
Change the tapset file name to get matching tapset::syscall_any manpage

The automated generation of man pages uses the file name to generate
the manpage names.  Adjusted the name to get a matching tapset man
page for syscall_any{.return} probe points.

6 years agoConvert the various systemtap examples to use the syscall any tapset
William Cohen [Fri, 21 Sep 2018 02:50:16 +0000 (22:50 -0400)]
Convert the various systemtap examples to use the syscall any tapset

To make the examples cleaner use the new syscall any tapset.  This avoids
exposing the systemtap internal function _stp_syscall_nr() and makes the
instrumentation look a bit more like the traditional syscall.* probe points.

6 years agoAdd the syscall_any and syscall_any.return probe points
William Cohen [Fri, 21 Sep 2018 00:33:17 +0000 (20:33 -0400)]
Add the syscall_any and syscall_any.return probe points

The syscall.*{.return} and np_syscall.*.{.return} end up expanding to
large amount of code that takes a signficant amount of time to
compile.  The resulting kernel module also takes a fair amount of time
to install and remove the instrumentation when it starts and shuts
down.  For instrumentation don't really care about the details of the
syscall arguments it would be preferable to use the sys_enter and sys_exit
tracepoints to more efficiently probe the one or two places.

Using tp_syscall.*{.return} end up generating a lot of code to
determine which of the hundreds of syscall is being used and then runs
the same handler.  The syscall_any and syscall_any.return eliminate
that undesired overhead by just looking up the syscall name in a
table.

6 years agoAdjust comment in tapset/errno.stp so the documentation can be built.
William Cohen [Thu, 20 Sep 2018 18:50:39 +0000 (14:50 -0400)]
Adjust comment in tapset/errno.stp so the documentation can be built.

6 years agoUse sys_enter and sys_exit tracepoints in place of syscall.*{.return}
William Cohen [Mon, 17 Sep 2018 20:58:09 +0000 (16:58 -0400)]
Use sys_enter and sys_exit tracepoints in place of syscall.*{.return}

The common probe point idiom of syscall.* and syscall.*.return can be
replaced with equivalent sys_enter and sys_exit tracepoints for a
number of the example scripts.  The advantages are:

-Quicker compilation of the script into instrumenation
-Smaller kernels modules for the instrumentation
-Lower overhead for probe points

This changes are not applicable to all uses use syscall.* and
syscall.*.return. The predefined variable such as argstr are not
available for the sys_enter and sys_exit trace points.

Some of the revised examples are using the internal _stp_syscall_nr())
function.  A user visible version of this function should be
available.

6 years agoFix typo on s390 nd_syscall.compat_fallocate probe point.
William Cohen [Fri, 21 Sep 2018 19:44:24 +0000 (15:44 -0400)]
Fix typo on s390 nd_syscall.compat_fallocate probe point.

6 years agoUse existing "limits" keyword for cpu_throttle.stp example.
William Cohen [Fri, 21 Sep 2018 18:38:16 +0000 (14:38 -0400)]
Use existing "limits" keyword for cpu_throttle.stp example.

6 years agoAdd ioctl_handler.stp example
William Cohen [Fri, 21 Sep 2018 18:36:16 +0000 (14:36 -0400)]
Add ioctl_handler.stp example

6 years agoPR23160,PR14690: adapt 32 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Thu, 20 Sep 2018 20:56:35 +0000 (16:56 -0400)]
PR23160,PR14690: adapt 32 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoNote the need for debuginfo for threadstacks.stp.
William Cohen [Mon, 17 Sep 2018 18:54:46 +0000 (14:54 -0400)]
Note the need for debuginfo for threadstacks.stp.

6 years agoPR23160,PR14690: adapt 27 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Mon, 17 Sep 2018 14:27:25 +0000 (10:27 -0400)]
PR23160,PR14690: adapt 27 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoFix a regression that reading 64-bit registers on x86_64 was broken
Yichun Zhang (agentzh) [Mon, 17 Sep 2018 07:34:52 +0000 (00:34 -0700)]
Fix a regression that reading 64-bit registers on x86_64 was broken

This bug first appeared in commit 345537c32.

6 years agoFix the register() and u_register() tapset functions for x86
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 06:42:16 +0000 (23:42 -0700)]
Fix the register() and u_register() tapset functions for x86

The register() and u_register() functions incorrectly read 16-bit
x86 registers as 32-bit on both i386 and x86_64.

Fixed the sign-extension of register values on i386.

Fixed a compilation error when using *register() in the dyninst
runtime mode on x86_64.

Also added support for 8-bit x86 reigsters like "al" and "bh" on both
i386 and x86_64.

6 years agoPR23599 Bugfix: the embeddedcode info pass incorrectly skipped unused functions
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 01:08:58 +0000 (18:08 -0700)]
PR23599 Bugfix: the embeddedcode info pass incorrectly skipped unused functions

This bug led to kernel module compilation errors when using tapset
functions like usym* in unoptimized stap translation mode (i.e., stap
-u).

6 years agoPR23666 Fix a bug in semantic analysis of aggregate operators in foreach sorting
Yichun Zhang (agentzh) [Sun, 16 Sep 2018 00:06:59 +0000 (17:06 -0700)]
PR23666 Fix a bug in semantic analysis of aggregate operators in foreach sorting

When aggregate operators like @count, @sum, and etc were used in the
foreach loop sorting criteria but not in the foreach loop body, then
these sorting criteria were not respected by the translator in the
generated code.

This bug affected both the kernel and dyninst runtime modes.

6 years agoditto
Frank Ch. Eigler [Fri, 14 Sep 2018 23:38:51 +0000 (19:38 -0400)]
ditto

6 years agodummy commit for ci trigger
Frank Ch. Eigler [Fri, 14 Sep 2018 21:59:47 +0000 (17:59 -0400)]
dummy commit for ci trigger

6 years agospin-rawhide: accelerate git checkout
Frank Ch. Eigler [Fri, 14 Sep 2018 19:28:55 +0000 (15:28 -0400)]
spin-rawhide: accelerate git checkout

Use this script's directory as a git clone --reference

6 years agoDo some testing of the sizeof_interactive.stp script.
William Cohen [Fri, 14 Sep 2018 19:19:56 +0000 (15:19 -0400)]
Do some testing of the sizeof_interactive.stp script.

6 years agoIgnore the error value returned by the find command for the slowvfs.stp
William Cohen [Fri, 14 Sep 2018 18:13:08 +0000 (14:13 -0400)]
Ignore the error value returned by the find command for the slowvfs.stp

Some files in /proc are unreadable by normal users. When the find
command encounters these files find returns a non-zero value on exit.
The test is just using the find to create some load and really wants
to discard the error result otherwise the install test for slowvfs.stp
will fail.

6 years agoAdd the libguestfs example.
William Cohen [Thu, 13 Sep 2018 18:01:44 +0000 (14:01 -0400)]
Add the libguestfs example.

6 years agoPR23608 refine_*: replace assertion failure with regex_error
Serhei Makarov [Wed, 12 Sep 2018 20:22:46 +0000 (16:22 -0400)]
PR23608 refine_*: replace assertion failure with regex_error

6 years agotestsuite configury: typo fix for make check, transcribe dejagnu summary exactly
Frank Ch. Eigler [Wed, 12 Sep 2018 15:58:35 +0000 (11:58 -0400)]
testsuite configury: typo fix for make check, transcribe dejagnu summary exactly

Fix $-vs-$$ quoting typo in Makefile.

6 years agosyscalls: adapt sample scripts: syscall.*.return returnval() -> retval
Frank Ch. Eigler [Wed, 12 Sep 2018 17:51:28 +0000 (13:51 -0400)]
syscalls: adapt sample scripts: syscall.*.return returnval() -> retval

Demonstrate post-4.0 style in our distributed samples.

6 years agoPR23160,PR14690: convert syscall.*.return aliases to @SYSC_SETRETVAL retval/retstr
Frank Ch. Eigler [Wed, 12 Sep 2018 17:30:44 +0000 (13:30 -0400)]
PR23160,PR14690: convert syscall.*.return aliases to @SYSC_SETRETVAL retval/retstr

Adjust all syscall.*.return aliases to a new macro for provision of new
retval, old retstr, and the temporary returnval() compatibility hack.
All hail /bin/sed, mother of /bin/ed, which made this operation bearable.

6 years agoPR23160,PR14690: prep returnval() for an extra side-channel of data
Frank Ch. Eigler [Wed, 12 Sep 2018 17:07:53 +0000 (13:07 -0400)]
PR23160,PR14690: prep returnval() for an extra side-channel of data

To permit tracepoint-based syscall probe-aliases to provide return values
to scripts, returnval() needs an extension.  This patch adds a pair of
new values to the context, conditional on version <= 4.0.  (The retval
value will be the next better approach, coming in a followup patch.)

https://sourceware.org/ml/systemtap/2018-q3/msg00167.html

6 years agotestsuite configury: for make check, transcribe dejagnu summary exactly
Frank Ch. Eigler [Wed, 12 Sep 2018 15:58:35 +0000 (11:58 -0400)]
testsuite configury: for make check, transcribe dejagnu summary exactly

Use a bit of sed magic to tail systemtap.sum more precisely.

6 years agotestsuite: prepare for working tp_syscall.exp suite
Frank Ch. Eigler [Wed, 12 Sep 2018 14:45:54 +0000 (10:45 -0400)]
testsuite: prepare for working tp_syscall.exp suite

There were some typos in the driver .stp script that precluded
operation, and exposed a latent bug in how another .exp file
transcribed outputs into the log file.

6 years agoRevert "PR23160,PR14690: fix syscalls that broke after adding CONTEXT->sregs in tapse...
Jafeer Uddin [Mon, 10 Sep 2018 16:12:41 +0000 (12:12 -0400)]
Revert "PR23160,PR14690: fix syscalls that broke after adding CONTEXT->sregs in tapset/errno.stp"

Since commit 8038562cafe852681eda1a45c02b5f76070d3dec was reverted
there is no need for commit 297f14e99e82001e656ee5ed47f99dac8918fa95
anymore.

6 years agoRevert "tapset/errno.stp: learn about CONTEXT->sregs"
Frank Ch. Eigler [Mon, 10 Sep 2018 15:43:27 +0000 (11:43 -0400)]
Revert "tapset/errno.stp: learn about CONTEXT->sregs"

This reverts commit 8038562cafe852681eda1a45c02b5f76070d3dec.
jafeer and wcohen right note that this papered over the real
problem, which is that a function like returnval() has no way
of accessing tracepoint parameters like sys_exit's $ret,
even if given CONTEXT->sregs.  Need to rethink.

6 years agoUse @entry() in return probes to avoid warnings
William Cohen [Mon, 10 Sep 2018 14:39:17 +0000 (10:39 -0400)]
Use @entry() in return probes to avoid warnings

Some of the examples accessed target variable in function return probes.
This type of access is ambigious and triggers a warning.  The accesses
now use @entry($target_var) to be clearer and avoid the warnings.

6 years ago PR23160,PR14690: adapt 29 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Mon, 10 Sep 2018 14:40:29 +0000 (10:40 -0400)]
 PR23160,PR14690: adapt 29 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoCorrect measureinterval.meta test_installcheck command.
William Cohen [Mon, 10 Sep 2018 02:20:43 +0000 (22:20 -0400)]
Correct measureinterval.meta test_installcheck command.

6 years agotracepoints: support cachefiles/fscache tracepoints
Frank Ch. Eigler [Mon, 10 Sep 2018 00:52:29 +0000 (20:52 -0400)]
tracepoints: support cachefiles/fscache tracepoints

These were blocked by the typical problem of the tracepoint headers
neglecting to include the other headers that declare the types that tp
arguments use.  Also noted, missing mei: tracepoints found to be not
so easy, so left it in just a comment.

6 years agoRun postgres and mysql apps tests with both uprobes and dyninst.
Stan Cox [Sun, 9 Sep 2018 15:52:54 +0000 (11:52 -0400)]
Run postgres and mysql apps tests with both uprobes and dyninst.

* postgres.exp (stap-postgres.sh):  Also run with --dyninst
* mysql.exp (stap-mysql.sh):  Also run with --dyninst

6 years agoAdd the measureinterval.stp example
William Cohen [Fri, 7 Sep 2018 19:49:30 +0000 (15:49 -0400)]
Add the measureinterval.stp example

6 years agoAdd a python script to clean up container images more than 2 days old.
David Smith [Fri, 7 Sep 2018 18:58:51 +0000 (13:58 -0500)]
Add a python script to clean up container images more than 2 days old.

* httpd/docker/stap_image_cleanup.py: New file.

6 years agoImprove handling by the http server for target exe files.
David Smith [Fri, 7 Sep 2018 18:46:59 +0000 (13:46 -0500)]
Improve handling by the http server for target exe files.

* httpd/api.cxx (build_info::module_build): Use a full path with the '-r
  KERNEL_DIR' stap option. If the client transferred over target
  executable files, add a sysroot option that points to them.
* testsuite/systemtap.http_server/http_server.exp: Add a test that tests
  non-rpm executables with an absolute path.

6 years agoPR23608: rebalance arc_priorities to avoid overflow.
Serhei Makarov [Fri, 7 Sep 2018 17:36:49 +0000 (13:36 -0400)]
PR23608: rebalance arc_priorities to avoid overflow.

Within a state kernel, e.g. {0/256, 1/256} could be changed to {0/2, 1/2}
without trouble.

Otherwise, long chains like "aaaaaaaaaaaaa" can overflow the
arc_priority numerator after about 60 characters.

Steps for rebalancing procedure:
- sort the worklist by arc_priority
- create an equivalent balanced set of priorities starting by 0/0
- replace the worklist's arc_priorities in sorted order

* stapregex-dfa.h (MAKE_START_PRIORITY): new macro for priority 0/0.
* stapregex-dfa.cxx (add_kernel): use MAKE_START_PRIORITY.
(sort_priorities, sort_denominator, sort_kernel_points): new comparators.
(rebalance_priorities): new function.
(te_closure): use rebalance_priorities() on the worklist before working on it.

* testsuite/runok/regex.stp: add test case.

6 years agoPR23160,PR14690: fix syscalls that broke after adding CONTEXT->sregs in tapset/errno.stp
Jafeer Uddin [Fri, 7 Sep 2018 16:00:15 +0000 (12:00 -0400)]
PR23160,PR14690: fix syscalls that broke after adding CONTEXT->sregs in tapset/errno.stp

6 years agoUse offset to beginning of .probes section for sdt semaphores with stapdyn.
Stan Cox [Fri, 7 Sep 2018 03:45:33 +0000 (23:45 -0400)]
Use offset to beginning of .probes section for sdt semaphores with stapdyn.

* tapsets.cxx (sdt_query::handle_query_module):  stapdyn calls
Dyninst::SymtabAPI::Symtab::fileToMemOffset for semaphores, which wants
the fileOffset parameter to be relative to the containing section.

6 years agoAvoid name collision with the existing installed python tapset files
William Cohen [Fri, 7 Sep 2018 02:59:03 +0000 (22:59 -0400)]
Avoid name collision with the existing installed python tapset files

Systemtap cannot find the files in the custom tapset if they have the
same name as the official installed tapset files.  Adjusted the names
of the local python tapset files to allow systemtap to find the files
and use the contents for py2example.stp and py3example tests.

6 years agoCorrect permissions for systemtap.interactive/*.exp expect test files.
William Cohen [Thu, 6 Sep 2018 19:45:10 +0000 (15:45 -0400)]
Correct permissions for systemtap.interactive/*.exp expect test files.

6 years agoCorrect the permissions for interrupts-by-dev.* example files.
William Cohen [Thu, 6 Sep 2018 19:43:19 +0000 (15:43 -0400)]
Correct the permissions for interrupts-by-dev.* example files.

6 years agotapset/errno.stp: learn about CONTEXT->sregs
Frank Ch. Eigler [Wed, 5 Sep 2018 20:59:09 +0000 (16:59 -0400)]
tapset/errno.stp: learn about CONTEXT->sregs

In case the syscalls.* aliases fall back to the tp_* variant, allow
the returnval() and returnstr() functions in errno.stp to also look
at the CONTEXT->sregs pt_regs.  (NB: the returnstr() function
is distinct from the return_str variable set by probe aliases).

6 years agoParentheses after unary '&' with a target-symbol expression is now accepted
Yichun Zhang [Fri, 24 Aug 2018 03:22:30 +0000 (20:22 -0700)]
Parentheses after unary '&' with a target-symbol expression is now accepted

The translator did not allow stap expressions like `&(@var("foo"))`.

Added quite some tests to cover various use cases of the unary '&'
address-taking operator.

Updated NEWS to document this change.

6 years agoAdd _NR_* defines for syscalls that older kernels do not have
William Cohen [Wed, 5 Sep 2018 18:23:51 +0000 (14:23 -0400)]
Add _NR_* defines for syscalls that older kernels do not have

Older RHEL7 kernels do not implement syscalls for mlock2 et. al. and
there are no matching __NR_* defines for those missing syscalls.
Adding default defines so systemtap tapsets will work on these older
kernels.

6 years agoMinor Tcl code tweaks in the test_simple module
Yichun Zhang (agentzh) [Wed, 5 Sep 2018 17:29:16 +0000 (10:29 -0700)]
Minor Tcl code tweaks in the test_simple module

6 years agoMake -Wno-tautological-compare optional
Frank Ch. Eigler [Wed, 5 Sep 2018 16:49:15 +0000 (12:49 -0400)]
Make -Wno-tautological-compare optional

Older versions of gcc don't support this flag.

6 years agoPR23160,PR14690: fix more undeclared macro errors
Jafeer Uddin [Wed, 5 Sep 2018 14:05:28 +0000 (10:05 -0400)]
PR23160,PR14690: fix more undeclared macro errors

Moved contents of aux2_syscall.stp to aux_syscall.stp. Since the
contents of aux2_syscall.stp are going to be used by all syscalls,
doing this will cause aux_syscall.stp to always be included and so
will the header files containing the macros that are #included in
aux_syscall.stp.

6 years agoUpdate all my recently committed test files to use the new test_simple Tcl module
Yichun Zhang (agentzh) [Wed, 5 Sep 2018 03:26:49 +0000 (20:26 -0700)]
Update all my recently committed test files to use the new test_simple Tcl module

6 years agoAdd new Tcl/DejaGnu test module test_simple to simplify tests
Yichun Zhang (agentzh) [Tue, 4 Sep 2018 22:06:35 +0000 (15:06 -0700)]
Add new Tcl/DejaGnu test module test_simple to simplify tests

Ported the handy routines is(), isnt(), like(), unlike(), ok(), nok()
from Perl's Test::Simple module over to Tcl/DejaGnu as the test_simple
module. Also added the run_cmd_2way command to this module to run
an arbitrary shell command and to fetch the stderr, stdout, and exit
code from it.

Make use of these new test helpers in the return_no_val.exp and
ternary_op.exp test files to demonstrate its usage. It makes these test
files much simpler by avoiding a lot of boilerplate Tcl code.

The remaining test files I committed recently would get updated in
separate patches just to prevent this patch from getting too large.

6 years agoREADME: mention "make rpm" as possible build alternative
Frank Ch. Eigler [Tue, 4 Sep 2018 16:24:42 +0000 (12:24 -0400)]
README: mention "make rpm" as possible build alternative

6 years agoPR23160,PR14690: adapt 31 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Tue, 4 Sep 2018 15:16:11 +0000 (11:16 -0400)]
PR23160,PR14690: adapt 31 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoNEWS: mention stap-exporter
Frank Ch. Eigler [Mon, 3 Sep 2018 18:26:17 +0000 (14:26 -0400)]
NEWS: mention stap-exporter

6 years agoAdd support for return statements without values
Yichun Zhang (agentzh) [Sat, 25 Aug 2018 00:37:33 +0000 (17:37 -0700)]
Add support for return statements without values

For user-defined stap functions which do not return any values, it can
be convenient to allow *bare* return statements to take shortcuts in
the control flow of the function body.

The parser treats a following semicolon (';') or a closing curly bracket
('}') as a terminator for such bare return statements.

Added tests to cover various cases like use of plain 'return' in a
function actually returning some values. Also added tests to make sure
the pretty-printer adds a trailing semicolon for such bare return
stateuments for various arrangements. Both the "kernel" and "dyninst"
runtimes are covered.

A fix for the bpf translator is also included.

Updated NEWS to document this new feature.

6 years agoAvoid long lines in some test files.
Yichun Zhang (agentzh) [Fri, 31 Aug 2018 22:00:31 +0000 (15:00 -0700)]
Avoid long lines in some test files.

Updated tautological_cmp.exp and ternary_op.exp.

6 years agostap-exporter: add examples to default
Aaron Merey [Fri, 31 Aug 2018 20:34:18 +0000 (16:34 -0400)]
stap-exporter: add examples to default

* EXAMPLES/profiling: add prometheus probes to errno.stp, timeout.stp
and topsys.stp
* stap-exporter/default: add errno.stp timeout.stp, topsys.stp and
syscalllatency.stp scripts

6 years agoAdd new built-in tapset function abort()
Yichun Zhang (agentzh) [Fri, 24 Aug 2018 01:06:54 +0000 (18:06 -0700)]
Add new built-in tapset function abort()

The new built-in tapset function abort() is similar to exit(), but it
aborts the current probe handler (and any function calls in it) immediately.
It works with both the kernel and dyninst runtimes. The bpf runtime is not
yet supported.

Unlike error(), abort() cannot be caught by try {...} catch {...}.

Similar to exit(), abort() yeilds the zero process exit code.

fche thinks it is already too late to change the current behavior of
exit(), hence this new function. And he suggests the function name abort().

Also added corresponding tests for both abort() and exit(), including
tests for probe timer.profile + abort(), as suggested by fche. The tests
cover both the kernel and dyninst runtimes wherever possible.

This new function can be disabled by the '--compatible 3.3' option. Also
added tests for this.

Updated NEWS for this new feature.

6 years agoPR23160,PR14690: fix undeclared __NR_* macro error with tp_syscall.* probes
Jafeer Uddin [Fri, 31 Aug 2018 16:36:58 +0000 (12:36 -0400)]
PR23160,PR14690: fix undeclared __NR_* macro error with tp_syscall.* probes

6 years agoCorrect whythefail.meta test_check.
William Cohen [Fri, 31 Aug 2018 14:30:41 +0000 (10:30 -0400)]
Correct whythefail.meta test_check.

6 years agoUse returnval() rather than $return for various syscall tapset probes
William Cohen [Fri, 31 Aug 2018 14:09:31 +0000 (10:09 -0400)]
Use returnval() rather than $return for various syscall tapset probes

With newer linux 4.17 kernel some of the syscall tapset return probes
do not have $return available.  The example scripts have been changed
to use returnval() function instead of the missing $return.

6 years agoprometheus sample: syscallerrorsbypid.stp: add execname, fix cleanup
Frank Ch. Eigler [Fri, 31 Aug 2018 13:32:25 +0000 (09:32 -0400)]
prometheus sample: syscallerrorsbypid.stp: add execname, fix cleanup

Follow the lead ofsyscallsbypid.stp.  Add to stap-exporter defaults.

6 years agoUse a more stable function name for running the linetimes.stp tests
William Cohen [Thu, 30 Aug 2018 21:17:16 +0000 (17:17 -0400)]
Use a more stable function name for running the linetimes.stp tests

There have a been a number of changes in the Linux 4.17 kernel syscall
function names and a function named sys_nanosleep no longer exists in
the newer kernels.  Adjusting the tests to use similar function that
is less likely to be affected from the syscall name changes.

6 years agoHave whythefail.stp probe a function that's name has not changed
William Cohen [Thu, 30 Aug 2018 21:05:58 +0000 (17:05 -0400)]
Have whythefail.stp probe a function that's name has not changed

The Linux 4.17 kernel has made a number of changes in the syscall
function names.  These changes caused the whythefail.stp test to fail.
Rather than probing the sys_open function which no longer exists in
the 4.17 kernels the tests are now using the do_sys_open function
which remains the same.

6 years agoUse returnval() for syscalls.*.return in pstree.stp
William Cohen [Thu, 30 Aug 2018 19:37:22 +0000 (15:37 -0400)]
Use returnval() for syscalls.*.return in pstree.stp

Changes to the syscall tapsets make it much more likely to get
syscall.*.return probe points that do not have the $return target
variable available.  Using the returnval() function to get the return
value via the ptreg avoids this issue.

6 years agoBZ1619413: permit rpm brp_mangle, except for .stp files
Frank Ch. Eigler [Thu, 30 Aug 2018 19:01:47 +0000 (15:01 -0400)]
BZ1619413: permit rpm brp_mangle, except for .stp files

Other mangling is necessary on some distros.

6 years agoMigrate THIS->__retvalue to STAP_RETVALUE in tapset
Zexuan Luo [Tue, 28 Aug 2018 19:25:28 +0000 (15:25 -0400)]
Migrate THIS->__retvalue to STAP_RETVALUE in tapset

Some tapset functions (without /* unmangled */ mark) still use
old-style 'THIS->' syntax. Let's migrate them to the new style.

6 years agoMinor fixes in test files at_var_print.exp & tautological_cmp.exp
Yichun Zhang (agentzh) [Tue, 28 Aug 2018 18:08:04 +0000 (11:08 -0700)]
Minor fixes in test files at_var_print.exp & tautological_cmp.exp

Fixed issues where we failed to interpret the macro variable $^PWD in
the .stp template files and we incorrectly treats any stap runs with
stderr output a failed run (i.e., with nonzero exit code). Also made
some other minor improvements.

6 years agoMake the 3rd operand of ternary '?:' bind tighter than binary '='
Yichun Zhang (agentzh) [Mon, 27 Aug 2018 22:50:24 +0000 (15:50 -0700)]
Make the 3rd operand of ternary '?:' bind tighter than binary '='

In the C language, the 3rd operand of the ternary operator binds tighter
than the binary assignment operators. It is better for the stap language
to be consistent with C in operator precedence.

Added several tests to check the precedence of the ternary operator,
including nested ternary operator expressions. I've verified the results
with similar C programs with gcc myself.

Fixed an existing test case under systemtap.examples/, ansi_colors2.stp,
which incorrectly assumed that `+=` binds tighter than the 3rd operand
of the ternary operator.

The original behavior can be restored by the --compatible 3.3 option.

Updated NEWS to reflect this backward-incompatible change in the parser.

6 years agosysc_fstat.stp typo fix
Frank Ch. Eigler [Mon, 27 Aug 2018 18:59:46 +0000 (14:59 -0400)]
sysc_fstat.stp typo fix

6 years agoPR23572 workaround: add an alarm() around some dyninst infrastructure calls
Frank Ch. Eigler [Mon, 27 Aug 2018 16:59:42 +0000 (12:59 -0400)]
PR23572 workaround: add an alarm() around some dyninst infrastructure calls

Some calls have been observed to hang for no obvious reason.
An alarm(2) placed around these should at least let stapdyn
shut down (with an error), instead of just sitting there.

6 years agoPR23160,PR14690: adapt 36 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Mon, 27 Aug 2018 13:29:08 +0000 (09:29 -0400)]
PR23160,PR14690: adapt 36 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agoPass -Wno-tautological-compare when building kernel modules and dyninst DSO
Yichun Zhang (agentzh) [Thu, 23 Aug 2018 23:30:30 +0000 (16:30 -0700)]
Pass -Wno-tautological-compare when building kernel modules and dyninst DSO

Currently we always turn on -Wall and -Werror when compiling the kernel
module and the dyninst DSO. This causes compile-time errors when the user
input stap scripts contain inefficiencies like `a == a` or `a != a`, which
can be common for automatically generated stap code from naive tools.

6 years agoFix a bug in atvar_op::print: we did not output the module arg
Yichun Zhang (agentzh) [Thu, 2 Aug 2018 07:21:49 +0000 (00:21 -0700)]
Fix a bug in atvar_op::print: we did not output the module arg

This was an issue left by commit bd1fcba. My bad.

Also added some tests to cover this fix.

6 years agoMake syscallerrorsbypid.stp and syscalllatency.stp executable
William Cohen [Thu, 23 Aug 2018 19:51:41 +0000 (15:51 -0400)]
Make syscallerrorsbypid.stp and syscalllatency.stp executable

6 years agostap-exporter: add testsuite etc.
Frank Ch. Eigler [Thu, 23 Aug 2018 02:23:24 +0000 (22:23 -0400)]
stap-exporter: add testsuite etc.

Dejagnu tried but failed to cause complete self-hair-yankage,
so now we run stap-exporter, and send a variety of wget queries
to it to exercise autostart, keepalive, stop, etc.  stap-exporter
also cleans up any __foo.ko turds stap leaves in $cwd in case of
a "stap -m __foo" type invocation.

6 years agostapbpf/bpfinterp.cxx remove_tag(): avoid segfault on malformed tag
Serhei Makarov [Tue, 21 Aug 2018 21:08:37 +0000 (17:08 -0400)]
stapbpf/bpfinterp.cxx remove_tag(): avoid segfault on malformed tag

6 years agostap-exporter man page tweaks
Frank Ch. Eigler [Tue, 21 Aug 2018 20:02:46 +0000 (16:02 -0400)]
stap-exporter man page tweaks

my god, it's full of \s

6 years agoconfigury: let "make rpm" generate a timestamped Release: tag
Frank Ch. Eigler [Tue, 21 Aug 2018 19:48:43 +0000 (15:48 -0400)]
configury: let "make rpm" generate a timestamped Release: tag

6 years agostap-exporter: rework configuration
Frank Ch. Eigler [Wed, 15 Aug 2018 19:36:54 +0000 (15:36 -0400)]
stap-exporter: rework configuration

Stop hardcoding "stap --example URLPIECE" into the python module;
instead run the "URLPIECE" script from under the /etc/stap-exporter
directory.  This way, one can have some non-default stap options
added.  (The default set of scripts is stored in the default/
subdirectory in the source tree.)

Command line options for stap-exporter can now be overridden from a
/etc/sysconfig/stap-exporter file suitable for use by systemd
EnvironmentFile=.

Move scripts directory to /etc/stap-exporter; search *.stp files
systematically to compute candidate URLs; simplify implementation.

Expand the stap-exporter.8 man page.

stap-exporter/procfs: stop special "__prometheus" name mapping
There's no need to mangle the procfs parameter name.

6 years agoPR23480 oops: fix timing of exit phase
Serhei Makarov [Tue, 21 Aug 2018 17:22:53 +0000 (13:22 -0400)]
PR23480 oops: fix timing of exit phase

Unregistering probes can take a long time, which opens basic stapbpf
scripts to spurious termination. Will need to futher investigate
when it is that the parent stap process sends a spurious SIGINT,
but this fix appears to suffice.

* stapbpf/stapbpf.cxx (main): move exit phase after unregistration.

6 years agoMake library name format consistent with kprocess.exec names in also_ran.stp
William Cohen [Mon, 20 Aug 2018 18:44:12 +0000 (14:44 -0400)]
Make library name format consistent with kprocess.exec names in also_ran.stp

kprocess.exec filename were quoted, but the library names were not.
Adjusted the script to use quoted strings for the library names also
so all the prometheus output is consistent.

6 years agoNEWS: detail recent string improvements, more NEWS to come soon
Serhei Makarov [Mon, 20 Aug 2018 19:03:25 +0000 (15:03 -0400)]
NEWS: detail recent string improvements, more NEWS to come soon

6 years agoPR23480: handle SIGINT/SIGTERM differently during stapbpf exit phase
Serhei Makarov [Mon, 20 Aug 2018 18:48:07 +0000 (14:48 -0400)]
PR23480: handle SIGINT/SIGTERM differently during stapbpf exit phase

During an infinite loop in probe end {}, stapbpf was unresponsive to ^C.
Fixed by restoring the SIGINT handler and marking an exit phase before
running probe end, then exiting in response to ^C during the exit phase.

* stapbpf/stapbpf.cxx (exit_phase): new variable.
(interrupt_message): ditto.
(sigint): print message and exit immediately during exit phase.
(main): mark exit phase and restore disabled signal handlers.

6 years agoPR23160,PR14690: adapt 23 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit
Jafeer Uddin [Mon, 20 Aug 2018 15:33:19 +0000 (11:33 -0400)]
PR23160,PR14690: adapt 23 more syscalls for 4.17 __ARCH_sys_FOO and sys_enter/exit

6 years agotestsuite/systemtap.bpf: add bigmap1.stp as map stress test
Serhei Makarov [Fri, 17 Aug 2018 20:31:05 +0000 (16:31 -0400)]
testsuite/systemtap.bpf: add bigmap1.stp as map stress test

6 years agoPR21888 / 23510: make sure print() and println() tag their
Serhei Makarov [Fri, 17 Aug 2018 15:32:15 +0000 (11:32 -0400)]
PR21888 / 23510: make sure print() and println() tag their

* bpf-translate.cxx (visit_print_format): add a tag to synthesized format strings.
* stapbpf/bpfinterp.cxx (remove_tag): TODO note potential segfault to guard against later.
* testsuite/systemtap.bpf/bpf_tests/logging2.stp: new testcase for print()/println().

6 years agostapbpf cleanup :: unused translator code, variable types
Serhei Makarov [Fri, 17 Aug 2018 15:07:00 +0000 (11:07 -0400)]
stapbpf cleanup :: unused translator code, variable types

* bpf-translate.cxx (bpf_unparser::emit_store): using uninitialized memory
from the stack would be a potential data leak and is therefore forbidden
-- remove the commented out code. (Although we could zero the stack ourselves.)
* stapbpf/stapbpf.cxx (instantiate_map): the size_t vars should be rlim_t.

6 years agoFix a nsscommon.cxx compile problem on RHEL 7.
David Smith [Thu, 16 Aug 2018 21:08:03 +0000 (16:08 -0500)]
Fix a nsscommon.cxx compile problem on RHEL 7.

* nsscommon.cxx (have_san_match): Handle old versions of openssl (like on
  RHEL7) where the ASN1_STRING_get0_data() function doesn't exist.

6 years agotestsuite/systemtap.bpf :: check for correct output of stringN.stp tests
Serhei Makarov [Thu, 16 Aug 2018 18:52:33 +0000 (14:52 -0400)]
testsuite/systemtap.bpf :: check for correct output of stringN.stp tests

6 years agostapbpf instantiate_maps: portability fixup to %ul format
Serhei Makarov [Thu, 16 Aug 2018 16:48:14 +0000 (12:48 -0400)]
stapbpf instantiate_maps: portability fixup to %ul format

6 years agostapbpf maps, PR23407: increase BPF_MAXMAP_ENTRIES, ensure space with setrlimit
Serhei Makarov [Thu, 16 Aug 2018 15:38:27 +0000 (11:38 -0400)]
stapbpf maps, PR23407: increase BPF_MAXMAP_ENTRIES, ensure space with setrlimit

eBPF maps can be arbitrarily large, but they live in memlocked memory
which has a very low default maximum per-process.

This patch increases RLIMIT_MEMLOCK to allow larger maps, and
increases BPF_MAX_MAPENTRIES to 2048.

Since the rlimit is set separately for each process, impact on the
system should not be significant.

TODO: The exact amount by which to increase the rlimit is a matter for
some experimentation. In addition to the space for keys and values,
there is a per-entry overhead that may need to be tweaked upwards
based on further testing.

* bpf-internal.h (BPF_MAXMAPENTRIES): now bigger.
* stapbpf.cxx (instantiate_maps): increase RLIMIT_MEMLOCK before
  allocating maps, add diagnostic printfs.

6 years agoFix stap man page to reflect proper usage of --example option
Jafeer Uddin [Wed, 15 Aug 2018 20:08:42 +0000 (16:08 -0400)]
Fix stap man page to reflect proper usage of --example option

This page took 0.066792 seconds and 5 git commands to generate.