]> sourceware.org Git - systemtap.git/log
systemtap.git
4 years agoTapset: proc_mem_rss() now includes resident shared mem pages.
Yichun Zhang (agentzh) [Sat, 4 Jan 2020 00:09:07 +0000 (16:09 -0800)]
Tapset: proc_mem_rss() now includes resident shared mem pages.

The return value finally matches the VmRSS field in /proc/PID/status
now.

The old behavior can be restored by the --compatible=4.2 option
on the command line.

Thanks Dejiang Zhu for reporting this issue.

4 years agoNEWS: tweak 4.3 items
Frank Ch. Eigler [Mon, 30 Dec 2019 21:47:02 +0000 (16:47 -0500)]
NEWS: tweak 4.3 items

4 years agoThe "Build-id mismatch" error now becomes a warning
Yichun Zhang (agentzh) [Mon, 30 Dec 2019 21:33:59 +0000 (13:33 -0800)]
The "Build-id mismatch" error now becomes a warning

It is normal for different binaries with the same file path coexist in
the same system via chroot or namespaces, therefore we make sure
build-id mismatch is really a warning instead of an error which leads
to non-zero exit codes of staprun.

For safety, we still make sure we do not register uprobes and etc to
wrong binaries when the build-id check fails.

4 years agoBug: MAXACTION errors + try/catch would lead to wrong src loc.
Yichun Zhang (agentzh) [Mon, 30 Dec 2019 20:56:47 +0000 (12:56 -0800)]
Bug: MAXACTION errors + try/catch would lead to wrong src loc.

The MAXACTION error is not catchable but the try/catch code always
cleared its error message. Thus the source location reported was
inaccurate and always ended being the top-level try/catch statement's.

This patch fixes this issue.

4 years agoPR25265: fix strict-prototypes nit autoconf-stack-trace-save-regs.c
Craig Ringer [Sun, 29 Dec 2019 19:51:47 +0000 (14:51 -0500)]
PR25265: fix strict-prototypes nit autoconf-stack-trace-save-regs.c

4 years agobuild.cxx: stapconf_export.h: fixed the ko build on fedora 31.
Yichun Zhang (agentzh) [Sat, 21 Dec 2019 19:50:15 +0000 (11:50 -0800)]
build.cxx: stapconf_export.h: fixed the ko build on fedora 31.

This is a followup fix for commit efb03a3764.

4 years agobuildrun.cxx: close the file handle for stapconf_export.h explicitly
Yichun Zhang (agentzh) [Fri, 20 Dec 2019 23:48:50 +0000 (15:48 -0800)]
buildrun.cxx: close the file handle for stapconf_export.h explicitly

This is a followup fix for commit efb03a376.

4 years agoPR25290: process(EXE).begin probes might not get fired.
Yichun Zhang (agentzh) [Fri, 20 Dec 2019 23:11:16 +0000 (15:11 -0800)]
PR25290: process(EXE).begin probes might not get fired.

Occasionally the utrace callbacks might get called in the session state
of STAP_SESSION_STARTING so we have to be prepared to that otherwise
the user probe handler would never be called.

Also added a lot of debugging log output controlled by -DDEBUG_PROBES
and -DDEBUG_TASK_FINDER=LEVEL.

Thanks fche for the help.

4 years agoPR25298: stapbpf unused blocks may cause segfault
Sagar Patel [Thu, 19 Dec 2019 17:33:10 +0000 (12:33 -0500)]
PR25298: stapbpf unused blocks may cause segfault

The BPF optimizer removes unused blocks, however, it does not delete
all of the references to the deleted blocks. In the new implementation,
edges leading to the unused blocks are set as nullptr.

1) Set edges leading to unused blocks as nullptr.

4 years agotranslate.cxx: Make stap-symbols.h a separate CU.
Yichun Zhang (agentzh) [Wed, 18 Dec 2019 22:10:39 +0000 (14:10 -0800)]
translate.cxx: Make stap-symbols.h a separate CU.

This increases the kernel module compilation parallelism level.

The Pass-4 is now about 700ms faster when --ldd is used for a
simple .stp script file using print_ubacktrace() on an Intel
Core i9-9900K machine.

For the dyninst runtime, the new CU is still compiled into the
resulting .so file but this backend is not using the symbols yet
and the compilation is not parallelized.

Thanks fche for the review.

4 years agobuildrun.cxx: make the stapconf_xxx.h file generation process parallellable.
Yichun Zhang (agentzh) [Wed, 18 Dec 2019 20:10:05 +0000 (12:10 -0800)]
buildrun.cxx: make the stapconf_xxx.h file generation process parallellable.

This makes a typical .stp script's Pass-4 time reduces from 12.4s to
4.3s on a 8-core/16-thread system (Core i9-9900K) when stapconf_xxx.h
misses the cache.

Thanks fche for the review.

4 years agouprobes-inode: Add more debugging logs enabled by -DDEBUG_UPROBES.
Yichun Zhang (agentzh) [Wed, 18 Dec 2019 19:31:37 +0000 (11:31 -0800)]
uprobes-inode: Add more debugging logs enabled by -DDEBUG_UPROBES.

Also converted some existing dbug_otf() logging calls to the new
dbug_uprobes() macro.

Thanks fche for the help.

4 years agosession.cxx: Print MONITOR_LIBS in -V (version) feature list.
Frank Ch. Eigler [Wed, 18 Dec 2019 03:25:57 +0000 (22:25 -0500)]
session.cxx: Print MONITOR_LIBS in -V (version) feature list.

