]> sourceware.org Git - systemtap.git/log
systemtap.git
10 months agosystemtap.spec: bump Release back up to 1{something}
Frank Ch. Eigler [Wed, 27 Sep 2023 11:39:54 +0000 (07:39 -0400)]
systemtap.spec: bump Release back up to 1{something}

10 months agoRobustify the flightrec2 testcase
Martin Cermak [Fri, 22 Sep 2023 13:33:40 +0000 (15:33 +0200)]
Robustify the flightrec2 testcase

Simplify and make flightrec2 less dependent on delays/timing.
Make it less fragile.

10 months agoFix flightrecorder log rotation test cases
Martin Cermak [Fri, 22 Sep 2023 10:46:03 +0000 (12:46 +0200)]
Fix flightrecorder log rotation test cases

Commit 5b39471380a238469c8fc18136f12600e5e9aec7 changed how flight
recorder logs are rotated.  The rotation now only happens in case there
is some actual stap output.  Without output, there's nothing to rotate,
and that makes sense after all.

This test suite update makes sure there is always some stap output, so
that the log rotation can actually happen.

10 months agoAdd missing header to fix an s390x specific compile problem
Martin Cermak [Thu, 21 Sep 2023 14:35:08 +0000 (16:35 +0200)]
Add missing header to fix an s390x specific compile problem

Add include unistd.h because of the close() call.
The error message on s390x/rhel8 was:

-------------------8<----------------------------------------------------
tapset-debuginfod.cxx:44:3: error: 'close' was not declared in this scope
   close(metadata_fd);
   ^~~~~
tapset-debuginfod.cxx:44:3: note: suggested alternative: 'pclose'
   close(metadata_fd);
   ^~~~~
   pclose
make[3]: *** [Makefile:1756: stap-tapset-debuginfod.o] Error 1
make[3]: *** Waiting for unfinished jobs....
-------------------8<----------------------------------------------------

10 months agoFix a typo in tapset/linux/s390/sysc_execve.stp
Martin Cermak [Thu, 21 Sep 2023 14:29:43 +0000 (16:29 +0200)]
Fix a typo in tapset/linux/s390/sysc_execve.stp

10 months agoPR30864: tweak configury for debuginfod/json-c
Frank Ch. Eigler [Mon, 18 Sep 2023 15:24:40 +0000 (11:24 -0400)]
PR30864: tweak configury for debuginfod/json-c

Add json-c as debuginfod-related buildrequire.  Check for
its presence better in configure.ac and in the source file.

11 months agoPR30858: improve diagnostics for pass-4 build failures in lkm mode
Frank Ch. Eigler [Fri, 15 Sep 2023 14:54:11 +0000 (10:54 -0400)]
PR30858: improve diagnostics for pass-4 build failures in lkm mode

Kernel versions often drift beyond the range against which systemtap
has been tested.  Since there is no persistent kernel API, stap
runtime can break with new major releases.  Improve the pass-4 error
message, so that the tested kernel range is printed:

[....]
WARNING: kbuild exited with status: 2
Pass 4: compilation failed.  [man error::pass4]
Kernel version 6.3.12 is within tested range 2.6.32 ... 6.5

The message advises "within" or "outside" as per strverscmp.

11 months agotapset-debuginfod.cxx: respect --without-debuginfod
Frank Ch. Eigler [Thu, 14 Sep 2023 20:28:35 +0000 (16:28 -0400)]
tapset-debuginfod.cxx: respect --without-debuginfod

Allow this to compile (to a dummy stub) even in absence of debuginfod
client headers.

11 months agolanguage-server/jsonrpc.h: tweak for stdint.h usage
Frank Ch. Eigler [Thu, 14 Sep 2023 20:27:43 +0000 (16:27 -0400)]
language-server/jsonrpc.h: tweak for stdint.h usage

Otherwise error may result on gcc 13.2*

11 months agoHave the scsi tapset support newer kernels struct scsi_cmnd
William Cohen [Tue, 12 Sep 2023 14:18:58 +0000 (10:18 -0400)]
Have the scsi tapset support newer kernels struct scsi_cmnd

The linux kernel commit 2266a2def97ce11ec removed the request field
from struct scsi_cmnd.  The scsi tapset needed to test whether the
request field is available.  If request field is not available, use
the linux kernels helper function scsi_cmd_to_rq to get a value for
request.

11 months agoPR30777: Allow systemtap to work on Intel machines with IBT enabled
William Cohen [Tue, 29 Aug 2023 15:33:41 +0000 (11:33 -0400)]
PR30777: Allow systemtap to work on Intel machines with IBT enabled

Intel 11th gen processors include Indirect Branch Target (IBT)
support.  Systemtap needs to take some additional steps to work in
this environment.  For kernels that do not have CONFIG_X86_KERNEL_IBT
set these steps are turned into NOPS.

11 months agoFor non-x86 architectures set the CPUFlags to be empty.
William Cohen [Tue, 29 Aug 2023 15:14:56 +0000 (11:14 -0400)]
For non-x86 architectures set the CPUFlags to be empty.

