]> sourceware.org Git - systemtap.git/log
systemtap.git
8 days agoRemove testing of dcookie syscall from systemtap.syscall/arg_write.stp
William Cohen [Thu, 24 Oct 2024 17:27:06 +0000 (13:27 -0400)]
Remove testing of dcookie syscall from systemtap.syscall/arg_write.stp

The dcookie support was removed from the linux 5.12 kernel (git commit
be65de6b03aa6).  Need to remove testing of dcookie syscall from
arg_write test to allow this test to run on newer kernels.  There is
still testing of argument writes on the dir and poll syscalls.

8 days agoFor preprocessor.exp use "uname -m" to find the machine architecture
William Cohen [Thu, 24 Oct 2024 15:57:40 +0000 (11:57 -0400)]
For preprocessor.exp use "uname -m" to find the machine architecture

On Fedora "uname -i" returns "unknown" which causes the preprocessor.exp
test to fail.  Reverting back to "uname -m".

8 days agoAllow preprocessor.exp to work with Linux 6.x kernels
William Cohen [Thu, 24 Oct 2024 14:43:44 +0000 (10:43 -0400)]
Allow preprocessor.exp to work with Linux 6.x kernels

3 weeks agoUpdate systemtap.base/cast.stp test to work with newer kernels
William Cohen [Wed, 9 Oct 2024 01:43:31 +0000 (21:43 -0400)]
Update systemtap.base/cast.stp test to work with newer kernels

Linux kernel commit ec1d281923cf changed the usage field in the
task_struct from atomic_t to refcount_t.  The internal fields of the
two types are different.  Updated the cast.stp test to use the
appropriate type and field regardless which type is being used.

3 weeks agoUpdate systemtap.printf/memory1_module.c to compile with newer kernels
William Cohen [Wed, 9 Oct 2024 00:54:29 +0000 (20:54 -0400)]
Update systemtap.printf/memory1_module.c to compile with newer kernels

Newer kernels are built with -Wmissing-prototypes enabled.  Need to
add prototypes for the exported functions in the module to allow it to
compile.  Also select the appropriate struct (struct proc_ops for
newer kernels or struct file_operations for older kernels) so the
stm_fops_cmd argument for proc_create() is the correct type.

3 weeks agoCorrect systemtap.base/regrediag.exp test name
William Cohen [Tue, 8 Oct 2024 17:56:40 +0000 (13:56 -0400)]
Correct systemtap.base/regrediag.exp test name

The regrediag.exp was attempting to build a non-existent
regrewarning.stp.  Corrected the test name to "regrediag" to run
regrediag.stp.

3 weeks agoAddress the Linux 6.12 move of the unaligned.h include file
William Cohen [Mon, 7 Oct 2024 15:27:10 +0000 (11:27 -0400)]
Address the Linux 6.12 move of the unaligned.h include file

The Linux git commit 5f60d5f6bb moved unaligned.h from asm/unaligned.h
to linux/unaligned.h.  Adjusted runtime/sym.c to include the
unaligned.h from the appropriate location.

4 weeks agoPR32209: Improve the fix per bugzilla comment #6
Martin Cermak [Wed, 2 Oct 2024 07:25:58 +0000 (09:25 +0200)]
PR32209: Improve the fix per bugzilla comment #6

4 weeks agoPR32209: Define the __COUNT_ARGS macro conditionally
Martin Cermak [Mon, 30 Sep 2024 09:12:56 +0000 (11:12 +0200)]
PR32209: Define the __COUNT_ARGS macro conditionally

5 weeks agoPR32194: Use v6.12 versions of uprobe register and unregister functions
Martin Cermak [Tue, 24 Sep 2024 10:00:10 +0000 (12:00 +0200)]
PR32194: Use v6.12 versions of uprobe register and unregister functions

Kernel 6.12 comes with kernel commits 04b01625d and 3c83a9ad changing
the way uprobe register and unregister functions work.

8 weeks agoRHEL-47342: clarify that the systemtap-client subrpm is for -server use
Frank Ch. Eigler [Fri, 6 Sep 2024 14:04:59 +0000 (10:04 -0400)]
RHEL-47342: clarify that the systemtap-client subrpm is for -server use

There was confusion between -client and -devel.

8 weeks agoPR32107: Drop obsolete -Werror hack
Sam James [Wed, 21 Aug 2024 06:44:41 +0000 (07:44 +0100)]
PR32107: Drop obsolete -Werror hack

This was added in 2537a8805ce500b4e3474317dcbca4744895326e to workaround
a packaging whoopsie on our side in Gentoo (long before me!). It is now
obsolete and has been for a decade. Clean it up.

8 weeks agoAdjust the rpc.stp tapset to work with newer kernels
William Cohen [Mon, 2 Sep 2024 23:38:47 +0000 (19:38 -0400)]
Adjust the rpc.stp tapset to work with newer kernels

Changes in the tapset made to address:
- $timeout is not available in a number of places (kernel commit  c743b4259c3a)
- svc_destroy has $servp in place of $serv
- svc_process is a void function (kernel commit 55fcc7d9159de)

8 weeks agoRHEL-55262: Handle S390_lowcore macro removal
Martin Cermak [Mon, 2 Sep 2024 15:16:16 +0000 (17:16 +0200)]
RHEL-55262: Handle S390_lowcore macro removal

In kernel commit 39976f1278a9, macro S390_lowcore was replaced with
get_lowcore() causing https://issues.redhat.com/browse/RHEL-55262 .

2 months agorhbz2280168: spec nit to track %{_libexecdir}/systemtap/python/
Frank Ch. Eigler [Fri, 30 Aug 2024 19:46:28 +0000 (15:46 -0400)]
rhbz2280168: spec nit to track %{_libexecdir}/systemtap/python/