Give another hint to users as to the availability of the --monitor mode.

4 years agotapsets: multiple syscalls: __args type warnings
Frank Ch. Eigler [Wed, 11 Dec 2019 20:50:10 +0000 (15:50 -0500)]
tapsets: multiple syscalls: __args type warnings

The __args symbol is used in several socket-related syscalls as a
place to put a type-enhanced pointer - or rather as two different
pointers (ulong vs uint pointers).  This causes a stap warning.
Renaming this internal symbol avoids the warning.  More syscalls
undoubtedly affected!

4 years agotapset: tp_syscall.truncate typo fix
Frank Ch. Eigler [Wed, 11 Dec 2019 20:49:52 +0000 (15:49 -0500)]
tapset: tp_syscall.truncate typo fix

tuncate != truncate

4 years agotapset: _struct_compat_timex_u() support after renaming to old_timex32
Frank Ch. Eigler [Wed, 11 Dec 2019 20:28:46 +0000 (15:28 -0500)]
tapset: _struct_compat_timex_u() support after renaming to old_timex32

Kernel commit 4d5f007eedb74d (v5.1+) renames the old compat_timex
structure to old_timex32.

4 years agostap-prep: speculative ubuntu/buildbot fixes
Frank Ch. Eigler [Wed, 27 Nov 2019 21:01:05 +0000 (16:01 -0500)]
stap-prep: speculative ubuntu/buildbot fixes

Attempt to eradicate recurrence of an intermittent buildbot error seen
internally, wherein debconf was complaining about "TERM unset ..." and
"PATH unset" etc.

4 years agoconfigury: drop bundled-elfutils mode
Frank Ch. Eigler [Tue, 26 Nov 2019 23:25:20 +0000 (18:25 -0500)]
configury: drop bundled-elfutils mode

Bundling elfutils has only been necessary on systems that
lacked elfutils, and for some reason the normal autoconf
% LDFLAGS=-L/path/ CPPFLAGS=-I/path/ configure
trick didn't work.  This kludge is now obstructing us as
some distro build (koji rawhide!) systems presume that even
conditional sources are real sources, and lead to failure.

So long, bundled-elfutils build mode, and thanks for all the fish.

4 years agoPR25186: tweak vim augroup name for non-conflict with some vim versions
Frank Ch. Eigler [Sun, 24 Nov 2019 22:36:48 +0000 (17:36 -0500)]
PR25186: tweak vim augroup name for non-conflict with some vim versions

Renamed the "filetype" augroup to "stpfiletype".

4 years agobump more version numbers
Sagar Patel [Tue, 19 Nov 2019 16:35:38 +0000 (11:35 -0500)]
bump more version numbers

4 years agoamend bump of version numbers
Sagar Patel [Tue, 19 Nov 2019 00:18:14 +0000 (19:18 -0500)]
amend bump of version numbers

4 years agobump version numbers
Sagar Patel [Tue, 19 Nov 2019 00:15:20 +0000 (19:15 -0500)]
bump version numbers

4 years agoupdate NEWS release-4.2
Sagar Patel [Mon, 18 Nov 2019 20:36:41 +0000 (15:36 -0500)]
update NEWS

4 years agoregenerate examples index in testsuite/systemtap.examples
Sagar Patel [Fri, 15 Nov 2019 20:58:29 +0000 (15:58 -0500)]
regenerate examples index in testsuite/systemtap.examples

4 years agoupdate documentation using scripts/update-doc
Sagar Patel [Fri, 15 Nov 2019 20:55:53 +0000 (15:55 -0500)]
update documentation using scripts/update-doc

4 years agoupdate copyright year using scripts/update-copyright
Sagar Patel [Fri, 15 Nov 2019 20:37:45 +0000 (15:37 -0500)]
update copyright year using scripts/update-copyright

4 years agoPRERELEASE marker updates
Sagar Patel [Fri, 15 Nov 2019 20:29:13 +0000 (15:29 -0500)]
PRERELEASE marker updates

4 years agoprerelease: regenerate update-po
Frank Ch. Eigler [Sun, 17 Nov 2019 14:06:45 +0000 (09:06 -0500)]
prerelease: regenerate update-po

No more sapce anywhere

4 years agoconfigury BuildRequire: need only dyninst 10.0
Frank Ch. Eigler [Fri, 15 Nov 2019 22:29:53 +0000 (17:29 -0500)]
configury BuildRequire: need only dyninst 10.0

4 years agoSave entire register set for dyninst runtime on aarch64 and ppclle
Stan Cox [Fri, 15 Nov 2019 19:41:47 +0000 (14:41 -0500)]
Save entire register set for dyninst runtime on aarch64 and ppclle

Dyninst generated calls only allow register parms, so save register set in
chunks via successive calls to enter_dyninst_uprobe_regs:
arg1 = probe index arg2 = first regno in registers arg3... registers

* runtime/dyninst/uprobes-regs.c (enter_dyninst_uprobe_regs):  New
* stapdyn/mutatee.cxx (get_dwarf_registers):  Add aarch sp.  Don't prune
   ppcle and aarch64 register set.
  (mutatee::instrument_dynprobe_target):  Add dyninst snippet to generate
   calls to enter_dyninst_uprobe_regs

4 years agosession.cxx tested-kernel-versions liste: drop rhel5 2.6.18
Frank Ch. Eigler [Tue, 12 Nov 2019 19:56:18 +0000 (14:56 -0500)]
session.cxx tested-kernel-versions liste: drop rhel5 2.6.18

