]> sourceware.org Git - systemtap.git/log
systemtap.git
8 months agoTweak testsuite/semok/target_addr.stp to work with linux 5.14 and newer.
William Cohen [Tue, 21 Nov 2023 23:56:42 +0000 (18:56 -0500)]
Tweak testsuite/semok/target_addr.stp to work with linux 5.14 and newer.

9 months agoPR29076: syscall test fixes for .rodata on x86_64 for pwritev.c and sysfs.c
William Cohen [Wed, 15 Nov 2023 22:01:14 +0000 (17:01 -0500)]
PR29076: syscall test fixes for .rodata on x86_64 for pwritev.c and sysfs.c

9 months agoPR29076: Additional syscall test fixes for .rodata on x86_64
William Cohen [Wed, 15 Nov 2023 20:40:07 +0000 (15:40 -0500)]
PR29076: Additional syscall test fixes for .rodata on x86_64

There were a number of additional syscall tests that needed fixes
similar to git commit 6577f2237.

9 months agoFix map_hash.exp and map_wrap.exp tests
William Cohen [Thu, 9 Nov 2023 14:44:40 +0000 (09:44 -0500)]
Fix map_hash.exp and map_wrap.exp tests

At one time systemtap output hexidecimal numbers for dumping
the associative arrays.  It is currently using decimal numbers.
The map_hash.exp and map_wrap.exp tests needed to be adjusted
to recognize the current systemtap output.

9 months agobugfix: older gcc versions do not have the -Wno-infinite-recursion option.
Yichun Zhang (agentzh) [Mon, 13 Nov 2023 22:17:47 +0000 (14:17 -0800)]
bugfix: older gcc versions do not have the -Wno-infinite-recursion option.

This affect older gcc versions used to compile the kernel.

9 months agoPR31054: Non-system-wide perf event probes should not use work queues for registration
Yichun Zhang (agentzh) [Sat, 11 Nov 2023 01:46:41 +0000 (17:46 -0800)]
PR31054: Non-system-wide perf event probes should not use work queues for registration

The non-system-wide task-finder-based perf event probes do not have the
limitation of always requiring SYS_CAP_ADMIN like the system-wide ones.
So avoiding the work queue thing for this case is a nice-to-have optimization.

Getting rid of work queue in this case also make it easier if we want to
support resolving task executable file paths in another mount namespace
in the future (otherwise the current task context would be kworker
instead of stapio/staprun).

9 months agofeature: stap -t now outputs module init timing reports.
Yichun Zhang (agentzh) [Sun, 12 Nov 2023 05:32:29 +0000 (21:32 -0800)]
feature: stap -t now outputs module init timing reports.

9 months agotranslator: fixed output code indentation regarding stap -t.
Yichun Zhang (agentzh) [Sun, 12 Nov 2023 04:16:12 +0000 (20:16 -0800)]
translator: fixed output code indentation regarding stap -t.

9 months agoPR31052: -DDEBUG_MEMALLOC_MIGHT_SLEEP resulted in lots of kernel errors
Yichun Zhang (agentzh) [Sat, 11 Nov 2023 07:56:13 +0000 (23:56 -0800)]
PR31052: -DDEBUG_MEMALLOC_MIGHT_SLEEP resulted in lots of kernel errors

We should really enable `might_sleep()` only when the gfp_mask might sleep.

9 months agoPR31053: memory allocator might sleep in atomic contexts
Yichun Zhang (agentzh) [Sat, 11 Nov 2023 07:25:54 +0000 (23:25 -0800)]
PR31053: memory allocator might sleep in atomic contexts

Previously, STP_ALLOC_FLAGS used in the stap kernel runtime's
memory allocator actually included __GFP_IO and __GFP_FS flags which might
sleep. All modern kernels would trigger this bug.

STP_ALLOC_FLAGS is supposed to be used "anywhere", including atomic
contexts.