2 months agorhbz2306555: move dtrace.1 man page to sdt-dtrace subpackage
Frank Ch. Eigler [Tue, 27 Aug 2024 22:36:54 +0000 (18:36 -0400)]
rhbz2306555: move dtrace.1 man page to sdt-dtrace subpackage

2 months agosession.cxx: fix syntax error in last commit
Frank Ch. Eigler [Tue, 20 Aug 2024 17:39:13 +0000 (13:39 -0400)]
session.cxx: fix syntax error in last commit

Reported-by: Will Cohen <wcohen@redhat.com>
2 months agosession.cxx: kernel 6.11-rc3 found serviceable
Frank Ch. Eigler [Tue, 20 Aug 2024 15:46:06 +0000 (11:46 -0400)]
session.cxx: kernel 6.11-rc3 found serviceable

2 months agosession.cxx: note 6.10 in supporter kernel version range
Frank Ch. Eigler [Tue, 20 Aug 2024 13:50:43 +0000 (09:50 -0400)]
session.cxx: note 6.10 in supporter kernel version range

2 months agorhbz2305568: devel subrpm should include vimfile/ subdirs too
Frank Ch. Eigler [Mon, 19 Aug 2024 19:48:39 +0000 (15:48 -0400)]
rhbz2305568: devel subrpm should include vimfile/ subdirs too

... not just the individual .vim files.

2 months agosystemtap.spec: http:// -> https://
Frank Ch. Eigler [Tue, 13 Aug 2024 15:56:45 +0000 (11:56 -0400)]
systemtap.spec: http:// -> https://

... because why not

2 months agorhbz2296275: systemtap.spec: Final split of sdt-dtrace and sdt-devel
Lumír Balhar [Tue, 13 Aug 2024 15:55:16 +0000 (11:55 -0400)]
rhbz2296275: systemtap.spec: Final split of sdt-dtrace and sdt-devel

systemtap-sdt-devel subrpm no longer requires systemtap-sdt-dtrace.

2 months agoPR32064: SEC_ERROR_BAD_DATABASE during very first stap-server start
Martin Cermak [Fri, 9 Aug 2024 09:26:57 +0000 (11:26 +0200)]
PR32064: SEC_ERROR_BAD_DATABASE during very first stap-server start

2 months agoRHEL-52491: NSS 3.101.0 compatibility
Martin Cermak [Fri, 9 Aug 2024 05:40:43 +0000 (07:40 +0200)]
RHEL-52491: NSS 3.101.0 compatibility

After NSS rebased to 3.101.0, systemtap stopped being able to grant
trust to stap-server: https://issues.redhat.com/browse/RHEL-52491 .
This patch fixes it.

2 months agotestsuite pr14546: make unverbose
Frank Ch. Eigler [Thu, 8 Aug 2024 21:30:21 +0000 (17:30 -0400)]
testsuite pr14546: make unverbose

Previous version of this test was painfully verbose.  New code
runs stap under "-u" unoptimized mode to compute the backtraces
(to verify non-corruption of memory during those ops), but does
not actually print them any more.

3 months agoGenerate DWARF for python HelperSDT (refix)
Martin Cermak [Fri, 26 Jul 2024 08:53:59 +0000 (10:53 +0200)]
Generate DWARF for python HelperSDT (refix)

Refix commit 4e8058f38d7f2ec2040d43ddcfddff5217e89423 by letting
CFLAGS propagate to python/setup.py through the Makefile, instead
of passing the flag explicitly.  Suggested by Miro Hroncok in
https://issues.redhat.com/browse/RHEL-43481 .

3 months agoGenerate DWARF for HelperSDT/_HelperSDT*.so
Martin Cermak [Thu, 25 Jul 2024 14:15:53 +0000 (16:15 +0200)]
Generate DWARF for HelperSDT/_HelperSDT*.so

Python Extension Flags Reduction effort [1] dropped GCC -g switch
from the build and linker flags (CFLAGS and LDFLAGS) saved internally
in the Python interpreter for use by distutils and other build systems.

For systemtap this means that the expected debugging symbols weren't
generated for the Helper SDT python module, e.g.:

/usr/lib/debug/usr/lib64/python3.12/site-packages/HelperSDT/_HelperSDT.\
cpython-312-x86_64-linux-gnu.so-5.1-7.el10.x86_64.debug
in systemtap-runtime-python3-debuginfo ... is missing debugging symbols.

To generate the needed debugging symbols, the -g switch  needs to be
passed explicitly to the Helper SDT gen script via extra_compile_args.

-------
[1] https://fedoraproject.org/wiki/Changes/Python_Extension_Flags_Reduction

3 months agoMake stp_task_work compatible with 6.11 kernels
Martin Cermak [Wed, 24 Jul 2024 14:47:42 +0000 (16:47 +0200)]
Make stp_task_work compatible with 6.11 kernels

Update systemtap runtime so that it works with kernel commit
68cbd415dd4b task_work:

s/task_work_cancel()/task_work_cancel_func()/

3 months agoNEWS: note .spec change re. -dtrace subrpm
Frank Ch. Eigler [Thu, 18 Jul 2024 16:32:28 +0000 (12:32 -0400)]
NEWS: note .spec change re. -dtrace subrpm