It's been a long time since we tested on rhel5; our c++11
transition probably nuked effective support.

4 years agoAUTHORS bump
Sagar Patel [Tue, 12 Nov 2019 19:41:01 +0000 (14:41 -0500)]
AUTHORS bump

4 years agobuildrun.cxx: adapt to kernel 5.4+
Frank Ch. Eigler [Tue, 12 Nov 2019 19:29:07 +0000 (19:29 +0000)]
buildrun.cxx: adapt to kernel 5.4+

Tracequery module building can't take the pre-5.4 _modules_/FOO
shortcut to building only the .o files any more.

4 years agocorrect filename in syscallsrw.stp description
Sagar Patel [Tue, 12 Nov 2019 19:22:52 +0000 (14:22 -0500)]
correct filename in syscallsrw.stp description

4 years agoupdate NEWS for PR24953
Sagar Patel [Tue, 12 Nov 2019 17:42:09 +0000 (12:42 -0500)]
update NEWS for PR24953

4 years agoruntime/tapset: gcc9 /*fallthrough*/ pass
Frank Ch. Eigler [Tue, 12 Nov 2019 16:31:09 +0000 (16:31 +0000)]
runtime/tapset: gcc9 /*fallthrough*/ pass

Mark up a few more locations where gcc9 on fedora rawhide has
had a cow about intentional fallthroughs in switch/case statements.

4 years agotestsuite/busybox.exp: tweak
Frank Ch. Eigler [Tue, 12 Nov 2019 16:30:09 +0000 (16:30 +0000)]
testsuite/busybox.exp: tweak

Run inferior make only partially, to build the target binary
and not any aux doc stuff (which buildrequires pod2html e.g.).
Tweak separate pass/fail messages to disambiguate $test.

4 years agoconfigury: default to --enable-pie
Frank Ch. Eigler [Mon, 11 Nov 2019 23:11:52 +0000 (23:11 +0000)]
configury: default to --enable-pie

On fedora rawhide, -fpic/-fpie flags are sneaking in all over
the place, so plain configure/make stap builds can break if
we don't build everything that way too.  So flip around --enable-pie
to default-on.  Sorry, PR9922 (2009).

4 years agorelevant to PR25168: add user_string to bpf tapsets, x86_64 only
Serhei Makarov [Fri, 8 Nov 2019 16:46:41 +0000 (11:46 -0500)]
relevant to PR25168: add user_string to bpf tapsets, x86_64 only

previously noted https://lwn.net/Articles/803587/

After some discussion with fche, I added user_string() but for x86_64 only.
After bpf_probe_read_user() helpers are added, can extend to other architectures.

* tapset/bpf/conversions.stp (kernel_string, kernel_string_n):
  note probe_read_str() future deprecation, fix error msg.
* tapset/uconversions.stp (user_string_n): add BPF variants.
(user_string_n_warn): add BPF variant.
* testsuite/systemtap.bpf/bpf.exp: launch /usr/bin/sleep to probe start of main().
* testsuite/systemtap.bpf/bpf_tests/user_string.stp: new testcase.

4 years agoPR25174: support string auto-concat more thoroughly
Frank Ch. Eigler [Thu, 7 Nov 2019 20:40:38 +0000 (15:40 -0500)]
PR25174: support string auto-concat more thoroughly

The @const, @var, and @cast operators took strings that were not
subject to the usual auto-concatenation of adjacent string literals.
Fixed by calling consume_string_literals() in parser::expect_unknown().
(Sibling functions nearby are not called with tok_string so are
currently unaffected.)

4 years agoruntime gen-map.c: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough
Frank Ch. Eigler [Thu, 7 Nov 2019 18:47:34 +0000 (13:47 -0500)]
runtime gen-map.c: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough

4 years agostapbpf PR25169 initial fix: strcpy overlap between transport arg and string on-stack
Serhei Makarov [Wed, 6 Nov 2019 21:06:57 +0000 (16:06 -0500)]
stapbpf PR25169 initial fix: strcpy overlap between transport arg and string on-stack

4 years agoPR24812: support order-parametrized begin/end probes
Sagar Patel [Fri, 25 Oct 2019 18:18:24 +0000 (14:18 -0400)]
PR24812: support order-parametrized begin/end probes

It was found that begin probes were already order parameterized but,
end probes were not. The end probes were being added using a reverse
iterator which made them run in the wrong order. This patch fixes
this by replacing the reverse iterator with a normal iterator.

1) Replaced reverse iterator with normal iterator.
2) Added testcase which checks for correct running order.
3) Updated NEWS.

4 years agoPR25133: fix stabpf foreach loop segfault
Sagar Patel [Fri, 25 Oct 2019 17:08:12 +0000 (13:08 -0400)]
PR25133: fix stabpf foreach loop segfault

There was a foreach loop example that was observed to cause a
segmentation fault. After some investigation, it was found that
one of the registers was clobbered in the optimization process.

This patch modifies the register interference implementation.
Previously, variables that were defined at an instruction were
not considered in the register interference graph. However, by
defintion, a variable is live where it is defined and wherever
it holds a value that is used in the future. With this patch,
the register interference graph also takes into account where
the variables are defined, and considers them to be live.

1) Included variables that are being defined in live set.
2) Split foreach_string.stp test probes to accomodate for stack size.