9 months agoPR31051: memory and uprobe leaks in early uprobe registraton code when errors happen
Yichun Zhang (agentzh) [Sat, 11 Nov 2023 05:51:56 +0000 (21:51 -0800)]
PR31051: memory and uprobe leaks in early uprobe registraton code when errors happen

9 months agodebug: added new MTAG macro so that we can know where the leaked allocation comes...
Yichun Zhang (agentzh) [Sat, 11 Nov 2023 05:35:39 +0000 (21:35 -0800)]
debug: added new MTAG macro so that we can know where the leaked allocation comes from.

It is still required to add MTAG invocations to the relavant code. I
prefer not adding them by default to the code base since it gets messy
very quickly.

One sample error line is like this:

    ERROR: Memory ffff88811e63b320 len=72 tag=runtime/linux/uprobes-inode.c:556
        allocation type: kmalloc. Not freed

In this example, we know the leak comes from the code after the line 556
of the source file uprobes-inode.c and also before the next MTAG
invocation.

9 months agotestsuite: PR30407 cleanup
Frank Ch. Eigler [Wed, 8 Nov 2023 00:55:26 +0000 (19:55 -0500)]
testsuite: PR30407 cleanup

The build process (including the testsuite) should not attempt to
modify $srcdir - it might be read-only.  Instead, those little files
are simply put into the git repo.  Also, switched to a dejagnu library
routine for the target file compilation, with more consistent
diagnostics.

9 months agosystemtap.spec: Correct 5.0 release timestamp
Frank Ch. Eigler [Wed, 8 Nov 2023 00:11:49 +0000 (19:11 -0500)]
systemtap.spec: Correct 5.0 release timestamp

9 months agotestsuite: auto_path.exp
Frank Ch. Eigler [Wed, 8 Nov 2023 00:10:48 +0000 (19:10 -0500)]
testsuite: auto_path.exp

Rework invocation mechanism for the workload test binaries some more.
These are now run from within the systemtap script directly, instead
of funky nested expect { } blocks inside tcl.

9 months agoprerelease datestamp fixes
Frank Ch. Eigler [Sat, 4 Nov 2023 16:19:59 +0000 (12:19 -0400)]
prerelease datestamp fixes

9 months agoFix timing issue causing failures of testcase auto_path.exp
Martin Cermak [Tue, 7 Nov 2023 11:04:16 +0000 (12:04 +0100)]
Fix timing issue causing failures of testcase auto_path.exp

9 months agoPR31028: Handle .callee probes for DWARF5 information release-5.0a
William Cohen [Fri, 3 Nov 2023 16:09:19 +0000 (12:09 -0400)]
PR31028: Handle .callee probes for DWARF5 information

DWARF5 stores call site information differently than DWARF4. The
DWARF5 call sites are tagged with DW_TAG_call_site in place of
DWARF4's DW_TAG_GNU_call_site and need to reference the
DW_AT_call_origin rather than DW_AT_abstract_origin.

Without this patch any of the tests in the
systemtap.base/listing_mode.exp testsuite using .callee() would fail
to find the associated probe point.

9 months agoDrop the tapset_functions.exp
Martin Cermak [Fri, 3 Nov 2023 14:44:42 +0000 (15:44 +0100)]
Drop the tapset_functions.exp

Drop the tapset_functions.exp.  It needs constant maintenance of the
blocklist as the systemtap codebase grows.  It's also using a
--compatible hack to access private functions.  After a discussion on
the #systemtap IRC channel the decision was to drop the testcase.

9 months agopre-release AUTHORS bump
Frank Ch. Eigler [Thu, 2 Nov 2023 20:38:28 +0000 (16:38 -0400)]
pre-release AUTHORS bump

9 months agopre-release NEWS refresh
Frank Ch. Eigler [Thu, 2 Nov 2023 20:37:09 +0000 (16:37 -0400)]
pre-release NEWS refresh

9 months agosystemtap.spec: reenable crash
Frank Ch. Eigler [Thu, 2 Nov 2023 20:36:48 +0000 (16:36 -0400)]
systemtap.spec: reenable crash