3 months agoNew sdt-dtrace subpackage for dtrace tool (rhbz#2296275)
Lumir Balhar [Thu, 18 Jul 2024 16:29:09 +0000 (12:29 -0400)]
New sdt-dtrace subpackage for dtrace tool (rhbz#2296275)

This is phase one of the approved self-contained change:
https://fedoraproject.org/wiki/Changes/Separate_dtrace_package

Phase two will be to switch all packages that need the dtrace tool
to the new systemtap-sdt-drace and then we can remove
the requirement from systemtap-sdt-devel package.

3 months agoRHBZ2297063: stap-prep should not have DEBUGINFOD_PROGRESS chattiness
Frank Ch. Eigler [Thu, 11 Jul 2024 22:42:29 +0000 (18:42 -0400)]
RHBZ2297063: stap-prep should not have DEBUGINFOD_PROGRESS chattiness

3 months agopost-release 5.2 version bump
William Cohen [Wed, 10 Jul 2024 18:14:57 +0000 (14:14 -0400)]
post-release 5.2 version bump

3 months agoUpdate tty.stp tapset for Linux 6.1 and newer
William Cohen [Tue, 2 Jul 2024 02:55:43 +0000 (22:55 -0400)]
Update tty.stp tapset for Linux 6.1 and newer

The buildok/tty-detailed.stp test was failing on Linux kernels 6.1 and
newer.  The tty.stp tapset was updated to address:

  - the n_tty_read() $buf argument becoming $kbuf
    (Linux git commit 3b830a9c34d5897be)
  - removal of the magic field from tty_struct
    (Linux git commit 7a4e0d2c7fb8e28bb)

3 months agoAllow buildok/twentyseven.stp to work on kernels with inlined do_execve()
William Cohen [Mon, 1 Jul 2024 21:06:46 +0000 (17:06 -0400)]
Allow buildok/twentyseven.stp to work on kernels with inlined do_execve()

A earlier systemtap git commit 35ea394c93d3 disabled
buildok/twentyseven.stp probing of inlined versions of do_execve()
because the arguments being used were not available on Linux 4.11
kernels for the inlined version.  However, on newer x86_64 Fedora 39
systems the compiler is optimizing the Linux kernel 6.9.7 kernel code
so only the inlined version of do_execve() exists.  Loosening the
tewentyseven.stp probe to probe both inlined and non-inlined versions
of do_execve() to allow the test to work on newer systems.

3 months agoUpdate scheduler.stp tapset to work with newer Linux kernels
William Cohen [Mon, 1 Jul 2024 20:46:48 +0000 (16:46 -0400)]
Update scheduler.stp tapset to work with newer Linux kernels

The buildok/scheduler-detailed.stp was failing due to a number
of changes in the Linux kernel.  The scheduler.stp tapset
has been updated to address those Linux kernel changes:

   - scheduler_tick() => sched_tick() (Linux git commit cad6967ac10843)
   - send_signal() => send_signal_locked() (Linux git commit 157cc18122b4a145)
   - kernel tracepoint sched_signal_send => signal_generate
     (Linux git commit d1eb650ff4130)

4 months ago+ configury refresh for last stap-prep Makefile.am tweak
Frank Ch. Eigler [Sat, 29 Jun 2024 17:13:09 +0000 (13:13 -0400)]
+ configury refresh for last stap-prep Makefile.am tweak

4 months agostap-prep: install it into $prefix/bin just like any other script
Frank Ch. Eigler [Sat, 29 Jun 2024 17:10:32 +0000 (13:10 -0400)]
stap-prep: install it into $prefix/bin just like any other script

4 months agoUpdate nfsderrno.stp to work with Linux 6.10
William Cohen [Fri, 28 Jun 2024 21:06:24 +0000 (17:06 -0400)]
Update nfsderrno.stp to work with Linux 6.10

The NFSERR_OPNOTSUPP error is not a valid NFS described
by any RFC and has been removed from the Linux 6.10
kernels by git commit 939cb14d51a.  For the Linux 6.10
kernels just make sure it is set to the value previously
used by earlier kernels for compatibility.

4 months agoUpdate pmap_agg_overflow.stp to work with Linux 6.10 kernels
William Cohen [Fri, 28 Jun 2024 18:52:16 +0000 (14:52 -0400)]
Update pmap_agg_overflow.stp to work with Linux 6.10 kernels

The Linux kernel renamed scheduler_tick() to sched_tick()
in git commit 86dd6c04ef9f213e.  Adjusted pmap_agg_overflow.stp
to allow the use of either name.

4 months agoUpdate list of semok tests that do not work with the Dyninst backend
William Cohen [Fri, 28 Jun 2024 15:59:28 +0000 (11:59 -0400)]
Update list of semok tests that do not work with the Dyninst backend

There were a couple of newer semok tests that use kernel specific
probes and/or tapset functions that will not build with the Dyninst
backend.  Those are now marked to be KFAIL to accurately reflect
the test results we expect.

4 months agoUpdate list of buildok tests that do not work with the Dyninst backend
William Cohen [Fri, 28 Jun 2024 15:54:15 +0000 (11:54 -0400)]
Update list of buildok tests that do not work with the Dyninst backend

There were a number of newer buildok tests that use kernel specific
probes and/or tapset functions that will not build with the Dyninst
backend.  Those are now marked to be KFAIL to accurately reflect
the test results we expect.

4 months agodummy commit for CI/CD
Frank Ch. Eigler [Fri, 28 Jun 2024 15:15:34 +0000 (11:15 -0400)]
dummy commit for CI/CD

4 months agoEliminate "fgrep is obsolescent" messages from systemtap.log
William Cohen [Wed, 26 Jun 2024 21:18:25 +0000 (17:18 -0400)]
Eliminate "fgrep is obsolescent" messages from systemtap.log

Clean up systemtap.log by using "grep -F" in the place of "fgrep" to
eliminate 1000+ lines of "fgrep is obsolescent" messages from
systemtap.log.

4 months agoUpdate ioblock.stp tapset for Linux 5.11 and newer kernels
William Cohen [Wed, 26 Jun 2024 20:55:23 +0000 (16:55 -0400)]
Update ioblock.stp tapset for Linux 5.11 and newer kernels

The Linux 5.11 kernels removed the $q argument from a number of block
io tracepoints.  The tapset has been adjusted to obtain the $q
information via alternative means.  The newer kernels have also
removed the bi_phys_segments field from the struct bio (Linux kernel
git commit 14ccb66b3f585).  The ioblock.stp tapset now uses the
bi_vcnt field as an approximate representation of that value.

4 months agoUpdate dev.stp tapset for Linux 6.10
William Cohen [Tue, 25 Jun 2024 02:52:32 +0000 (22:52 -0400)]
Update dev.stp tapset for Linux 6.10

Linux 6.10 changes how the partition number is stored in struct block_device.
Linux kernel git commit 1116b9fa15c097 puts the partition number in the lower
8 bits of the __bd_flags and uses an accessor function to obtain it.  The
dev.stp tapset has been adjusted to work with this newer data structure.

4 months agoRISCV registers.stp tapset updated to eliminate -Werror=missing-prototypes error
William Cohen [Wed, 5 Jun 2024 23:39:28 +0000 (07:39 +0800)]
RISCV registers.stp tapset updated to eliminate -Werror=missing-prototypes error

A number of systemtap scripts running on RISCV would get errors
messages about no previous prototype for
'_stp_regs_get_kernel_stack_nth_addr'.  The RISCV registers.stp
tapset has been adjusted to eliminate those errors.

4 months agosym.c: fix module_kallsyms_on_each_symbol not exported
tonyj@suse.de [Tue, 18 Jun 2024 16:52:15 +0000 (09:52 -0700)]
sym.c: fix module_kallsyms_on_each_symbol not exported

module_kallsyms_on_each_symbol has never been exported (as noted by
33fae2d0107f ("This one seems simply like a non-export").

If kallsyms_on_each_symbol is exported (a revert of upstream in our
SLES case) then '!defined(STAPCONF_KALLSYMS_ON_EACH_SYMBOL_EXPORTED)'
is false and the local definition of module_kallsyms_on_each_symbol is
skipped.

This results in:
ERROR: modpost: "module_kallsyms_on_each_symbol" undefined!

Fixes: 33fae2d0107fb6166b4eac3fdffd277829849ab0
Signed-off-by: Tony Jones <tonyj@suse.de>
4 months agoPR31907: STP_TIMING: BUG: using smp_processor_id() in preemptible on debug kernels
Yichun Zhang (agentzh) [Tue, 18 Jun 2024 23:11:15 +0000 (16:11 -0700)]
PR31907: STP_TIMING: BUG: using smp_processor_id() in preemptible on debug kernels

Thanks Junlong Li for the patch.

4 months agoPR31893: access_ok() was called without turning off page faults
Yichun Zhang (agentzh) [Thu, 13 Jun 2024 19:43:24 +0000 (12:43 -0700)]
PR31893: access_ok() was called without turning off page faults

This bug was in function _stp_copy_from_user() of the systemtap runtime.

Thanks Junlong Li for the patch.

4 months agoPR31861: runtime: Add STAP_MODULE_{INIT,EXIT}_HOOK
Yichun Zhang (agentzh) [Fri, 7 Jun 2024 23:25:55 +0000 (16:25 -0700)]
PR31861: runtime: Add STAP_MODULE_{INIT,EXIT}_HOOK

These C macro hooks allow tapsets to define their own C-land
initialization and finalization logic.

4 months agoexamples: add traceio3.stp
Frank Ch. Eigler [Fri, 7 Jun 2024 15:48:10 +0000 (11:48 -0400)]
examples: add traceio3.stp

Inspired by a #systemtap irc conversation.

4 months agoDisable liveness analysis for kernels with CONFIG_MITIGATION_RETPOLINE=y
William Cohen [Wed, 5 Jun 2024 19:38:54 +0000 (15:38 -0400)]
Disable liveness analysis for kernels with CONFIG_MITIGATION_RETPOLINE=y

The upstream linux git commit aefb2f2e619b6c334bc renames
CONFIG_RETPOLINE to CONFIG_MITIGATION_RETPOLINE.  The systemtap
code needs to look for CONFIG_MITIGATION_RETPOLINE setting in addition
to CONFIG_RETPOLINE and disable the liveness analysis if either one
is set.

4 months agoAddress changes in Linux 6.10 /include/linux/vmalloc.h
William Cohen [Tue, 4 Jun 2024 13:46:41 +0000 (09:46 -0400)]
Address changes in Linux 6.10 /include/linux/vmalloc.h

Upstream linux kernel git commit 88ae5fb755b0d contains a number of
changes in /include/linux/vmalloc.h that affect vmalloc, vmalloc_node,
and vzalloc_node definitions.  These are no longer functions but
macros and cannot be found in the list of symbols exported by the
kernel.  Support for vzalloc, vmalloc_node, and vzalloc_node has been
in kernels since Linux 2.6.37.  Given that systemtap requires Linux
3.10 or newer there is no longer a need to check for the existence of
these functions or provide local versions of them.

4 months agoAvoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c
William Cohen [Mon, 3 Jun 2024 19:46:49 +0000 (15:46 -0400)]
Avoid -Werror=empty-body errors from runtime/linux/uprobes-inode.c

Newer linux kernel compiles are being built with -Werror=empty-body.
For some modules generated runtime/linux/uprobes-inode.c is pulled in
and will get error messages like the following:

In file included from /tmp/stapGIM4O9/stap_ded21c54fce18c6570a8930d823aca3a_10928_src.c:2439:
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c: In function 'stapiu_change_semaphore_plus':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/uprobes-inode.c:795:5: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
  795 |     ; // already unlocked
      |     ^
cc1: all warnings being treated as errors

Added "{}" in the appropriate location to indicate to the compiler
that this is intentional.

4 months agoAvoid -Werror=old-style-declaration for stap_probes array in generated kernel modules
William Cohen [Mon, 3 Jun 2024 18:40:04 +0000 (14:40 -0400)]
Avoid -Werror=old-style-declaration for stap_probes array in generated kernel modules

With newer linux kernels additional compilers checks are being done
and will get error messages like the following for the generated
module:

/tmp/stapuundLy/stap_2755fca707746de04395c85872aae4b8_1753_src.c:111:1: error: 'static' is not at beginning of declaration [-Werror=old-style-declaration]
  111 | } static stap_probes[];
      | ^
cc1: all warnings being treated as errors

Tweaked the code generation in translate.cxx to output the static
stap_probes array in a form that is agreeable to newer kernel builds.

4 months agoAvoid -Werror=empty-body errors from runtime/linux/debug.h macros
William Cohen [Mon, 3 Jun 2024 18:23:08 +0000 (14:23 -0400)]
Avoid -Werror=empty-body errors from runtime/linux/debug.h macros

When attempting to run the testsuite the sanity.exp test fails
due to the following -Werror=empty-body errors:

/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c: In function '__stp_relay_wakeup_timer':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:47:36: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
   47 | #define dbug_trans(level, args...) ;
      |                                    ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/relay_v2.c:195:17: note: in expansion of macro 'dbug_trans'
  195 |                 dbug_trans(0, "relay_v2 wakeup timer expiry\n");
      |                 ^~~~~~~~~~
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c: In function '_stp_set_stext':
/home/wcohen/systemtap_write/install/share/systemtap/runtime/linux/debug.h:103:34: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
  103 | #define dbug_sym(level, args...) ;
      |                                  ^
/home/wcohen/systemtap_write/install/share/systemtap/runtime/transport/symbols.c:44:17: note: in expansion of macro 'dbug_sym'
   44 |                 dbug_sym(1, "found kernel _stext load address: 0x%lx\n",
      |                 ^~~~~~~~

Changed the effectively empty macros in runtime/linux/debug.h to use
"do { } while (0)" to eliminate these errors.

5 months agoman/error::pass5.7stap: extend with kernel-version-mismatch hints
Frank Ch. Eigler [Sat, 18 May 2024 16:50:13 +0000 (12:50 -0400)]
man/error::pass5.7stap: extend with kernel-version-mismatch hints

5 months agosession.cxx version report: note bumped up kernel minimum to 3.10
Frank Ch. Eigler [Sat, 18 May 2024 16:33:03 +0000 (12:33 -0400)]
session.cxx version report: note bumped up kernel minimum to 3.10

RHEL6 was previously deprecated from the runtime.

5 months agotestsuite/buildok/defined-entry.stp: tweak for newer kernels
Frank Ch. Eigler [Thu, 16 May 2024 23:00:38 +0000 (19:00 -0400)]
testsuite/buildok/defined-entry.stp: tweak for newer kernels

bunsen indicates this as a pesky failure

5 months agoPR31495: teach stap-prep to work with other RT kernels
Martin Cermak [Thu, 16 May 2024 14:51:08 +0000 (16:51 +0200)]
PR31495: teach stap-prep to work with other RT kernels

5 months agoPR31740: use of @hist_log or @hist_linear would lead to bad results in stat ops like...
Yichun Zhang (agentzh) [Wed, 15 May 2024 18:48:06 +0000 (11:48 -0700)]
PR31740: use of @hist_log or @hist_linear would lead to bad results in stat ops like @variance()

The fields bit_shift and stat_ops of pmap were never initialized
properly in such cases.

5 months agoPR31699: Eliminate kernel UBSAN messages
William Cohen [Thu, 9 May 2024 15:20:36 +0000 (11:20 -0400)]
PR31699: Eliminate kernel UBSAN messages

Fedora 39 linux 6.8.8 and recent rawhide kernels enabled UBSAN
(Undefined Behavior Sanity) checks.  The systemtap map runtime would
get UBSAN array-index-out-of-bounds checks in the dmesg output because
the dynamically allocated MAP struct is variable sized and did not
have the proper attribute describing the size of the member at the end
of the struct. A similar fix to struct addr_map was also made.

5 months agoSupport kernels that backported kallsym functions (part 2)
William Cohen [Thu, 9 May 2024 16:23:54 +0000 (12:23 -0400)]
Support kernels that backported kallsym functions (part 2)

Git commit b8d4274d1e769780 omitted a test for the Linux 6.4 version
of kallsyms function in runtime/linux/kprobes.c.

5 months agoSupport kernels that backported kallsym functions from newer linux kernels
William Cohen [Mon, 6 May 2024 15:36:42 +0000 (11:36 -0400)]
Support kernels that backported kallsym functions from newer linux kernels

Some Linux distributions may have backported
module_kallsyms_on_each_symbol and kallsyms_on_each_symbol functions
from newer linux kernels.  In these situations checking the kernel
version would not detect the proper arguments for these functions.
Systemtap now has a couple of autoconf tests to determine what
arguments should be used for these functions.

5 months agoPR31708: optimized out 'probe never' handlers in the emitted C code
Yichun Zhang (agentzh) [Tue, 7 May 2024 20:33:23 +0000 (13:33 -0700)]
PR31708: optimized out 'probe never' handlers in the emitted C code

5 months agoPR31707: Add new /* pragma:suffix */ for file-level embedded C code blocks
Yichun Zhang (agentzh) [Tue, 7 May 2024 19:20:10 +0000 (12:20 -0700)]
PR31707: Add new /* pragma:suffix */ for file-level embedded C code blocks

This is for postponing them near the end of the final C source file.

5 months agoelaborate.cxx: gcc version compatibility hack redux
Frank Ch. Eigler [Tue, 7 May 2024 19:04:04 +0000 (15:04 -0400)]
elaborate.cxx: gcc version compatibility hack redux

Note __GNUC__ >= 14 for this diagnostic.

5 months agoelaborate.cxx: gcc version compatibility hack
Frank Ch. Eigler [Tue, 7 May 2024 18:25:12 +0000 (14:25 -0400)]
elaborate.cxx: gcc version compatibility hack

Suppress -Wdangling-pointer for a construct that appears valid, but
one particular GCC snapshot version complains about.

In constructor ‘symresolution_info::symresolution_info(systemtap_session&, bool)’,
inlined from ‘int semantic_pass_symbols(systemtap_session&)’ at ../systemtap/elaborate.cxx:1872:28:
../systemtap/elaborate.cxx:2659:21: error: storing the address of local variable ‘sym’ in ‘*s.systemtap_session::symbol_resolver’ [-Werror=dangling-pointer=]
 2659 |   s.symbol_resolver = this; // save resolver for early PR25841 function resolution
      |   ~~~~~~~~~~~~~~~~~~^~~~~~
../systemtap/elaborate.cxx: In function ‘int semantic_pass_symbols(systemtap_session&)’:
../systemtap/elaborate.cxx:1872:22: note: ‘sym’ declared here
 1872 |   symresolution_info sym (s);
      |                      ^~~
../systemtap/elaborate.cxx:1870:43: note: ‘s’ declared here
 1870 | semantic_pass_symbols (systemtap_session& s)
      |                        ~~~~~~~~~~~~~~~~~~~^
cc1plus: all warnings being treated as errors

5 months agoPR31703: git_version.sh: tolerate absence of /bin/which
Frank Ch. Eigler [Mon, 6 May 2024 15:37:38 +0000 (11:37 -0400)]
PR31703: git_version.sh: tolerate absence of /bin/which

Simplify the existence test of $GIT.

6 months agosystemtap.spec typo fixes
Frank Ch. Eigler [Mon, 29 Apr 2024 17:16:04 +0000 (13:16 -0400)]
systemtap.spec typo fixes

6 months agopre-release testsuite reindex release-5.1
Frank Ch. Eigler [Fri, 26 Apr 2024 21:34:34 +0000 (17:34 -0400)]
pre-release testsuite reindex

6 months agopre-release: scripts/update-docs
Frank Ch. Eigler [Fri, 26 Apr 2024 21:33:49 +0000 (17:33 -0400)]
pre-release: scripts/update-docs

6 months agoNEWS update for 5.1
Frank Ch. Eigler [Fri, 26 Apr 2024 19:04:16 +0000 (15:04 -0400)]
NEWS update for 5.1

6 months agoPR31597: Allow time for data in buffers to be read out before shutdown
William Cohen [Fri, 26 Apr 2024 15:20:27 +0000 (11:20 -0400)]
PR31597: Allow time for data in buffers to be read out before shutdown

On SystemTap scripts using the -c <command> option some data was
dropped from the output.  This was observed with sporadic failures of
the *syscall.exp tests.  The process of shutting down the transport
layer moving data from the kernel- to user-space was not allowing time
for data to be completely drained from the buffers. A delay has been
added in the shutdown process to provided the needed time to drain the
buffers.

6 months agoPR30321 Privilege separation if invoked as root
Martin Cermak [Fri, 26 Apr 2024 15:09:45 +0000 (17:09 +0200)]
PR30321 Privilege separation if invoked as root

Provide new command line switch 'stap --build-as' that allows for
running passes 1-4 under an unprivileged user.  In case this switch
is specified, systemtap forks and runs passes 1-4 under the specified
user.  At the RPM install time a new user 'stapunpriv' is created, and
can be used with 'stap --build-as=stapunpriv'. If '--build-as' isn't
specified, systemtap behaves the traditional way, no forking happens.

This commit is a preparatory step.  Further work is supposed to happen
so that the privilege separation brings a true improvement from the
security perspective.

6 months agoPRERELEASE mass-bump
Frank Ch. Eigler [Tue, 23 Apr 2024 21:25:10 +0000 (17:25 -0400)]
PRERELEASE mass-bump

6 months agopre-release update-po
Frank Ch. Eigler [Tue, 23 Apr 2024 20:29:10 +0000 (16:29 -0400)]
pre-release update-po

6 months agoReplace egrep with grep -E
Aaron Merey [Tue, 23 Apr 2024 18:07:37 +0000 (14:07 -0400)]
Replace egrep with grep -E

Prevents the following message: "warning: egrep is obsolescent; using grep -E"

6 months agotranslate.cxx: Fix out-of-bounds vector access
Aaron Merey [Tue, 23 Apr 2024 17:29:35 +0000 (13:29 -0400)]
translate.cxx: Fix out-of-bounds vector access

The following error was found by building stap with
-D_GLIBCXX_DEBUG and -D_GLIBCXX_DEBUG_PEDANTIC:

    /usr/include/c++/13/debug/vector:442:
    In function:
        std::debug::vector<_Tp, _Allocator>::reference std::debug::vector<_Tp,
        _Allocator>::operator[](size_type) [with _Tp = bool; _Allocator =
        std::allocator<bool>; reference = std::vector<bool, std::allocator<bool>
        >::reference; size_type = long unsigned int]

    Error: attempt to subscript container with out-of-bounds index 1, but
    container only holds 1 elements.

    Objects involved in the operation:
        sequence "this" @ 0x7fffffff8e70 {
          type = std::debug::vector<bool, std::allocator<bool> >;
        }

This is caused by an incorrectly sized vector in
c_unparser::visit_functioncall.  Fix this by ensuring that
the vector cp_args has a size equal to the number of arguments
of the functioncall being visited.

6 months agoloc2stap.cxx: Add partial support for DW_OP_bra in DWARF location lists
Aaron Merey [Thu, 18 Apr 2024 01:41:57 +0000 (21:41 -0400)]
loc2stap.cxx: Add partial support for DW_OP_bra in DWARF location lists

Add support for DW_OP_bra when operand is non-negative.  Previously
systemtap would quit probe translation if DW_OP_bra was seen in a
DWARF location list.

Tested manually on RHEL 8.9 with kernel 4.18.0-513.24.1.el8_9.x86_64.
Scripts containing a vfs.read probe require DW_OP_bra support when
run with this kernel.

Support for DW_OP_bra negative operands continues to be deferred due
to lack of use as well as being more complex to implement.

https://sourceware.org/bugzilla/show_bug.cgi?id=31496

6 months agoUpdate the include files with exit reasons in kvm_service_time.stp
William Cohen [Tue, 23 Apr 2024 16:11:54 +0000 (12:11 -0400)]
Update the include files with exit reasons in kvm_service_time.stp

The Linux git commit af170c5061dd moved the location of the include
files with the SMV_EXIT_* and EXIT_REASON_* defines from
linux/arch/x86/include/asm to linux/arc/x86/include/uapi/asm.  The
kvm_service_time.stp has been updated to print out the current include
files names so a user of the kvm_service_time.stp example script has
an easier time mapping the exit reason numbers reported to the
defines.

6 months agoMake probing NFSD V2 probe points optional in buildok/nfsd-detailed.stp test
William Cohen [Wed, 17 Apr 2024 14:08:52 +0000 (10:08 -0400)]
Make probing NFSD V2 probe points optional in buildok/nfsd-detailed.stp test

Newer kernels have removed NFSD V2 suport (CONFIG_NFSD_V2 is not set).
The nfsd.proc2.* probes need to be made optional as those probe
points are not available.

6 months agoUpdate nfs-detailed.stp to test NFS folio support in newer kernels
William Cohen [Wed, 17 Apr 2024 14:04:17 +0000 (10:04 -0400)]
Update nfs-detailed.stp to test NFS folio support in newer kernels

6 months agoUpdate the nfs.stp tapset for NFS folio support
William Cohen [Wed, 17 Apr 2024 13:48:40 +0000 (09:48 -0400)]
Update the nfs.stp tapset for NFS folio support

The addition of folio support to NFS in the Linux kernel has changed
some of the functions that are available for NFS operations.  Probes
for those new functions (nfs_read_folio and nfs_readahead) were added.
The nfs tapset has to be a bit more flexible in which functions are
available and the probes are optional to allow wildcards to continue
to work.  The way count were obtained for nfs.fop.read_iter and
nfs.fop.write operations were also updated.

6 months agoUse different kernel code to exercise functioncallcount.stp example
William Cohen [Fri, 19 Apr 2024 13:58:10 +0000 (09:58 -0400)]
Use different kernel code to exercise functioncallcount.stp example

Switching the functioncallcount.stp example from counting functions in
the memory management subsystem ("*@mm/*.c") to counting functions in
the file system ("*@fs/*.c").  On some machines such as ppc64 and
arm64 wholesale probing all the functions in memory managent subsystem
has been problematic.

6 months agoAvoid redefinition of S390 PSW_ADDR_AMODE and PSW_ADDR_INSN in newer kernels
William Cohen [Tue, 16 Apr 2024 16:46:39 +0000 (12:46 -0400)]
Avoid redefinition of S390 PSW_ADDR_AMODE and PSW_ADDR_INSN in newer kernels

Only define PSW_ADDR_AMODE and PSW_ADDR_INSN if they are undefined.
The following Linux kernel git commit (b8af5999779d1) moved the definition of
PSW_ADDR_AMODE and PSW_ADDR_INSN from arch/s390/include/uapi/asm/ptrace.h
to arch/s390/include/asm/ptrace.h causing an error as both runtime/regs.h and
arch/s390/include/asm/ptrace.h headers were defining them:

Author: Heiko Carstens <hca@linux.ibm.com>  2023-06-21 07:35:43
Committer: Alexander Gordeev <agordeev@linux.ibm.com>  2023-07-03 05:19:39
Parent: 6376402841e1fa6f1c5b7604abc9c746a84c715a (s390/ptrace: remove PSW_DEFAULT_KEY from uapi)
Child:  b378a982614360686f45c3e6b63fd5d1acd02d08 (s390: include linux/io.h instead of asm/io.h)
Branches: master, remotes/origin/master
Follows: v6.4
Precedes: v6.5-rc1

    s390/ptrace: make all psw related defines also available for asm

    Use the _AC() macro to make all psw related defines also available for
    assembler files.

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
6 months agoconfigury: git_version.sh typo fixes
Tim Haines [Thu, 11 Apr 2024 22:50:45 +0000 (18:50 -0400)]
configury: git_version.sh typo fixes

Error detection was looking for wrong shell variable names.

6 months agoUpdate nfsd.stp tapset to work with Linux 6.1 and newer kernels
William Cohen [Wed, 3 Apr 2024 17:51:27 +0000 (13:51 -0400)]
Update nfsd.stp tapset to work with Linux 6.1 and newer kernels

The kernel git commit 0cfb0c4228a5c8e2 uses the
DEFINE_PROC_SHOW_ATTRIBUTE macro which creates another function
nfsd_open() in fs/nfsd/stats.c in addition to nfsd_open() in
fs/nfsd/vfs.c.  This new function has a completely different purpose
and different set of arguments than the original.  When the nfsd.stp
tapset tries to instrument this new nfsd_open() it cannot find the
expected arguments.  Systemtap scripts probing the nfsd_open()
function such as the nfsd-recent.stp example failed to build as a
result.  The tapset now restricts the probing to
nfsd_open@fs/nfsd/vfs.c, the original nfsd_open() function.

7 months agoUpdate memory.stp tapset to allow the vm.tracepoints.stp example to work
William Cohen [Sun, 31 Mar 2024 00:56:36 +0000 (20:56 -0400)]
Update memory.stp tapset to allow the vm.tracepoints.stp example to work

Due to kernel git commits 71baba4b92dc1 (renaming __GFP_WAIT to
__GFP_RECLAIM) and 2c1d697fb8ba6 (changing the kmem_cache_alloc
tracepoint arguments) the memory.stp tapset needed some adjustments to
enable the SystemTap tracepoints.stp example to continue to work with
newer kernels.

7 months agoPR31368: more configury for !HAVE_DEBUGINFOD cases
Frank Ch. Eigler [Sat, 30 Mar 2024 00:48:20 +0000 (20:48 -0400)]
PR31368: more configury for !HAVE_DEBUGINFOD cases

One more setupdwfl.cxx code needed the #if conditionals to
compile on hosts without debuginfod.h .

7 months agoPR31368: more configury for !HAVE_DEBUGINFOD cases
Frank Ch. Eigler [Sat, 30 Mar 2024 00:48:20 +0000 (20:48 -0400)]
PR31368: more configury for !HAVE_DEBUGINFOD cases

Some more setupdwfl.cxx code needed the #if conditionals to
compile on hosts without debuginfod.h .

7 months agosetupdwfl.cxx: add debuginfod.h #ifdef guards
Frank Ch. Eigler [Sat, 30 Mar 2024 00:33:14 +0000 (20:33 -0400)]
setupdwfl.cxx: add debuginfod.h #ifdef guards

7 months agoAdjust hugepage_cow_delays.stp to work with newer kernels
William Cohen [Fri, 29 Mar 2024 18:28:21 +0000 (14:28 -0400)]
Adjust hugepage_cow_delays.stp to work with newer kernels

Kernel git commit c0e8150e144b6 changed the function handling the
copy-on-write operations for hugepages from copy_user_huge_page to
copy_user_large_folio.  Made hugepage_cow_delays.stp use the new
function name when it is available.

7 months agoPR31500: Never allow probing of kernel __init or __kprobes functions
William Cohen [Fri, 22 Mar 2024 14:29:49 +0000 (10:29 -0400)]
PR31500: Never allow probing of kernel __init or __kprobes functions

When guru mode was used it was possble to get systemtap to instrument
kernel functions marked with __init or __kprobes.  By the time that
systemtap instrumentation is being loaded a kernel __init marked
functions has already run and may be in a section of memory that has
been freed up.  At best this probe will never trigger.  At worst the
registration of the probe will cause a memory fault causing the
process to be killed.  Also probes shouldn't be allowed on __kprobes
functions as a rule.

7 months agoPR31525: add preempt* controls for more STP_TIMING cases
Frank Ch. Eigler [Thu, 21 Mar 2024 22:47:01 +0000 (18:47 -0400)]
PR31525: add preempt* controls for more STP_TIMING cases

The testusite produces warnings otherwise.

7 months agoPR31519: sys/sdt.h causes compiler warnings when compiling with C++
Carl Shapiro [Thu, 21 Mar 2024 01:04:26 +0000 (21:04 -0400)]
PR31519: sys/sdt.h causes compiler warnings when compiling with C++

Add a defined(__STDC_VERSION__) guard.

7 months agoRemove unneeded guru mode option from poll_map.exp
William Cohen [Wed, 20 Mar 2024 14:24:53 +0000 (10:24 -0400)]
Remove unneeded guru mode option from poll_map.exp

Guru mode should only be used when it is really needed to allow the
systemtap script change program state or disable some safety check or
black list exclusions. With guru mode enabled on a particular machine
this test would attempt to probe
kernel.function("vfs_caches_init").call, an initialization function on
a page that would would later freed.  The script would get page fault
when attempting to install the kprobe for this function.

7 months agoAllow systemtap --target-namespace=PID option to work with Intel IBT
William Cohen [Tue, 19 Mar 2024 20:09:52 +0000 (16:09 -0400)]
Allow systemtap --target-namespace=PID option to work with Intel IBT

On Intel systemtap with IBT the systemtap runtime code to implement
--target-namespace=PID would cause a trap to occur.  The runtime
indirect calls are now properly wrapped and will execute without issue
on machines supporting Intel IBT.

7 months agoPR31495: teach step-prep to guess kernel-rt on .rt uname kernels
Frank Ch. Eigler [Fri, 15 Mar 2024 18:22:10 +0000 (14:22 -0400)]
PR31495: teach step-prep to guess kernel-rt on .rt uname kernels

This heuristic was requested by a user.

7 months agoPR31491: stapsh: support --remote=bpf
Frank Ch. Eigler [Thu, 14 Mar 2024 23:39:53 +0000 (19:39 -0400)]
PR31491: stapsh: support --remote=bpf

This needed just some code to recognize incoming ".bo" files as
something to be run via stapbpf.

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