4 years agoPR24953 Fix: check for existence of value symbol
Sagar Patel [Thu, 24 Oct 2019 21:05:08 +0000 (17:05 -0400)]
PR24953 Fix: check for existence of value symbol

In commit 724b7014a, the code assumed that the foreach loop
structure always had a valid value symbol. However, this is
not true. Consider the following examples:

foreach loop (k in arr) ...
foreach loop (v = k in arr) ...

In the former case, the loop is only iterating over the keys
whereas in the latter case, both the key and value are being
iterated over. Consequently, the former loop will have a
nullptr value symbol.

This patch provides a fix by checking for the existence of a
value symbol and generating the BPF instructions accordingly.

4 years agoRevert some parts of commit 1d3e6fd90
Sagar Patel [Thu, 24 Oct 2019 20:49:12 +0000 (16:49 -0400)]
Revert some parts of commit 1d3e6fd90

Some of the bpf-translation.cxx code was deleted accidentally. This
caused the raw_tracepoint1.stp test to fail as the context variables
could not be resolved.

4 years agoPR25113: correct typo in beginner's guide
Frank Ch. Eigler [Mon, 21 Oct 2019 20:52:30 +0000 (16:52 -0400)]
PR25113: correct typo in beginner's guide

A sample file name was incorrect in the text.

4 years agoPR25107: -v -L options print duplicate probe points
Sagar Patel [Wed, 16 Oct 2019 22:34:47 +0000 (18:34 -0400)]
PR25107: -v -L options print duplicate probe points

With this option combination, duplicate probe points are now included
along with their PC addresses which act as discriminators. For example,
a probe that refers to a function that is inlined in multiple places
will appear multiple times in the output with different PC addresses.

1) Modified functionality of -v -L option combination.
2) Nested printing can now be disabled in printsig(...).

4 years agoconfigure.ac :: default --with-python3=auto to handle Python3-only systems
Serhei Makarov [Tue, 15 Oct 2019 19:48:30 +0000 (15:48 -0400)]
configure.ac :: default --with-python3=auto to handle Python3-only systems

4 years agoadd test to examine impact of LTO on debuginfo
Sagar Patel [Wed, 9 Oct 2019 21:12:55 +0000 (17:12 -0400)]
add test to examine impact of LTO on debuginfo

The test uses BusyBox binaries which are compiled with (-g) and
(-g -flto -ffat-lto-objects). It can be observed that when LTO
is enabled, SystemTap is unable to probe some functions and that
some probe points have source file name mismatches.

4 years agorhbz1741831: support arm64 with linux/sched.h include order
Frank Ch. Eigler [Wed, 2 Oct 2019 14:50:15 +0000 (10:50 -0400)]
rhbz1741831: support arm64 with linux/sched.h include order