https://bugzilla.redhat.com/show_bug.cgi?id=2219728 has been solved

9 months agoAvoid conflicting with statx declaration provided by glibc 2.28 and newer.
William Cohen [Wed, 1 Nov 2023 23:58:00 +0000 (19:58 -0400)]
Avoid conflicting with statx declaration provided by glibc 2.28 and newer.

9 months agoPR31014: Uprobes registered in task finder would block the target processes for long...
Yichun Zhang (agentzh) [Mon, 30 Oct 2023 07:46:36 +0000 (00:46 -0700)]
PR31014: Uprobes registered in task finder would block the target processes for long time.

Currently, the stap runtime tries to call uprobe_register() to register new
uprobes inside the context of the target processes via the task finder.
This makes little sense for inode-based uprobes implemented in modern kernels
and also introduces significant (8ms+) delay in all the target processes via
the task work mechanism. Such delays may manifest themselves in syscalls like
epoll_wait inside the target processes.

All the target processes are affected even though only one task finder
callback gets to call uprobe_register(). Other concurrent target processes
would just wait on the lock `c->consumer_lock`.

After talking with fche, I'd propose that we should register uprobes early
before starting the task finder callbacks. This still may block a CPU core
for 8ms+ or so, but it no longer blocks all the target processes in their
own process contexts.

9 months agoPR31024: always compare the real inodes for files in overlay or union fs.
Yichun Zhang (agentzh) [Wed, 1 Nov 2023 03:16:43 +0000 (20:16 -0700)]
PR31024: always compare the real inodes for files in overlay or union fs.

overlay fs is popular in containerized applications and currently the stap
runtime does not always use the real inode for the target processes/programs.
This may make the uprobes registered on the fake inode insead of the true ones,
making the probe handlers never fire.

9 months agoPR31020: runtime: task_finder2: we didn't resolve symlink PATH in "probe process...
Yichun Zhang (agentzh) [Wed, 1 Nov 2023 06:15:30 +0000 (23:15 -0700)]
PR31020: runtime: task_finder2: we didn't resolve symlink PATH in "probe process(PATH).*"

Use of symlinks in PATH might confuse the task finder when matching
procname.

9 months agoTurn off gcc stringop-overflow warnings for syscall.exp tests
William Cohen [Wed, 1 Nov 2023 19:29:58 +0000 (15:29 -0400)]
Turn off gcc stringop-overflow warnings for syscall.exp tests

On RHEL9 and Fedora the gcc compiler warns about string manipulations
that could overflow desitnation buffer.  When the compiler warns about
these for the C code being compiled the actual systemtap test does not
run.  Passing in -Wno-stringop-overflow to the compiler to turn those
warnings off and allow the tests to run.  This eliminates about 110 of
the untested test on Fedora Rawhide.

9 months agopre-release sample index regen
Frank Ch. Eigler [Wed, 1 Nov 2023 16:59:32 +0000 (12:59 -0400)]
pre-release sample index regen

9 months agopre-release update-docs
Frank Ch. Eigler [Wed, 1 Nov 2023 16:57:50 +0000 (12:57 -0400)]
pre-release update-docs

9 months agopre-release PRERELEASE marker updates
Frank Ch. Eigler [Wed, 1 Nov 2023 16:26:44 +0000 (12:26 -0400)]
pre-release PRERELEASE marker updates

9 months agopre-release update-po
Frank Ch. Eigler [Wed, 1 Nov 2023 16:24:01 +0000 (12:24 -0400)]
pre-release update-po

9 months agoPR31018: Map operations might get no lock protections due to "pushdown lock" bugs.
Yichun Zhang (agentzh) [Tue, 31 Oct 2023 20:22:48 +0000 (13:22 -0700)]
PR31018: Map operations might get no lock protections due to "pushdown lock" bugs.

The stap translator's "pushdown lock" optimization is buggy in that it may not
emit locking code for all the code branches in the first statement needing a
lock, making subsequent statements actually needing a lock go without a lock.