On aarch64 and other non-x86 architectures the get_system_info
procedure would fail because there are no flags in the /proc/cpuinfo.
The procedure now does a check to see if it is available and set
CPUFlags appropriately.

11 months agoPR27410: Probe processes using debuginfod
Ryan Goldberg [Thu, 21 Jul 2022 16:41:17 +0000 (12:41 -0400)]
PR27410: Probe processes using debuginfod

New tapset which allows for process
probing using executables/debuginfo
stored in debuginfod servers.

Signed-off-by: Ryan Goldberg <rgoldber@redhat.com>
11 months agoNEWS typo fix
Frank Ch. Eigler [Thu, 24 Aug 2023 18:41:26 +0000 (14:41 -0400)]
NEWS typo fix

11 months agoPR30434: deprecate rhel6 (2.6.32*) support. Deprecate code from various files as...
Housam Alamour [Thu, 24 Aug 2023 17:48:29 +0000 (13:48 -0400)]
PR30434: deprecate rhel6 (2.6.32*) support. Deprecate code from various files as well as the testsuite. Mainly "if"  branches used by older kernels/distros to define necessary macros.

11 months agoPR30434 complete: Further removal of "if" branches related to old distros/kernel...
Housam Alamour [Wed, 16 Aug 2023 18:35:20 +0000 (14:35 -0400)]
PR30434 complete: Further removal of "if" branches related to old distros/kernel versi
ons. Removal of runtime/linux/autoconf-utrace-regset.c. Patch to previous commits to fix testcase errors.

11 months agoPR30434 continuation: Deprecate testsuite files and test contents
Housam Alamour [Mon, 14 Aug 2023 19:21:33 +0000 (15:21 -0400)]
PR30434 continuation: Deprecate testsuite files and test contents
related to older kernel/distro versions.

11 months agoPR30434 continuation:Remove process().insn probes from test files and documentation...
Housam Alamour [Mon, 14 Aug 2023 17:52:40 +0000 (13:52 -0400)]
PR30434 continuation:Remove process().insn probes from test files and documentation as well as related itrace.exp file.

11 months agoPR30434 continuation: CONFIG_UTRACE mentions removed and "if" branches related to...
Housam Alamour [Fri, 11 Aug 2023 16:15:37 +0000 (12:15 -0400)]
PR30434 continuation: CONFIG_UTRACE mentions removed and "if" branches related to old kernel version removed.

11 months agoPR30434 continuation: Added documentation of changes to News and langref.tex
Housam Alamour [Wed, 9 Aug 2023 14:57:59 +0000 (10:57 -0400)]
PR30434 continuation: Added documentation of changes to News and langref.tex

11 months agoPR30434 continuation: Removed old uprobes, uprobes2 implementation, uprobes-inc...
Housam Alamour [Tue, 25 Jul 2023 20:33:36 +0000 (16:33 -0400)]
PR30434 continuation:  Removed old uprobes, uprobes2 implementation, uprobes-inc.h & any mentions of CONFIG_UTRACE.

11 months agoPR30434: deprecate rhel6 (2.6.32*) support. Depricate code from files in the source...
Housam Alamour [Fri, 14 Jul 2023 20:04:02 +0000 (16:04 -0400)]
PR30434: deprecate rhel6 (2.6.32*) support. Depricate code from files in the source /systemtap directory. Mainly "if" branches that define macros used by older kernels/distros.

11 months agoPR30777: note in systemtap testsuite logs and stap-report about cpu flags
Frank Ch. Eigler [Wed, 23 Aug 2023 18:32:24 +0000 (14:32 -0400)]
PR30777: note in systemtap testsuite logs and stap-report about cpu flags

In particular, this would let the testsuite record whether IBT was
active at the time of the run.  Also include the security-lockdown
state flag.

11 months agoPR30716: work around objtool stac/clac warning
Frank Ch. Eigler [Wed, 23 Aug 2023 12:51:08 +0000 (08:51 -0400)]
PR30716: work around objtool stac/clac warning

Since early 2022, linux upstream changes have occurred related to use of
segment registers / SMAP machinery to control kernel access to userspace
memory.  PR30456 started support in this area, by wrapping our userspace
accessing functions in the proper begin/end wrappers.  However, objtool
is programmed with a "whitelist" of functions to permit to be called
within those begin/end wrappers.  Our own userspace accessing functions
are "safe" in the sense that they can't leak the "AC" flag, but objtool
doesn't know, so spams stderr with:

/var/tmp/stap8X6e5G/stap_84eb7946bc6f829f61271ffa7a79c1a5_2690620.o: warning: objtool: probe_58677+0xfab: call to __get_user_nocheck_8() with UACCESS enabled

This patch hacks around this by stopping objtool from detecting this
situation (by suppressing its "--uaccess" command line option).
Another approach could be to switch to the kernel's normal get_user_*
etc. wrappers, which should be within the "whitelist", but that's a
larger change to contemplate.