On some arm64 kernels, <linux/sched.h> needs to be #include'd
ahead of <asm/*> bits in our autoconf-* tests, or else things
break.  New variant tested on these kernels plus x86-64 f30.

4 years agostapbpf PR23478:: Initial support to allow use of multi-dimensional arrays.
William Cohen [Tue, 20 Aug 2019 20:18:41 +0000 (16:18 -0400)]
stapbpf PR23478:: Initial support to allow use of multi-dimensional arrays.

The patch allows multi-dimensional arrays to be used lhs and rhs
expression.  It also allows deletion and check of existence of
particular elements with multi-dimensional key values.  However, this
patch does not support foreach statements with multi-dimensional
arrays.  Now something like the following trivial example works with
the bpf backend:

 sudo ../install/bin/stap --bpf   -v -e 'global x; probe begin{ x[4,2] = 2; x[2,4]= -2; exit()} probe end{ printf("%d ", x[4,2]); printf("%d ", x[3,3]); printf("%d ", x[2,4])}'
Pass 1: parsed user script and 51 library scripts using 250084virt/23932res/9000shr/14756data kb, in 10usr/0sys/15real ms.
Pass 2: analyzed script: 2 probes, 3 functions, 0 embeds, 1 global using 250084virt/23932res/9000shr/14756data kb, in 0usr/0sys/0real ms.
Pass 3: pass skipped for stapbpf runtime in 0usr/0sys/0real ms.
Pass 4: compiled BPF into "stap_29813.bo" in 0usr/0sys/0real ms.
Pass 5: starting run.
2 0 -2 Pass 5: run completed in 0usr/0sys/3real ms.

4 years agotweak stap --help text
Frank Ch. Eigler [Sat, 28 Sep 2019 00:45:31 +0000 (20:45 -0400)]
tweak stap --help text

Fix a typo.

4 years agoPR24953: fix foreach (v = v1 in arr) loop behaviour
Sagar Patel [Wed, 25 Sep 2019 22:29:19 +0000 (18:29 -0400)]
PR24953: fix foreach (v = v1 in arr) loop behaviour

Previously, keys were correctly propagated to foreach loops, however,
values were defaulted to 0. The new implementation allows values to
be propagated along with the keys.

1) Added instructions to load corresponding values.
2) Added block to check for invalid key/value pairs.
3) Added test which checks for correct key/value pairs.

4 years agoRevise inodewatch2.stp to work on a wider range of kernels and filesystems
William Cohen [Wed, 25 Sep 2019 14:58:11 +0000 (10:58 -0400)]
Revise inodewatch2.stp to work on a wider range of kernels and filesystems

The inodewatch2.stp instrumented specific functions that actually
changed the the mode of the inode.  Depending on the file system used
the orginally instrumented functions would miss chmod operations on
some file systems.  Moved the instrumentation to the common
notify_change function that all the operations go through.

4 years agocache.cxx: fix 64-bit time_t differently
Frank Ch. Eigler [Thu, 5 Sep 2019 18:05:16 +0000 (14:05 -0400)]
cache.cxx: fix 64-bit time_t differently

Always narrow %ld parameter to (long) instead of
conditional-compilation alternatives.

4 years agoconfigury: regenerate after configure.ac changes
Frank Ch. Eigler [Thu, 5 Sep 2019 18:05:03 +0000 (14:05 -0400)]
configury: regenerate after configure.ac changes

4 years agocache.cxx: Fix errors on x32 builds
Richard Purdie [Thu, 5 Sep 2019 13:41:54 +0000 (14:41 +0100)]
cache.cxx: Fix errors on x32 builds

Fix time_t print because in x32 ABI is long long int instead of long int.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agoconfigure: Remove explicit msgfmt check
Ross Burton [Thu, 5 Sep 2019 13:41:53 +0000 (14:41 +0100)]
configure: Remove explicit msgfmt check

There is no need to explicitly check that msgfmt was found as the gettext macros
handle this for us if NLS is enabled.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agoconfigure: Allow explicit configuration of the monitor
Ross Burton [Thu, 5 Sep 2019 13:41:52 +0000 (14:41 +0100)]
configure: Allow explicit configuration of the monitor

Add an option to explicitly disable the monitor (and therefore the dependency on
json-c and ncurses) with the aim of deterministic builds.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agoconfigure: Allow to disable libvirt
Wenzong Fan [Thu, 5 Sep 2019 13:41:51 +0000 (14:41 +0100)]
configure: Allow to disable libvirt

Rather than just autodetecting libvirt allow it to be explictly disabled even
if present (important for reproducibile builds).

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agoruntime: 5.2 and later kernels removed get_ds() on arm and other architectures
Richard Purdie [Thu, 5 Sep 2019 13:13:13 +0000 (09:13 -0400)]
runtime: 5.2 and later kernels removed get_ds() on arm and other architectures

https://github.com/torvalds/linux/commit/736706bee3298208343a76096370e4f6a5c55915

Add in a fallback so systemtap works on arm in these cases.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
4 years agobuildrun: adapt to loss of "flags" filter in linux scripts/Kbuild.include
Frank Ch. Eigler [Wed, 4 Sep 2019 18:03:43 +0000 (14:03 -0400)]
buildrun: adapt to loss of "flags" filter in linux scripts/Kbuild.include

This $(call filter,...) was used since 2008 to pass KBUILD_CFLAGS
through a mechanism that preserved O= data somehow.  But this
filter is gone from the kernel as of commit cdd750bf, so add a
fallback for the filtered $KBUILD_CFLAGS directly.

Reported-By: RP on #systemtap
4 years agoPR24947, PR24946: check for valid hex and octal sequences
Sagar Patel [Thu, 29 Aug 2019 15:44:30 +0000 (11:44 -0400)]
PR24947, PR24946: check for valid hex and octal sequences

Hex escape sequences no longer causes scripts to crash on stapbpf,
and checks have been added to ensure valid sequence ranges.

1) Fixed incorrect looping of hex sequences.
2) Added octal sequence range check: o < \400.
3) Added hex sequence range check: h < \x100.

4 years agoPR23285 (2): enable prometheus-exporter type scripts on stapbpf
Sagar Patel [Thu, 29 Aug 2019 15:40:21 +0000 (11:40 -0400)]
PR23285 (2): enable prometheus-exporter type scripts on stapbpf

The eBPF backend now supports prometheus-exporter scripts. This implementation
introduces character escaping macros enabling the array dump macros on stapbpf.
However, there are some issues with foreach loops which are used in the macros
(PR24953).

1) Developed character escaping macros helper functions.
2) Added prometheus probe tapset for stapbpf.
3) Added stapbpf procfs file path to stap-exporter.
4) Introduced a sample stapbpf prometheus-exporter script in EXAMPLES.
5) Updated NEWS.

4 years agoPR24926: correct printing of utf-8 characters on stapbpf
Sagar Patel [Thu, 29 Aug 2019 15:32:17 +0000 (11:32 -0400)]
PR24926: correct printing of utf-8 characters on stapbpf

There were two bugs corrupting the string bytes and instructions. The
first bug involved the implicit sign extension of negative char values.
The second bug involved a faulty optimization (fixup_operands) which
used the incorrect instruction opcode.

1) Cast char to unsigned char before casting to uint32_t.
2) Changed opcode of optimized instruction to (BPF_STX | BPF_MEM | BPF_W).

4 years agoenable concatenation operator for stapbpf userspace probes
Sagar Patel [Thu, 29 Aug 2019 15:30:05 +0000 (11:30 -0400)]
enable concatenation operator for stapbpf userspace probes

4 years agokernel tracepoints: support afs, rxrpc, siox tracepoints for kernel 5.2
Frank Ch. Eigler [Sat, 31 Aug 2019 20:24:42 +0000 (16:24 -0400)]
kernel tracepoints: support afs, rxrpc, siox tracepoints for kernel 5.2

Added the usual forward-declarations or such for incomplete
tracepoint header files into tracepoint_extra_decls().

4 years agorhbz1731333: nfsd.proc.write, tolerate awol 'vlen'
Frank Ch. Eigler [Thu, 29 Aug 2019 22:18:59 +0000 (18:18 -0400)]
rhbz1731333: nfsd.proc.write, tolerate awol 'vlen'

This variable has disappeared from the kernel via commit
8154ef2776aa512a3eaa0e7db030dc4803354d61.  Substitute a 0.

4 years agodyninst configury: require 10.1+ but permit ppc64le and aarch64
Frank Ch. Eigler [Wed, 28 Aug 2019 12:31:02 +0000 (08:31 -0400)]
dyninst configury: require 10.1+ but permit ppc64le and aarch64

Modern dyninst works okay on ppc64le and aarch64.

4 years agostapbpf: correct 32-bit handling of EXIT bpf-map value type
Frank Ch. Eigler [Fri, 23 Aug 2019 23:23:13 +0000 (19:23 -0400)]
stapbpf: correct 32-bit handling of EXIT bpf-map value type

The bpf bytecode declares a 4byte->8byte map for the shared globals;
the userspace must use a 64-bit type to receive those values, lest
it suffer a most unfortunate stack smash.

4 years agotestsuite procfs_bpf.exp: tolerate stapbpf early exit
Frank Ch. Eigler [Fri, 23 Aug 2019 15:26:06 +0000 (11:26 -0400)]
testsuite procfs_bpf.exp: tolerate stapbpf early exit

It was observed on some platforms that the stap/bpf test case could
abort so quickly that the dejagnu (tclsh) code to open the bpf/procfs
pipes could itself hang - and indefinitely!  Replaced these tclsh
level ops with a /bin/timeout-wrapped echo or cat operation.

4 years agoPR23879, PR24875: fix task-finder-vma on f29+
Frank Ch. Eigler [Wed, 21 Aug 2019 23:29:45 +0000 (19:29 -0400)]
PR23879, PR24875: fix task-finder-vma on f29+

It was reported & rediscovered that some vma-dependent runtime
facilities have been broken: @vma() and *ubacktrace().  It turns out
that modern gcc/ld.so links/loads binaries in slightly different ways
than older toolchains.  Specifically, the first page of ELF files is
now loaded only r--p instead of r-xp protection flags.  The
_stp_vma_mmap_cb() routine now accepts the r--p case too.  It now
ignores the flags entirely.

5 years agoPR24904: support linux 5.2's stacktrace.c changes with -DDEBUG_UNWIND too
Frank Ch. Eigler [Wed, 21 Aug 2019 02:17:02 +0000 (22:17 -0400)]
PR24904: support linux 5.2's stacktrace.c changes with -DDEBUG_UNWIND too

5 years agoPR24904: support linux 5.2's stacktrace.c changes
Frank Ch. Eigler [Wed, 21 Aug 2019 01:20:40 +0000 (21:20 -0400)]
PR24904: support linux 5.2's stacktrace.c changes

The following kernel commit disabled the older struct stack_trace APIs
on architectures that support the newer stackwalk APIs.  Provide an
adaptation layer to stack_trace_save_regs().

commit 214d8ca6ee854f696f75e75511fe66b409e656db
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Thu Apr 25 11:45:21 2019 +0200

    stacktrace: Provide common infrastructure

5 years agostapbpf PR23858 :: support sorting by value in foreach loop
Serhei Makarov [Thu, 15 Aug 2019 15:09:06 +0000 (11:09 -0400)]
stapbpf PR23858 :: support sorting by value in foreach loop

Previously stapbpf's behaviour on this was wrong.
This slightly nightmarish bit of code handles more cases.
XXX Also need to take into account s->sort_aggr for statistics aggregates
-- currently unsupported.

To support nested foreach loops, map_get_next_key was changed to take & return
addresses-of string addresses rather than string addresses. Previously
we'd need to allocate and copy multiple string keys onto one tiny stack,
which is not feasible.

* bpf-internal.h (SORT_FLAGS): New define packs sort_column, sort_direction in one word.
  (GET_SORT_COLUMN): New define unpacks sort_column from SORT_FLAGS.
  (GET_SORT_DIRECTION): New define unpacks sort_direction from SORT_FLAGS.
* bpf-translate.cxx (bpf_unparser::visit_foreach_loop): String key/value iteration,
  hardcode keysize on stack to 8bytes (either an int or an address of a string),
  check for sort_aggr (UNSUPPORTED),
  pack sort_column and sort_direction into sort_flags,
  properly handle returned address of a string.
* stapbpf/bpfinterp.cxx (map_int_keys, map_str_keys): Remove typedefs.
  (struct map_keys): Nightmare begins. Support 4 cases of int/str keys/values.
  (convert_int_key, convert_str_key, convert_int_kp, convert_str_kp): More nightmare,
  handle different cases of packing/unpacking BPF key/val into C++ key/val.
  (convert_key, convert_kp): More nightmare. 'Overload' pack/unpack for ANY key/val.
  (compute_key_size): More nightmare. Calculate memory required for a key.
  (map_sort): New function handles initial sorting of map.
  (map_next): New function handles retrieval from sorted map.
  (map_get_next_key): Handle sorted int/str keys/values on different columns,
  now takes strings to give a place to allocate returned str key/vals
  that is not on the BPF stack.
  (bpf_intepret): Pass strings to map_get_next_key.

* testsuite/systemtap.bpf/bpf_tests/foreach_string.stp: Enable full testcase.
* testsuite/systemtap.bpf/bpf_tests/foreach_pr23858.stp: New testcase.

5 years agobpf_translate.cxx :: fix another segfault in visit_delete_statement
Serhei Makarov [Thu, 15 Aug 2019 15:02:59 +0000 (11:02 -0400)]
bpf_translate.cxx :: fix another segfault in visit_delete_statement

5 years agostapbpf: 32-bit build tweaks
Frank Ch. Eigler [Tue, 13 Aug 2019 19:36:25 +0000 (15:36 -0400)]
stapbpf: 32-bit build tweaks

On 32-bit hosts, uint64_t != unsigned long .

5 years agoPR23285: stapbpf/procfs: use effective-userid consistently
Frank Ch. Eigler [Tue, 13 Aug 2019 19:08:41 +0000 (15:08 -0400)]
PR23285: stapbpf/procfs: use effective-userid consistently

The euid is easy and consistent in the construction of the
stapbpf/procfs path name.  Use the umask() field at least for
the fifo nodes (should also on the parent directory probably).
For the stapbpf -v case, print some fifo-related diagnostics.
Split out the .stp test case into a separate file, for easier
hand-execution.

5 years agoexpliclity show pass3 for -v on bpf runtime
Sagar Patel [Fri, 9 Aug 2019 21:20:22 +0000 (17:20 -0400)]
expliclity show pass3 for -v on bpf runtime

5 years agoPR23285 (1): enable procfs probes for stapbpf
Sagar Patel [Thu, 8 Aug 2019 19:40:10 +0000 (15:40 -0400)]
PR23285 (1): enable procfs probes for stapbpf

The eBPF backend now supports procfs probes. This implementation
uses FIFO special files instead of proc filesystem files. The file
path format used is /var/tmp/systemtap-USER/MODNAME. One limitation
is that both read and write probes cannot exist for the same file.

1) Added procfs probe data structures to hold probe information.
2) Created an interface between target variables and eBPF interpreter.
3) Dedicated a single thread for each file which monitors for I/O.
4) Developed a cleaning routine and error handling mechanisms.
5) Updated NEWS and man pages.

small fix

new procfs_bpf test

5 years agorhbz1737589: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough
Frank Ch. Eigler [Sun, 11 Aug 2019 15:00:27 +0000 (15:00 +0000)]
rhbz1737589: add /* fallthru */ to satisfy gcc 9's -Wimplicit-fallthrough