The correct way is to always emit locking code for statements that might
"push down" the locks, until seeing a simple statements what don't
(like an assignment statement using "<<<").

I forgot to add that it might not necessarily be triggered by a leading "if"
statement needing a lock. Other statements that "push down" locks may
also trigger it, like nested code blocks with "if" statements.

9 months agoPR30407: Address context.exp findings
Martin Cermak [Tue, 31 Oct 2023 22:02:28 +0000 (23:02 +0100)]
PR30407: Address context.exp findings

9 months agoFix UNTESTED: retblocklist
William Cohen [Tue, 31 Oct 2023 02:00:12 +0000 (22:00 -0400)]
Fix UNTESTED: retblocklist

The file renaming in git commit d1804e051dd missed a couple files.
The result was that the retblock.exp test could not compile the
associated .c and .stp files for the test.  Moved the needed files to
retblocklist.c and retblocklist.stp and the test now runs.

9 months agoPR31012: kernel module loading might block a CPU for 1.5+ms.
Yichun Zhang (agentzh) [Mon, 30 Oct 2023 19:24:50 +0000 (12:24 -0700)]
PR31012: kernel module loading might block a CPU for 1.5+ms.

Currently, the module init code calls the expensive kernel function
kallsyms_lookup_name() several times, which would block a CPU core for
more than 1.5ms on high-speed machines (Core i9-13900K).

Each kallsyms_lookup_name() might take more than 800us here.

We should add cond_resched() calls to mitigate this blocking effect.

9 months agoPR31013: Use of sleeping _stp_stat_del() operations in atomic contexts for -t.
Yichun Zhang (agentzh) [Mon, 30 Oct 2023 21:18:08 +0000 (14:18 -0700)]
PR31013: Use of sleeping _stp_stat_del() operations in atomic contexts for -t.

When stap's -t option is specified, the stat data needed by the timing stats
are freed in atomic contexts (with preemption disabled), which may cause
kernel deadlocks.

This is because the `_stp_cleanup_and_exit` function in the runtime explicitly
disables preemption for `_stp_printf`. But we should really temporarily
re-enable premption for sleeping operations like `_stp_stat_del()`.

9 months agofeature: Add new runtime macro STP_FORCE_STDOUT_TTY to override STP_STDOUT_NOT_ATTY.
Yichun Zhang (agentzh) [Mon, 30 Oct 2023 06:13:15 +0000 (23:13 -0700)]
feature: Add new runtime macro STP_FORCE_STDOUT_TTY to override STP_STDOUT_NOT_ATTY.

9 months agoPR31011: fixed memory leaks when the -t option is specified and the stdout stream...
Yichun Zhang (agentzh) [Mon, 30 Oct 2023 05:22:27 +0000 (22:22 -0700)]
PR31011: fixed memory leaks when the -t option is specified and the stdout stream is not a tty.

Also add a new runtime macro STP_TIMING_NSECS to report probe timing stats in
nsecs instead of cycles.

9 months agoNEWS, testsuite/README: simplify, clarify
Frank Ch. Eigler [Mon, 30 Oct 2023 18:13:36 +0000 (14:13 -0400)]
NEWS, testsuite/README: simplify, clarify

Mention the testsuite Makefile changes, and simplify other NEWS.

9 months agoAlign the tapset invocation of _stp_snprint_addr() with commit 367392917
Martin Cermak [Fri, 27 Oct 2023 13:53:49 +0000 (15:53 +0200)]
Align the tapset invocation of _stp_snprint_addr() with commit 367392917

Commit 367392917 adds a new 'context' parameter to _stp_snprint_addr().
Tapset using this function wasn't updated accordingly.  Fix this now.

9 months agoNEWS: abbreviate debuginfod blurbage
Frank Ch. Eigler [Wed, 25 Oct 2023 19:28:53 +0000 (15:28 -0400)]
NEWS: abbreviate debuginfod blurbage