12 months agodebian bug #1047029: "make clean" hygiene
Frank Ch. Eigler [Tue, 15 Aug 2023 20:31:42 +0000 (16:31 -0400)]
debian bug #1047029: "make clean" hygiene

12 months agotestsuite/stap_merge.tcl: update for magic word in transport stream
Frank Ch. Eigler [Mon, 14 Aug 2023 18:13:38 +0000 (14:13 -0400)]
testsuite/stap_merge.tcl: update for magic word in transport stream

This fixes a small regression in the testsuite.

12 months agoPR29108 / BZ2095359 tweak: stap_merge magic handling
Frank Ch. Eigler [Mon, 14 Aug 2023 17:54:50 +0000 (13:54 -0400)]
PR29108 / BZ2095359 tweak: stap_merge magic handling

We don't bother do much error checking in this infrequently used
tool, but gcc warnings require us to do some.

12 months agoPR30749: correct stap --sign-module timing
Frank Ch. Eigler [Sat, 12 Aug 2023 18:28:44 +0000 (14:28 -0400)]
PR30749: correct stap --sign-module timing

Previous code signed the temp directory copy, after it had already
been copied into the cache -- so the signature never made it to a
permanent artifact.

If the module was being fetched from the cache from a previous build
run, a sign (re)attempt will still be done.  This may not be
necessary, but shouldn't be harmful.

Reported-By: Renaud Métrich <rmetrich@redhat.com>
12 months agotestsuite: fix hash-bang of pr30570.stp
Frank Ch. Eigler [Sat, 12 Aug 2023 17:44:00 +0000 (13:44 -0400)]
testsuite: fix hash-bang of pr30570.stp

... so dejagnu can search/replace it the usual way

12 months agoPR29108 / BZ2095359: rewrite staprun serializer logic
Frank Ch. Eigler [Mon, 31 Jul 2023 18:06:57 +0000 (14:06 -0400)]
PR29108 / BZ2095359: rewrite staprun serializer logic

Logic in commit cd48874296e00 (2021, PR28449) fixed broken cross-cpu
message ordering that followed previous transport concurrency fixes,
but imposed a lot of userspace synchronization delays upon the threads
who were supposed to drain messages from the kernel relayfs streams as
fast as possible.  This has led to unnecessarily lossy output overall.

New code uses a new many-writers single-reader data structure, a mutex
protected heap.  All the per-cpu readers copy & pump messages into
that heap as rapidly as possible, sorted by the generally monotonic
sequence number.  The reader is signalled via a condition variable and
time to print & release messages in sequence number order.  It also
handles lost messages (jumps in the sequence numbers) by waiting a while
to let the stragglers come in.

The kernel-user messages now also include a framing sequence to allow
the per-cpu readers to resynchronize to the message boundaries, in
case some sort of buffer overflow or something else occurs.  It
reports how many bytes and/or messages were skipped in order to
resynchronize.  It does so in a lot less lossy way than previous code,
which just tried to flush everything then-currently available, hoping
that it'd match message boundaries.

Unfortunately, this means that the user-kernel message ABI has
changed!  Previous-version staprun instances won't work with the new
modules, nor will current-version staprun with old modules.  This flag
day is enforced by changing the numbers of the various ctl message
numbers, so old/new kernel/user combinations will generate errors
rather than quasi-successful staprun startup.

New code also dramatically simplifies the use of signals in staprun
(or rather stapio).  Gone is the signal thread, a lot of the
masking/blocking/waiting.  Instead a single basic signal handler just
increments globals when signals of various kinds arrive, and all the
per-cpu etc. threads poll those globals periodically.  This includes
logic needed for -S (output file rotation on SIGUSR2) as well as
flight recorder (-L / -A) modes.

The reader_timeout_ms value (-T) in both bulk/serialized mode for all
ppoll timeouts, to prevent those threads from sleeping indefinitely,
now that they won't be bothered by signals.

12 months agoruntime/staprun: import gheap routines
Aliaksandr Valialkin [Thu, 27 Jul 2023 22:52:37 +0000 (18:52 -0400)]
runtime/staprun: import gheap routines

BSD-2-Clause gift from the Aliaksandr Valialkin:
https://github.com/valyala/gheap

12 months agoAdd coverity annotation to indicate overflow in bpfinterp.cxx is intentional
William Cohen [Mon, 31 Jul 2023 14:31:22 +0000 (10:31 -0400)]
Add coverity annotation to indicate overflow in bpfinterp.cxx is intentional

12 months agoSimplify init_backlog function to avoid coverity BAD_SHIFT errors
William Cohen [Fri, 28 Jul 2023 17:26:10 +0000 (13:26 -0400)]
Simplify init_backlog function to avoid coverity BAD_SHIFT errors

The init_backlog function determines the power of two sized memory
allocation that would have at least fnum_max elements.  Reworked the
code to make it clearer to the coverity analyzer what it is doing.
Rather than overshooting the desired order value and then adjusting it
down by one the while loop has been revised to exit when the order is
the correct value.