We need annotate switch statements with deliberate case-to-case fallthroughs.

5 years agoAdd example using the test_check_dyninst and test_installcheck_dyninst.
William Cohen [Wed, 7 Aug 2019 14:55:39 +0000 (10:55 -0400)]
Add example using the test_check_dyninst and test_installcheck_dyninst.

5 years agotestsuite/systemtap.examples :: add test_{,install}check_dyninst tag to check.ex
William Cohen [Wed, 7 Aug 2019 14:54:00 +0000 (10:54 -0400)]
testsuite/systemtap.examples :: add test_{,install}check_dyninst tag to check.ex
p

5 years agostapbpf pr24811 test :: also test non-constant iteration limit in foreach.stp
Serhei Makarov [Wed, 31 Jul 2019 17:29:48 +0000 (13:29 -0400)]
stapbpf pr24811 test :: also test non-constant iteration limit in foreach.stp

5 years agostapbpf pr23875 bugfix :: allocate actual keysize in foreach to avoid stack clobber
Serhei Makarov [Wed, 31 Jul 2019 17:25:19 +0000 (13:25 -0400)]
stapbpf pr23875 bugfix :: allocate actual keysize in foreach to avoid stack clobber

* bpf-translate.cxx (bpf_unparser::visit_foreach_loop): allocate actual keysize.
* testsuite/systemtap.bpf/bpf_tests/foreach_string.stp: new partial PR23858 testcase,
  added only the parts necessary to trigger a segfault when bugfix not applied.