9 months agotranslator: fix derived-chain elaboration procedure for debuginfod.* probes etc.
Frank Ch. Eigler [Wed, 25 Oct 2023 19:12:52 +0000 (15:12 -0400)]
translator: fix derived-chain elaboration procedure for debuginfod.* probes etc.

Previous to this patch, stap -L / -p2 mode outputs for debuginfod.*
probes show relatively uninformative process("buildid").* probe
points, losing all track of what archive and especially what program
name those probes were derived from.  Now we more carefully construct
the derivation chain for debuginfod.* probes.  For probes that contain
wildcards in the .archive() or .process() names, an extra intermediate
probe is inserted into the chain, with the wildcards expanded.

stap -vv -L   now lists the entire probe /* derivation chain */.

The heuristics as to what canonical name to use rides on a probe-level
flag called "well_formed".  This is intended to bypass those probes
that have wildcards in them, so that the end-user would see the
expanded forms.  However, this flag cannot be computed locally & correctly
because wildcards can pop up in different levels of probe resolution.

Consider: debuginfod.archive("*").process("foo").function("*") When
the debuginfod builder resolves the first wildcard, the probe point is
"well formed" with respect to its wildcards, but another one still
remains down there in .function("*").  So it's not overall "well
formed", just locally.  What we need is something like a
probe-point-component level "well-formed"ness, which aggregates via
"and" overall.  Anyway, that's for later.

9 months agoAdded test case and documentation to NEWS
Housam Alamour [Mon, 23 Oct 2023 00:09:59 +0000 (20:09 -0400)]
Added test case and documentation to NEWS

9 months agoChange from "package" to "archive" naming convention.
Housam Alamour [Wed, 18 Oct 2023 18:46:16 +0000 (14:46 -0400)]
Change from "package" to "archive" naming convention.

9 months agoconfigury: rework debuginfod searches
Frank Ch. Eigler [Tue, 17 Oct 2023 18:24:59 +0000 (14:24 -0400)]
configury: rework debuginfod searches

Support --with-debuginfod=/PATH mode invocation to point at an
elfutils $prefix (install tree base).  This is necessary to build
metadata query support, which is not yet in system elfutils libraries.

9 months agoPR30803: strip .package() probe-point component from subsidiary probes
Frank Ch. Eigler [Tue, 17 Oct 2023 16:20:22 +0000 (12:20 -0400)]
PR30803: strip .package() probe-point component from subsidiary probes

9 months agoFix for case where empty string is input for .process($archive) argument
Housam Alamour [Thu, 12 Oct 2023 20:40:43 +0000 (16:40 -0400)]
Fix for case where empty string is input for .process($archive) argument

9 months agoFix to search only the archive base filename instead of the archive full path for...
Housam Alamour [Tue, 10 Oct 2023 20:37:17 +0000 (16:37 -0400)]
Fix to search only the archive base filename instead of the archive full path for the package string

9 months agoPR30803: *tapset-debuginfod.cxx
Housam Alamour [Fri, 6 Oct 2023 21:12:19 +0000 (17:12 -0400)]
PR30803: *tapset-debuginfod.cxx
Added package to the parameters.

9 months agoPR30987: Exclude strlcpy and strlcat for glibc 2.38 and newer
William Cohen [Wed, 25 Oct 2023 15:51:17 +0000 (11:51 -0400)]
PR30987: Exclude strlcpy and strlcat for glibc 2.38 and newer

The glibc library added strlcpy and strlcat.  The inlined functions in
runtime/dyninst/linux_defs.h conflicted with the glibc declarations of
those functions in /usr/include/string.h.  Now linux_defs.h only
defines those functions for older version of glibc that do not include
them.

9 months agoPR30407: Add DWARF5 support to print_ubacktrace_fileline()
Martin Cermak [Wed, 25 Oct 2023 09:59:12 +0000 (11:59 +0200)]
PR30407: Add DWARF5 support to print_ubacktrace_fileline()

Add DWARF5 support to the tapsef function print_ubacktrace_fileline().