13 months agoPR30634: stop flushing overlarge output to stapio for sprint* backtrace
lijunlong [Thu, 13 Jul 2023 17:20:03 +0000 (13:20 -0400)]
PR30634: stop flushing overlarge output to stapio for sprint* backtrace

This could happen for example if MAXSTRINGLEN > STP_BUFFER_SIZE.

13 months agoFix virthost conditional
Yaakov Selkowitz [Wed, 12 Jul 2023 17:03:56 +0000 (13:03 -0400)]
Fix virthost conditional

virthost was being mistakenly disabled on aarch64 and ppc64le in Fedora builds,
where only EL7 was meant to be excluded.

13 months agoAdjust runtime _access_process_vm_ to work with linux 6.5
William Cohen [Sun, 9 Jul 2023 20:46:20 +0000 (16:46 -0400)]
Adjust runtime _access_process_vm_ to work with linux 6.5

Linux kernel commit ca5e863233e8f6acd1792fd85d6bc2729a1b2c10
eliminated the vma argument for ‘get_user_pages_remote.  For linux 6.5
kernel use the get_user_page_vma_remote function in its place like the
__access_remote_vm function in mm/memory.c of the kernel.

13 months agoBug: unwinding would fail due to the .zdebug_frame section
Yichun Zhang (agentzh) [Mon, 10 Jul 2023 04:49:55 +0000 (21:49 -0700)]
Bug: unwinding would fail due to the .zdebug_frame section

elfutils already decompresses this section but stap might incorrectly
filter it out.

Thanks Junlong Li for the original patch.

Signed-off-by: Yichun Zhang (agentzh) <yichun@openresty.com>
13 months agorhbz2220986: SPCX license tweakage
Frank Ch. Eigler [Thu, 6 Jul 2023 23:46:07 +0000 (19:46 -0400)]
rhbz2220986: SPCX license tweakage

13 months agosystemtap.spec: temporarily disable --with-crash, rhbz2219728
Frank Ch. Eigler [Wed, 5 Jul 2023 02:16:10 +0000 (22:16 -0400)]
systemtap.spec: temporarily disable --with-crash, rhbz2219728

FTBFS observed on fedora rawhide

13 months agogit_version.sh: don't use --no-show-signature either
Frank Ch. Eigler [Fri, 30 Jun 2023 20:01:49 +0000 (16:01 -0400)]
git_version.sh: don't use --no-show-signature either

Can use |tail -1  on old & new git.

13 months agogit_version.h: stop using --broken
Frank Ch. Eigler [Fri, 30 Jun 2023 20:00:06 +0000 (16:00 -0400)]
git_version.h: stop using --broken

It's not available on rhel7 era git versions.

13 months agoruntime: tweak STAPCONF_MODULE_MEMORY cpp
Frank Ch. Eigler [Fri, 30 Jun 2023 19:56:16 +0000 (15:56 -0400)]
runtime: tweak STAPCONF_MODULE_MEMORY cpp

Correct build breakage on rhel7.

13 months agoFedora rawhide kernels are now flagging use of zero length arrays
William Cohen [Thu, 29 Jun 2023 17:17:38 +0000 (13:17 -0400)]
Fedora rawhide kernels are now flagging use of zero length arrays

The kernel has switched from using zero length arrays to flexible
arrays.  The kernel compiles have gotten picker and now flags accesses
beyond the end of end of arrays when possible.  When trying to run the
testsuite on Fedora rawhide got the following error due to a zero
length array:

In file included from /tmp/stapaBPtwB/stap_6b7e9ee7df4a3f6e4cfbffb7f92d8405_1736_src.c:543:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c: In function 'add_tracepoint':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c:148:22: error: 'strcmp' reading 1 or more bytes from a region of size 0 [-Werror=stringop-overread]
  148 |                 if (!strcmp(name, e->name)) {
      |                      ^~~~~~~~~~~~~~~~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/stp_tracepoint.c:61:14: note: source object 'name' of size 0
   61 |         char name[0];
      |              ^~~~

Switched the zero length array in the struct to a flexible array to
eliminate the issue.

13 months agoISystemtap: Added examples corresponding to blog article
Ryan Goldberg [Wed, 28 Jun 2023 17:40:20 +0000 (13:40 -0400)]
ISystemtap: Added examples corresponding to blog article

13 months agoPR30570: Improved type inference within the try block to handle elided cases
Ryan Goldberg [Wed, 28 Jun 2023 13:17:49 +0000 (09:17 -0400)]
PR30570: Improved type inference within the try block to handle elided cases

13 months agosystemtap.spec: SPDX review cleanup
Frank Ch. Eigler [Tue, 20 Jun 2023 18:04:48 +0000 (14:04 -0400)]
systemtap.spec: SPDX review cleanup

SPDX codes for the testsuite, -client (tapset+docs!) and -devel
(tapset!)  updated.

Also corrected/filledin licenses for stap-prep and
interactive-notebook/codemirror/package.json.  Many other files remain
without a formal license header.  These all default to GPL-2.0-or-later

13 months agoruntime: ditch docs/ subdir
Frank Ch. Eigler [Tue, 20 Jun 2023 17:36:31 +0000 (13:36 -0400)]
runtime: ditch docs/ subdir

This is of only archaeological interest.

14 months agosystemtap.spec: switch to SPDX license tags
Frank Ch. Eigler [Mon, 12 Jun 2023 16:19:35 +0000 (12:19 -0400)]
systemtap.spec: switch to SPDX license tags

As per advice in:

https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
https://docs.fedoraproject.org/en-US/legal/update-existing-packages/

14 months agodwflpp.cxx: Fix past-the-end iterator dereference
Aaron Merey [Fri, 9 Jun 2023 23:44:31 +0000 (19:44 -0400)]
dwflpp.cxx: Fix past-the-end iterator dereference

dwflpp::getscopes dereferences cu_die_parent_cache_t iterators in a
loop without first checking whether the iterator is past-the-end.

This results in a past-the-end iterator dereference during the last
iteration of the loop.

Fix this by only dereferencing the iterator if it isn't past-the-end.

14 months agoMake runtime/transport/alloc.c compatible with newer struct module_memory
William Cohen [Thu, 8 Jun 2023 17:10:00 +0000 (13:10 -0400)]
Make runtime/transport/alloc.c compatible with newer struct module_memory

The upstream kernel commit ac3b43283923440900b4f36ca5f9f0b1ca43b70e
changed the structures for modules.  The runtime/transport/alloc.c
made an access to the struct module_memory when -DSTP_MAXMEMORY is
used on the command line and needed the appropriate field name for the
newer kernels.  This change allows stap script builds using
-DSTP_MAXMEMORY to work on Linux 6.4 kernels.

14 months agoMake runtime/transport/symbols.c compatible with newer struct module_memory
William Cohen [Thu, 8 Jun 2023 01:50:34 +0000 (21:50 -0400)]
Make runtime/transport/symbols.c compatible with newer struct module_memory

The upstream kernel commit ac3b43283923440900b4f36ca5f9f0b1ca43b70e
changed the structures for modules.  The runtime/transport/symbols.c
made an access to the struct module_memory and needed the appropriate
field name for the newer kernels.  This change allows another dozen of
the systemtap examples to pass on Linux 6.4 kernels.

14 months agoAdjust runtime module_kallsyms_on_each_symbol to work with Linux 6.3 kernels
William Cohen [Wed, 7 Jun 2023 17:18:01 +0000 (13:18 -0400)]
Adjust runtime module_kallsyms_on_each_symbol to work with Linux 6.3 kernels

The recent fix for PR30415 worked for new Linux 6.4 kernels and
pre-6.3 kernels, but did not work for Linux 6.3 kernels.  The Linux
6.3 kernel module_kallsyms_on_each_symbol function has both the
modname argument of the 6.4 kernels and the function passed in has the
earlier kernel's struct module pointer argument. The runtime/sym.c has
been adjusted to work with the the Linux 6.3 kernels.

14 months agoPR30415: conflicting types for ‘kallsyms_on_each_symbol’
Martin Cermak [Fri, 2 Jun 2023 21:28:07 +0000 (23:28 +0200)]
PR30415: conflicting types for ‘kallsyms_on_each_symbol’

14 months agoPR30484: stap-report: scrape less of /sys /proc
Frank Ch. Eigler [Wed, 24 May 2023 14:22:08 +0000 (10:22 -0400)]
PR30484: stap-report: scrape less of /sys /proc

Mainly: avoid process/busy parts like /proc/$pid.

14 months agoPR29765: Introduce probe nfs.aop.readfolio
Martin Cermak [Fri, 19 May 2023 09:06:25 +0000 (11:06 +0200)]
PR29765: Introduce probe nfs.aop.readfolio

14 months agoPR30459: removed an unused large C array allocated on the kernel stack
Yichun Zhang (agentzh) [Thu, 18 May 2023 05:43:48 +0000 (05:43 +0000)]
PR30459: removed an unused large C array allocated on the kernel stack

14 months agoPR30456: kernel 5.18+ removed set_fs() and we should use the new replacement, user_ac...
Yichun Zhang (agentzh) [Wed, 17 May 2023 00:17:07 +0000 (17:17 -0700)]
PR30456: kernel 5.18+ removed set_fs() and we should use the new replacement, user_access_begin()/user_access_end() for userland memory accesses.

Alas. user_access_begin() in newer kernels also performs access_ok() itself.
We pay a small price of duplicate access_ok() checks here for now.

We also use __access_ok() instead of access_ok() to avoid warnings on debug kernels.

We use __always_inline instead of inline for the C functions which might
be within the regions with UACCESS enabled (to please objtool's checker).

15 months agoSupport newer kernels with struct module_memory
William Cohen [Wed, 17 May 2023 14:38:31 +0000 (10:38 -0400)]
Support newer kernels with struct module_memory

The upstream kernel commit ac3b43283923440900b4f36ca5f9f0b1ca43b70e
changed the structures for modules.  The runtime printing of kernel
information accessed information about modules and the fields in
module structure.  A test has been added to the autoconf list to
determine the appropriate fields to get information about the
module.

15 months agoPR30454: Fix CR3 switching races on X86 when reading userland memory
Yichun Zhang (agentzh) [Tue, 16 May 2023 21:13:32 +0000 (21:13 +0000)]
PR30454: Fix CR3 switching races on X86 when reading userland memory

Backported the fix from usptream kenrel commit d319f344561de.

See upstream kernel commits 4012e77a90 and d319f344561de for more
details.

15 months agoBug: our autoconf mechanism might find unexported symbols in kernel headers not meant...
Yichun Zhang (agentzh) [Tue, 16 May 2023 20:47:54 +0000 (20:47 +0000)]
Bug: our autoconf mechanism might find unexported symbols in kernel headers not meant for kernel modules

The current BULID_CHECK thing does not pass -DMODULE option as the real
kernel build system does and thus may expose unexported symbols like
nmi_uaccess_okay() to our autoconf test programs.

15 months agoPR30408: fixed excessive read faults when reading userland memory from within perf...
Yichun Zhang (agentzh) [Tue, 16 May 2023 19:12:57 +0000 (19:12 +0000)]
PR30408: fixed excessive read faults when reading userland memory from within perf event/kprobes handlers

The user_addr_max() macro is gone since kernel 5.18, which broke stap's
userland reading routines.

And also since kernel 5.18, access_ok() now does address range checks on
all architectures. so we don't bother checking it ourselves for newer
kernels.

15 months agostap-server logic: drop scraped NSS error table
Frank Ch. Eigler [Fri, 12 May 2023 16:43:55 +0000 (12:43 -0400)]
stap-server logic: drop scraped NSS error table

This used to be needed in the ancient days, when the NSS-related
shared libraries did not reliably decode error codes into usable
messages.  This stuff works nwo, so we don't have to carry this
hand-scraped table around any more.

15 months agoPR30442: failing optional statement probes should not trigger pass2 exceptions
Frank Ch. Eigler [Fri, 12 May 2023 15:13:45 +0000 (11:13 -0400)]
PR30442: failing optional statement probes should not trigger pass2 exceptions

In tapsets.cxx, query_cu() and query_module() aggressively caught &
sess-print_error'd semantic_errors from subsidiary call sites.  They
are unaware of whether the probe in question is being resolved within
an optional (? or !) context.  Instead of this, they now simply let
the exceptions propagate out to derive_probes() or similar, which does
know whether exceptions are errors in that context.  That means
exceptions can propagate through elfutils iteration machinery too,
perhaps risking C level memory leaks, but so be it.

This fix goes well beyond statement probes per se, but hand-testing
and the testsuite appear not to show regressions related to this.

Added semok/badstmt.exp to test.

15 months agotestsuite: untested "$t est" typo fix
Frank Ch. Eigler [Fri, 12 May 2023 14:55:28 +0000 (10:55 -0400)]
testsuite: untested "$t  est" typo fix

15 months agoconfigury: prep for next version
Frank Ch. Eigler [Thu, 11 May 2023 21:56:26 +0000 (17:56 -0400)]
configury: prep for next version

15 months agorelease date fix
Frank Ch. Eigler [Fri, 28 Apr 2023 17:51:27 +0000 (13:51 -0400)]
release date fix

15 months agoPR30405: stapkp_init(): we should not disable preemption around the kallsyms_on_each_...
Yichun Zhang (agentzh) [Sat, 6 May 2023 22:21:14 +0000 (15:21 -0700)]
PR30405: stapkp_init(): we should not disable preemption around the kallsyms_on_each_symbol() call

15 months agofix duplicate codegen in stapregex-dfa.cxx
Serhei Makarov [Mon, 8 May 2023 12:15:09 +0000 (08:15 -0400)]
fix duplicate codegen in stapregex-dfa.cxx

On a span with only '\0', the existing DFA codegen was emitting the same
bookkeeping code again after the 'break;' -- harmless but stupid.

15 months agofix PR30395: Regex code has invalid memory reads caught by KASAN
Serhei Makarov [Mon, 8 May 2023 12:12:59 +0000 (08:12 -0400)]
fix PR30395: Regex code has invalid memory reads caught by KASAN

The TNFA tag cleanup on a '\0' byte would incorrectly read beyond the
end of the string. Keeping YYCURSOR on the nul byte fixes this.

Will harden the fix a little (adding a separate increment-only cursor
for safety) before I close the bug, but this change is already
sufficient if the DFA was generated correctly.

15 months agoPR30406: C symbol conflicts when using stap -DDEBUG_MEM and kernel 6.2
Yichun Zhang (agentzh) [Sun, 30 Apr 2023 21:16:39 +0000 (14:16 -0700)]
PR30406: C symbol conflicts when using stap -DDEBUG_MEM and kernel 6.2

The C symbol MEM_PERCPU was in conflict. We add the STP_ prefix to our
own symbol names.

15 months agoNEWS++ release-4.9a
Frank Ch. Eigler [Fri, 28 Apr 2023 16:07:15 +0000 (12:07 -0400)]
NEWS++

15 months agopr18649.exp: Consider "No DWARF information found" warning expected
Martin Cermak [Fri, 28 Apr 2023 13:37:43 +0000 (15:37 +0200)]
pr18649.exp: Consider "No DWARF information found" warning expected

Testing without debuginfo is part of the test scenario, so it makes
sense to ignore warnings about missing debuginfo.

15 months agoPR30396: adapt runtime to linux 6.3-rc
Frank Ch. Eigler [Thu, 27 Apr 2023 21:02:26 +0000 (17:02 -0400)]
PR30396: adapt runtime to linux 6.3-rc

Found a case where CFI/--ibt interfered with our self-backtrace
capability, and a compatibility bit with init/cleanup_module.

15 months agopre-release prep/regen
Frank Ch. Eigler [Wed, 26 Apr 2023 18:41:29 +0000 (14:41 -0400)]
pre-release prep/regen

15 months agoISystemtap: spec update to fix install issues where pip is unavailable
Ryan Goldberg [Thu, 27 Apr 2023 15:47:33 +0000 (11:47 -0400)]
ISystemtap: spec update to fix install issues where pip is unavailable

15 months agoTest for kernels that backported removal of <linux/genhd.h> include
William Cohen [Tue, 25 Apr 2023 14:56:47 +0000 (10:56 -0400)]
Test for kernels that backported removal of <linux/genhd.h> include

Some kernels (RHEL9) backported patches that removed the
<linux/genhd.h> include.  Thus, the ioblock.stp tapset cannot simply
check the kernel version to determine whether the include file is
available.  The added autoconf test will determine whether the include
is available.

15 months agoAllow nfsd.stp tapset to work on kernels with CONFIG_NFSD_V2 unset
William Cohen [Tue, 25 Apr 2023 13:44:51 +0000 (09:44 -0400)]
Allow nfsd.stp tapset to work on kernels with CONFIG_NFSD_V2 unset

Some of the newer Fedora kernels have CONFIG_NFSD_V2 unset (*).  The
nfsd.stp tapset was requiring various NFSD V2 probes points to exist.
These required probes caused examples like nfsd-trace and nfsdtop
build failures.  Making the NFSD V2 probes optional allows the
nfsd.stp tapset to work on these kernels.

* https://src.fedoraproject.org/rpms/kernel/c/897c8e8d51d02e159116d60fe5bb5dde79150162?branch=rawhide

15 months agoBZ2180328: disable pass-2 dyninst liveness analysis on CONFIG_RETPOLINE kernels
Frank Ch. Eigler [Wed, 19 Apr 2023 15:23:16 +0000 (11:23 -0400)]
BZ2180328: disable pass-2 dyninst liveness analysis on CONFIG_RETPOLINE kernels

As a stopgap measure, ameliorate the dramatic dyninst analysis time
required to liveness-check $var assignments in kernels compiled with
retpolines.  Just skip the effort (with a warning).

See also: https://github.com/dyninst/dyninst/issues/1305 .

15 months agostap-prep: Provide --quiet switch
Martin Cermak [Wed, 19 Apr 2023 11:44:57 +0000 (13:44 +0200)]
stap-prep:  Provide --quiet switch

The stap-prep may run in automation environment, where
verbose output and progress indicators pollute logs.

Teach stap-prep to run quietly.

15 months agoAdded docs for livepatch.stp
Ryan Goldberg [Tue, 18 Apr 2023 15:47:59 +0000 (11:47 -0400)]
Added docs for livepatch.stp

15 months agoISystemtap: Tweaked monitor to fix older build issues
Ryan Goldberg [Tue, 18 Apr 2023 14:26:44 +0000 (10:26 -0400)]
ISystemtap: Tweaked monitor to fix older build issues

16 months agoISystemtap: Added man page stap-jupyter(1)
Ryan Goldberg [Mon, 17 Apr 2023 17:32:38 +0000 (13:32 -0400)]
ISystemtap: Added man page stap-jupyter(1)

16 months agoISystemtap: Improved logging and bug fixes
Ryan Goldberg [Fri, 14 Apr 2023 15:31:14 +0000 (11:31 -0400)]
ISystemtap: Improved logging and bug fixes

16 months agoISystemtap: Added stap-jupyter-* commands and tweaked containers
Ryan Goldberg [Fri, 31 Mar 2023 16:23:00 +0000 (12:23 -0400)]
ISystemtap: Added stap-jupyter-* commands and tweaked containers

16 months agoISystemtap: Updated NEWS, spec and other small tweaks
Ryan Goldberg [Wed, 22 Mar 2023 20:11:06 +0000 (16:11 -0400)]
ISystemtap: Updated NEWS, spec and other small tweaks

16 months agoISystemtap: Added containerized encapsulation of jupyter kernel
Ryan Goldberg [Thu, 16 Mar 2023 17:21:46 +0000 (13:21 -0400)]
ISystemtap: Added containerized encapsulation of jupyter kernel

16 months agoISystemtap: Highlighting, examples and tests
Ryan Goldberg [Tue, 7 Mar 2023 21:32:33 +0000 (16:32 -0500)]
ISystemtap: Highlighting, examples and tests

16 months agoISystemtap: Changes to monitor mode & language server for use with jupyter
Ryan Goldberg [Mon, 6 Mar 2023 18:06:47 +0000 (13:06 -0500)]
ISystemtap: Changes to monitor mode & language server for use with jupyter

16 months agoISystemtap: New Jupyter kernel
Ryan Goldberg [Mon, 6 Mar 2023 17:13:19 +0000 (12:13 -0500)]
ISystemtap: New Jupyter kernel

16 months agodropwatch.stp sample: use symdata vs symname for more info
Frank Ch. Eigler [Wed, 29 Mar 2023 20:39:43 +0000 (16:39 -0400)]
dropwatch.stp sample: use symdata vs symname for more info

The script still needs to be run via something like this for
module/symbol names:

% stap --example dropwatch.stp --all-modules

16 months agoLang Server: Updated gcc version requirement
Ryan Goldberg [Mon, 27 Mar 2023 16:00:14 +0000 (12:00 -0400)]
Lang Server: Updated gcc version requirement

16 months agoLang Server: Fix for deprecated jsonc call and older gcc versions
Ryan Goldberg [Thu, 23 Mar 2023 17:54:07 +0000 (13:54 -0400)]
Lang Server: Fix for deprecated jsonc call and older gcc versions

17 months agoPR30123: rework dwarf4/5 DW_AT_data_bit_offset support
Frank Ch. Eigler [Thu, 9 Mar 2023 22:05:33 +0000 (17:05 -0500)]
PR30123: rework dwarf4/5 DW_AT_data_bit_offset support

$subject DWARF attribute is another way of designating the relative
position of a member field of a struct within it, generally a
bitfield.  It's an absolute bit offset relative to the beginning of
the containing object, rather than the immediately containing word, so
the bit offset numbers can become huge.

New code treats these more correctly, by intercepting them in
dwflpp::translate_final_fetch_or_store to offset the final load/store
address, and relativizing the bit offsets.

New test case covers a variety of -gdwarf* levels with a userspace
target program.

17 months agotestsuite Makefiles: suppress debuginfod client tracing
Frank Ch. Eigler [Thu, 9 Mar 2023 22:03:31 +0000 (17:03 -0500)]
testsuite Makefiles: suppress debuginfod client tracing

Use a strategically placed env -uDEBUGINFOD_PROGRESS -uDEBUGINFOD_VERBOSE .

17 months agodtrace.in: add emacs mode marker for python
Frank Ch. Eigler [Mon, 27 Feb 2023 14:37:19 +0000 (09:37 -0500)]
dtrace.in: add emacs mode marker for python

17 months agodtrace: Use deterministic temp file creation for all temp files
Gioele Barabucci [Mon, 27 Feb 2023 11:56:52 +0000 (12:56 +0100)]
dtrace: Use deterministic temp file creation for all temp files

`dtrace -G -C` creates temporary files with random filenames. The name
of these temporary files gets embedded in the ELF `.symtab` of the final
object files, making them always slightly different.

This behavior makes all packages that use `dtrace`-produced object files
inherently non reproducible.

To fix this issue all temporary files are now created using
the same deterministic procedure currently used only for the
temporary "c." files.

Fixes: https://bugs.debian.org/1032055
Fixes: https://bugs.debian.org/1032056
Signed-off-by: Gioele Barabucci <gioele@svario.it>
18 months agointeractive.cxx: use temporary file with .stp suffix
Martin Cermak [Fri, 10 Feb 2023 13:08:22 +0000 (14:08 +0100)]
interactive.cxx:  use temporary file with .stp suffix

In systemtap interactive mode (stap -i), editors like vim can
benefit from this change by automatically turning on the stap
syntax highlighting and completion.  For this to work, the
EDITOR env var needs to point to the editor of choice.

18 months agostap_language_server_tester.py: Compatibility with python pre-3.7 (cont'd)
Martin Cermak [Wed, 8 Feb 2023 12:03:56 +0000 (13:03 +0100)]
stap_language_server_tester.py:  Compatibility with python pre-3.7 (cont'd)

18 months agostap_language_server_tester.py: Compatibility with python pre-3.7
Martin Cermak [Wed, 8 Feb 2023 11:23:03 +0000 (12:23 +0100)]
stap_language_server_tester.py:  Compatibility with python pre-3.7

18 months agostap_language_server_tester.py: Compatibility with python pre-3.10
Martin Cermak [Wed, 8 Feb 2023 09:01:28 +0000 (10:01 +0100)]
stap_language_server_tester.py:  Compatibility with python pre-3.10

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