5 years agorhbz1732514: java runtime requires java-devel
Frank Ch. Eigler [Tue, 30 Jul 2019 14:18:07 +0000 (10:18 -0400)]
rhbz1732514: java runtime requires java-devel

This is not provided automagically via some other dependency,
so we must hard-Require: it ourselves.

5 years agotapset/bpf/conversions.stp :: typo, should be $rc not rc
Serhei Makarov [Tue, 23 Jul 2019 18:35:30 +0000 (14:35 -0400)]
tapset/bpf/conversions.stp :: typo, should be $rc not rc

5 years agoFix aarch64 to properly access arguments for wrapped syscalls
William Cohen [Tue, 23 Jul 2019 18:24:14 +0000 (14:24 -0400)]
Fix aarch64 to properly access arguments for wrapped syscalls

Linux 4.18 added wrappers for aarch64 syscalls that pass a pointer to
a struct pt_regs holding the values for the actual arguments.  The
syscall tapsets initialize CONTEXT->sregs to point at this data
structure.  However, the aarch64 specific register access code was
using the CONTEXT->kregs and just getting the processor register state
when the kprobe triggered rather than the expected arguments in the
data structure being passed into the syscall.  The aarch64 specific
register code now gets the syscall arguments from the correct pt_regs
structure.

5 years agoruntime: adapt to inconsistent export of task_work_add and task_work_cancel
Frank Ch. Eigler [Sat, 20 Jul 2019 17:11:54 +0000 (13:11 -0400)]
runtime: adapt to inconsistent export of task_work_add and task_work_cancel

Ubuntu user <walac> reports their kernel 5.0.0-17-generic #18-Ubuntu
SMP encounters pass-5 errors with an unresolved task_work_cancel()
symbol.  It turns out this is due to a ubuntu-specific
(android-related) kernel commit that exports only task_work_add().
Updated buildrun.cxx and relevant runtime files to separately check
for exportedness of task_work_cancel().