DWARF5 comes with a different line number program header compared to
DWARF4, see section 6.2.4 of the DWARF5 standard.  The DWARF5 specific
part of the header is now processed in a new _stp_filename_lookup_5().

This _stp_filename_lookup_5() needs to parse relatively big chunk of
information from DWARF (paths and file names).  Storing these within
local arrays may cause problems with the stack size.  For this reason
the storage was moved out to the context struct (dw_data).  For this
reason, various callers need to pass the pointer to the context struct
to their callees.  Finally _stp_filename_lookup_5() needs to see the
context struct at the KO compile time.  Since the context struct is
emitted to the stap_XXXXXX_src.i (within s.up->emit_common_header ())
after the main header file for Linux runtime.h (which includes sym.c),
the _stp_filename_lookup_5() was separated out into sym2.c for later
emission.

This update comes with a testcase systemtap.base/pr30407.exp.

9 months agoAdd wget requires to systemtap-testsuite for systemtap.http_exporter test.
William Cohen [Mon, 23 Oct 2023 18:42:20 +0000 (14:42 -0400)]
Add wget requires to systemtap-testsuite for systemtap.http_exporter test.

9 months agoAllow sdt_buildid.exp to run with and without DEBUGINFOD_URLS environment var
William Cohen [Fri, 20 Oct 2023 15:29:03 +0000 (11:29 -0400)]
Allow sdt_buildid.exp to run with and without DEBUGINFOD_URLS environment var

The sdt_buildid.exp test would have an error and fail to run if the
environment did not have DEBUGINFOD_URLS.  It now checks that the
DEBUGINFOD_URLS environment variable is available before trying to use
it.

10 months agobuildbot test, ignore
Frank Ch. Eigler [Fri, 13 Oct 2023 02:42:52 +0000 (22:42 -0400)]
buildbot test, ignore

10 months agoPR30401: Address newer s390 kernels that move struct stack_frame
William Cohen [Thu, 12 Oct 2023 03:10:21 +0000 (23:10 -0400)]
PR30401: Address newer s390 kernels that move struct stack_frame

Linux git commit 78c98f907413 moved struct stack_frame
<asm/processor.h> to a newly created <asm/stacktrace.h>.  As a result
the struct definition does not get pulled in by the existing
<asm/ptrace.h> include for the newer kernels.  Have a autoconf test to
determine whether the <asm/stacktrace.h> exists and uses it if it
avaialble.

10 months agotestsuite: add cve-2023-4911 band-aid
Frank Ch. Eigler [Thu, 12 Oct 2023 17:10:53 +0000 (13:10 -0400)]
testsuite: add cve-2023-4911 band-aid

As seen on TV ^W https://access.redhat.com/security/cve/CVE-2023-4911

10 months agotestsuite: drop busybox test case
Frank Ch. Eigler [Thu, 12 Oct 2023 17:02:39 +0000 (13:02 -0400)]
testsuite: drop busybox test case

This test case (with an old fixed version of busybox) has been a
problem with respect to compatibility with newer libc/kernels,
with readonly source trees, and doesn't seem to contribute much
to test value.  So nuke it all.

10 months agotestsuite: simplify Makefile drivers
Frank Ch. Eigler [Thu, 12 Oct 2023 16:45:09 +0000 (12:45 -0400)]
testsuite: simplify Makefile drivers

It was reported that "make installcheck" broke with commit
218c26a523816.  Investigation pointed at quoting mishaps somewhere in
the Makefile machinery related to parallel / partial testsuite runs.
While this logic was clever and appeared useful for a time, it seems
fragile in practice and not in active use after all.  So let's nuke
all of it.

Moved the environment_sanity.exp test into the systemtap/ subdirectory
to apprx. guarantee that it's run first, no Makefile magic needed.  It
still exits dejagnu entirely if it fails.

10 months agoTeach stap-prep to use new versions of dnf (if available)
Martin Cermak [Thu, 12 Oct 2023 14:55:47 +0000 (16:55 +0200)]
Teach stap-prep to use new versions of dnf (if available)