commit 2cc291a463c42641b4146b2507fa4499da35d335
Author: Christian Brauner <christian@brauner.io>
Date:   Wed Jan 16 23:13:25 2019 +0100

    UBUNTU: SAUCE: binder: turn into module

5 years agoEliminate ambiguous python shebangs
William Cohen [Fri, 19 Jul 2019 14:46:59 +0000 (10:46 -0400)]
Eliminate ambiguous python shebangs

Fedora rawhide (31) now throws errors for ambiguous python shebangs.
The systemtap.spec has been modified as outlined in the Fedora feature
wiki page to avoid those ambiguities:

https://fedoraproject.org/wiki/Changes/Make_ambiguous_python_shebangs_error

5 years agoAdd mmwriteback.stp to the list of examples that BPF can run.
William Cohen [Thu, 18 Jul 2019 18:52:47 +0000 (14:52 -0400)]
Add mmwriteback.stp to the list of examples that BPF can run.

5 years agoAdd a test for the BPF raw tracepoints functionality. (PR23866)
William Cohen [Thu, 18 Jul 2019 15:57:50 +0000 (11:57 -0400)]
Add a test for the BPF raw tracepoints functionality. (PR23866)

5 years agoPR23866: Make the bpf backend use BPF raw tracepoints for kernel.trace("*")
William Cohen [Thu, 18 Jul 2019 15:37:37 +0000 (11:37 -0400)]
PR23866: Make the bpf backend use BPF raw tracepoints for kernel.trace("*")

The BPF raw tracepoints provide arguments that better match the
Systemtap lkm kernel tracepoint probes than regular BPF tracepoints.
The BPF backend will use the BPF raw tracepoints unless the user
specifies the old behavior with a --compatible=4.1 option on the
commandline to address.

The new BPF raw tracepoints and their argument are discovered in the
same way as the old BPF tracepoints.  A number of small machine
generated C files are generated with macros are compiled to query the
available tracepoints in the kernel. Debug information describing the
data structures passed into the BPF tracepoints is examined to
determine the type and location of the tracepoint arguments.

Each probe handler BPF code for BPF raw tracepoints is put into a
raw_trace section as the method of registering the BPF raw tracepoints
is different than the regular BPF tracepoints.

The bpf tests have been revised to include the --compatible=4.1 option
for the tests where it makes a difference.

5 years agostapbpf pr24811 bugfix :: don't pop keys.back() on first iteration
Serhei Makarov [Mon, 15 Jul 2019 17:14:25 +0000 (13:14 -0400)]
stapbpf pr24811 bugfix :: don't pop keys.back() on first iteration

If key == NULL, the sorted data for the current foreach loop
has not yet been created. Hence if limit == 0, keys.back() shouldn't
be popped.

* stapbpf/bpfinterp.cxx (map_get_next_key): bugfix for limit == 0.

5 years agostapbpf PR24811 test :: unveil a nasty lurking segfault case in foreach loops
Serhei Makarov [Mon, 15 Jul 2019 16:53:29 +0000 (12:53 -0400)]
stapbpf PR24811 test :: unveil a nasty lurking segfault case in foreach loops

5 years agoAdd some minor tweaks to backtracing add-ons and mention in NEWS
Jafeer Uddin [Thu, 11 Jul 2019 20:20:13 +0000 (16:20 -0400)]
Add some minor tweaks to backtracing add-ons and mention in NEWS

* NEWS: mention new backtracing add-ons
* runtime/regs.h: fix bug with REG_LINK macro for __aarch64__
* tapset/linux/ucontext-unwind.stp: tweak the register-taking backtraces to be more general and work
  with other archs

5 years agoFix errors with new backtrace functions missed in backtracing patch
Jafeer Uddin [Tue, 2 Jul 2019 15:57:07 +0000 (11:57 -0400)]
Fix errors with new backtrace functions missed in backtracing patch

5 years agostapbpf/bpfinterp.cxx pr24758 :: add error info to abort() calls
Serhei Makarov [Tue, 2 Jul 2019 15:26:13 +0000 (11:26 -0400)]
stapbpf/bpfinterp.cxx pr24758 :: add error info to abort() calls

This is still not a proper error reporting scheme but it lets me debug
things in the meantime without having to fire up a debugger just to
understand which place in the code called abort().

* bpfinterp.cxx (stapbpf_abort): New macro, prints reason + aborts.
  (stapbpf_just_abort): New macro, aborts for unspecified reason,
  but still prints the location of the abort() call.
  (stapbpf_stat_get): use stapbpf_abort().
  (bpf_handle_transport_msg): ditto.
  (bpf_interpret): ditto.

5 years agoAdd more capabilities to systemtap backtracing
Jafeer Uddin [Tue, 25 Jun 2019 20:23:41 +0000 (16:23 -0400)]
Add more capabilities to systemtap backtracing

* runtime/sym.c: simplified logic in _stp_snprint_addr because it doesn't need to be that verbose,
  also added ability to have file names and line numbers print in backtraces
* runtime/sym.h: added new symbol flag to generate a more "fuller" backtrace (includes file names
  and line numbers)
* tapset/linux/context-unwind.stp: added new backtrace tapset function that also prints file names
* tapset/linux/ucontext-unwind.stp: added new backtrace tapset function that also prints file names
  and functions to allow backtraces using a user provided pc & sp.

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