10 months agodocs: mark another timestamp with PRERELEASE
Frank Ch. Eigler [Thu, 12 Oct 2023 01:02:52 +0000 (21:02 -0400)]
docs: mark another timestamp with PRERELEASE

10 months agotestsuite: finish removing dejazilla artifacts, restoring dejagnu *check rc
Frank Ch. Eigler [Wed, 11 Oct 2023 23:44:05 +0000 (19:44 -0400)]
testsuite: finish removing dejazilla artifacts, restoring dejagnu *check rc

Way back during early dejazilla days, the "check-local" target was
needed in order to liberate test results, regardless of pass/failure
of the dejagnu suite.  To make that work, an "execrc" wrapper was
interposed between make and dejagnu/runtest, to turn everything into
a pass rc=0.

Dejagnu support was removed in 2022, so this execrc hack is not needed
any more.  Tests that fail, especially the early
systemtap.base/environment_sanity.exp one, should stand out better
in buildbot reports.

10 months agoRHEL-12499: tweak stap-prep sans-debuginfod notice
Frank Ch. Eigler [Wed, 11 Oct 2023 14:56:14 +0000 (10:56 -0400)]
RHEL-12499: tweak stap-prep sans-debuginfod notice

Try harder not to alarm people.

10 months agoPR27410 cont'd: Tolerate (skip) foreign-architecture binaries via debuginfod
Frank Ch. Eigler [Fri, 6 Oct 2023 14:44:04 +0000 (10:44 -0400)]
PR27410 cont'd: Tolerate (skip) foreign-architecture binaries via debuginfod

With debuginfod path probes, it is easy to refer to a whole slew of
binaries.  That's a good thing, but debuginfod may be so well informed
that it sends stap buildids of foreign-architecture binaries too.
systemtap should skip these guys instead of having a cow.

New common tapsets.cxx code makes architecture mismatch generally a
warning rather than a direct semantic error.  This has effects beyond
the debuginfod based probes, but that should be fine.
Bad-architecture target binaries will just be skipped in other
contexts too.  Tweaked debuginfod.process() builder code makes the
subsidiary buildid-based process probes all optional, as though they
were identified by glob ... which in a manner of speaking they were.

10 months agoEliminate use of kernel's flush_scheduled_work() in systemtap modules
William Cohen [Wed, 27 Sep 2023 14:09:11 +0000 (10:09 -0400)]
Eliminate use of kernel's flush_scheduled_work() in systemtap modules

Kernel git commit 20bdedafd2f63e0ba70991127f9b5c0826ebdb32 turns use
of flush_scheduled_work() into a warning which causes builds of
anything using it to fail because warnings are treated as errors.
Previous users of flush_scheduled_work() in the kernel have been
converted over to use individual workqueues.  Systemtap runtime now
does the same.  It creates and uses its own workqueue to eliminate the
use of flush_scheduled_work().

10 months agoUse TWA_RESUME in the runtime calls to task_work_add
William Cohen [Fri, 15 Sep 2023 19:12:11 +0000 (15:12 -0400)]
Use TWA_RESUME in the runtime calls to task_work_add

Kernel git commit c40e60f00caf18bc382215c79651777eb40f5f9d in the
linux 6.6 kernels will cause the implicit conversion of boolean true
to an enum task_work_notify_mode to be flagged resulting in the
systemtap instrumentation compile to fail.  Adding a config check to
use TWA_RESUME if it is available or pass in the equivalent true
argument for older kernels.

10 months agoEliminate use of do_each_thread() macro
William Cohen [Tue, 12 Sep 2023 15:34:24 +0000 (11:34 -0400)]
Eliminate use of do_each_thread() macro

The Linux kernel commit 5ffd2c37cb7a5 removed the do_each_thread()
macro and suggests using the for_each_process_thread() in its place.
The Systemtap runtime has been migrated to using the more concise
macro.  The for_each_process_thread() macro was added by commit
0c740d0afc3bff to Linux 3.14, January 2014, almost a decade ago, so it
should be available on modern systems.

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.

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