]> sourceware.org Git - systemtap.git/log
systemtap.git
2 years agoUse ppc32 names for ppc64 code, that is what the liveness analysis expects.
William Cohen [Fri, 3 Dec 2021 20:16:13 +0000 (15:16 -0500)]
Use ppc32 names for ppc64 code, that is what the liveness analysis expects.

2 years agogcc12 c++ compatibility re-tweak for rhel6: use function pointer instead of lambdas...
Serhei Makarov [Fri, 21 Jan 2022 23:21:46 +0000 (18:21 -0500)]
gcc12 c++ compatibility re-tweak for rhel6: use function pointer instead of lambdas instead of ptr_fun<>

Saving 2 lines in ltrim/rtrim is probably not a good reason to drop
compatibility with the RHEL6 system compiler.  Actually declaring a
named function and passing the function pointer is compatible with
everything.

2 years agoPR28804: tune default stap -s ## buffer size on small RAM machines
Frank Ch. Eigler [Fri, 21 Jan 2022 21:15:19 +0000 (16:15 -0500)]
PR28804: tune default stap -s ## buffer size on small RAM machines

Use si_meminfo to limit default buffer size.  Note in the man page
that the "-s ##" parameter is per-CPU.

2 years agoImprove python probing fix for rhbz2027683
Martin Cermak [Fri, 21 Jan 2022 15:05:34 +0000 (16:05 +0100)]
Improve python probing fix for rhbz2027683

Without this update, python3 probing would only work
with python3 symlinked to python, which might not
always be in place.

2 years agoFix python probing rhbz2027683
Martin Cermak [Thu, 20 Jan 2022 17:18:00 +0000 (18:18 +0100)]
Fix python probing rhbz2027683

2 years agogcc12 c++ compatibility tweak: use lambdas instead of ptr_fun<>
Jonathan Wakely [Tue, 18 Jan 2022 20:52:18 +0000 (15:52 -0500)]
gcc12 c++ compatibility tweak: use lambdas instead of ptr_fun<>

Even while stap is a c++11 code base, such cleanups make code
nicer to look at.

2 years agoGraceful continuation when not enough memory available for liveness analysis
William Cohen [Tue, 18 Jan 2022 03:02:44 +0000 (22:02 -0500)]
Graceful continuation when not enough memory available for liveness analysis

The dyninst parsing of binaries can take a significant amount of
memory.  On machines without enough memory to parse a large binary we
want the analysis to fail gracefully with a warning that the liveness
analysis was unable to run and continue on rather than immediately
exiting with a std::bad_alloc exception.

2 years agorhbz2041596: replace /var/run -> /run throughout
Frank Ch. Eigler [Mon, 17 Jan 2022 20:19:32 +0000 (15:19 -0500)]
rhbz2041596: replace /var/run -> /run throughout

/var/run is "legacy" and one must reject legacy

2 years agoProbe ksys_read instead of the unreachable sys_read
Stan Cox [Mon, 17 Jan 2022 18:54:35 +0000 (13:54 -0500)]
Probe ksys_read instead of the unreachable sys_read

sys_read is no longer accessible and the test is not specific to a
particular probe point.

2 years agoconfigure finds appropriate default 32-bit or 64-bit Dyninst libraries
William Cohen [Fri, 14 Jan 2022 19:00:02 +0000 (14:00 -0500)]
configure finds appropriate default 32-bit or 64-bit Dyninst libraries

Earlier versions of the systemtap configuration would just include
two -L paths to both 32-bit and 64-bit versions of the Dyninst
libraries.  However, attempting to link a 32-bit library with a 64-bit
build (and vice versa) may cause the build to fail.  This revision of
the configure tests determines which default Dyninst library works
with the compiler being used and selects it.

The configure can't bindly use ${libdir}/dyninst to select the path to
the default Dyninst libary as this only selects the ${prefix}/lib64 on
appropriate machines if the prefix is /usr.  If the prefix is set to
something else, ${libdir} is always ${prefix}/lib.  The would cause
the build to attempt to link with nonexistent Dyninst libaries in the
${prefix} directory.  If systemtap needs to be use a version of
Dysninst in a non-standard place, the --with-dyninst=<path_to_dyninst>
should be used.

2 years agoPR28781: translator: imply -d from -c/-x
Frank Ch. Eigler [Fri, 14 Jan 2022 02:03:48 +0000 (21:03 -0500)]
PR28781: translator: imply -d from -c/-x

Add unwindsyms data always for commands mentioned via -c/-x.

2 years agoPR28778: gcc warning tweak for sprintf precision parameter
Frank Ch. Eigler [Thu, 13 Jan 2022 23:33:15 +0000 (18:33 -0500)]
PR28778: gcc warning tweak for sprintf precision parameter

A precision=-1 sentinel value got interpreted as UINT_MAX in a
context, leading to diagnostics like:

/usr/share/systemtap/runtime/vsprintf.c:341:23: error: 'strnlen' specified bound 4294967295 may exceed maximum object size 2147483647 [-Werror=stringop-overread]

Adding a clamp_t() around the parameter field to keep it limited to
STP_BUFFER_SIZE (8K by default), which is apprx. the limit for a
single printf.

2 years agoTie vardie_from_symtable test to a specific function.
Stan Cox [Wed, 12 Jan 2022 16:43:32 +0000 (11:43 -0500)]
Tie vardie_from_symtable test to a specific function.

Change the probe test for vardie_from_symtable so it compiles.

2 years agoUpdate liveness macro arguments so code compile if analysis disabled.
William Cohen [Wed, 12 Jan 2022 13:04:40 +0000 (08:04 -0500)]
Update liveness macro arguments so code compile if analysis disabled.

2 years agoAdjust for unused global variable decimal automatic logging
Stan Cox [Tue, 11 Jan 2022 21:27:53 +0000 (16:27 -0500)]
Adjust for unused global variable decimal automatic logging

Unused global variable automatic logging is now in decimal.

2 years agoCorrect typo and include information about location of target being analyzed.
William Cohen [Mon, 10 Jan 2022 19:48:27 +0000 (14:48 -0500)]
Correct typo and include information about location of target being analyzed.

2 years agoAdd proper warning if liveness analysis unable to parse the binary.
William Cohen [Mon, 10 Jan 2022 19:24:17 +0000 (14:24 -0500)]
Add proper warning if liveness analysis unable to parse the binary.

2 years agosecurity-band-aids/cve-2021-4155: new sample script
Frank Ch. Eigler [Tue, 11 Jan 2022 20:13:21 +0000 (15:13 -0500)]
security-band-aids/cve-2021-4155: new sample script

2 years agoCleanly skip analysis if unable to open and parse the binary.
William Cohen [Mon, 10 Jan 2022 18:31:34 +0000 (13:31 -0500)]
Cleanly skip analysis if unable to open and parse the binary.

2 years agoAdd the dwarf op DW_OP_form_tls_address
Stan Cox [Tue, 11 Jan 2022 16:02:48 +0000 (11:02 -0500)]
Add the dwarf op DW_OP_form_tls_address

Add the dwarf op DW_OP_form_tls_address as a synonym for
GNU_push_tls_address; which matches the gcc/gdb implementation.

2 years agoStandardize dyninst include file use.
Stan Cox [Fri, 7 Jan 2022 17:01:49 +0000 (12:01 -0500)]
Standardize dyninst include file use.

Change stapdyn to use the more standard '#include <dyninst/*.h>' form
and the standard include path.  Adjust configure so that
--with-dyninst=PATH works, assuming PATH is a /usr style path laid out
in standard linux form.

2 years agoPR28634: Update ioscheduler.stp for kernel-5.16
Martin Cermak [Mon, 13 Dec 2021 16:47:54 +0000 (17:47 +0100)]
PR28634: Update ioscheduler.stp for kernel-5.16

2 years agosystemtap.examples/io/iostat-scsi.stp: Update for kernel-5.16.0
Martin Cermak [Wed, 8 Dec 2021 21:41:17 +0000 (22:41 +0100)]
systemtap.examples/io/iostat-scsi.stp: Update for kernel-5.16.0

Make systemtap.examples/io/iostat-scsi.stp work with
kernel-5.16.0-0.rc2.20211124git5d9f4cf36721.19.fc36

Related: PR28633

2 years agosys/sdt.h fp constraints: aarch64, s390
Stan Cox [Tue, 7 Dec 2021 14:55:01 +0000 (09:55 -0500)]
sys/sdt.h fp constraints: aarch64, s390

Remove float constraints as per commit 1d3653936 but for aarch64 and s390.

2 years agosys/sdt.h fp constraints cont'd, x86-64 edition
Frank Ch. Eigler [Mon, 6 Dec 2021 17:06:06 +0000 (12:06 -0500)]
sys/sdt.h fp constraints cont'd, x86-64 edition

It appears that various versions of gcc continue to show signs of
confusion at our newly offered asm-operand alternatives for floating
point sdt.h marker parameters.

e.g., https://bugzilla.redhat.com/show_bug.cgi?id=2028798

We may need to restore previous constraints broadly, forcing the
compiler to plop floating point parameters into integer storage.

2 years agoHandle user supplied sdt probe argument template
Stan Cox [Wed, 1 Dec 2021 21:19:22 +0000 (16:19 -0500)]
Handle user supplied sdt probe argument template

User supplied templates were erroneously removed by commit eaa15b047,
which complicated the template expansion. To do the above the
expansion of STAP_PROBE_ASM(provider, fooprobe,
STAP_PROBE_ASM_TEMPLATE(3)) adds an unused argument:
STAP_PROBE_ASM(provider, fooprobe, /*template expansion*/ "%[SDT..]..",
"use _SDT_ASM_TEMPLATE") A supplied template
STAP_PROBE_ASM(provider, fooprobe, "4@%rdx 8@%rax") is left alone.  If
the varargs has 2 args (the fake "use ..") then macro expansion
inserts the expanded string, otherwise "4@.." becomes an ascii op.

2 years agoRHBZ2026858: on __arm__ (arm32), use STAP_SDT_ARG_CONSTRAINT = g
Frank Ch. Eigler [Wed, 1 Dec 2021 15:59:27 +0000 (10:59 -0500)]
RHBZ2026858: on __arm__ (arm32), use STAP_SDT_ARG_CONSTRAINT = g

2 years agotapset/linux/nfs.stp: Fix rhbz1972798
Martin Cermak [Wed, 1 Dec 2021 13:04:57 +0000 (14:04 +0100)]
tapset/linux/nfs.stp:  Fix rhbz1972798

2 years agoRefix use of sysuser.d/* for user/group management
Martin Cermak [Thu, 25 Nov 2021 09:35:42 +0000 (10:35 +0100)]
Refix use of sysuser.d/* for user/group management

Related BZ2012907.

2 years agoFix use of sysuser.d/* for user/group management
Martin Cermak [Wed, 24 Nov 2021 08:16:49 +0000 (09:16 +0100)]
Fix use of sysuser.d/* for user/group management

Related BZ2012907.

2 years agoPR28618 stapregex: allow non-capturing group
Serhei Makarov [Mon, 22 Nov 2021 20:15:57 +0000 (15:15 -0500)]
PR28618 stapregex: allow non-capturing group

2 years agoconfigury: let python3 be python3
Frank Ch. Eigler [Sat, 20 Nov 2021 03:22:45 +0000 (22:22 -0500)]
configury: let python3 be python3

Our baroque heuristics for identifying python2/3 under their various
historical aliases is showing its age.  On some modern distros,
/usr/bin/python is to be positively NOT used.  Fixing configure.ac
$PYTHON3 search to only look for python3, and not even consider
$PYTHON_UNKNOWN.  At some point we'll want to simplify further, and
get rid of python2 remnants.

2 years agoautoconf: version bumps for the next release-4.7
Serhei Makarov [Mon, 15 Nov 2021 22:24:33 +0000 (17:24 -0500)]
autoconf: version bumps for the next release-4.7

2 years agoversion bumps for the next release-4.7
Serhei Makarov [Mon, 15 Nov 2021 22:23:57 +0000 (17:23 -0500)]
version bumps for the next release-4.7

2 years agosystemtap.spec: release-4.6 w/correct date release-4.6
Serhei Makarov [Mon, 15 Nov 2021 14:31:38 +0000 (09:31 -0500)]
systemtap.spec: release-4.6 w/correct date

2 years agoNEWS: release-4.6
Serhei Makarov [Mon, 15 Nov 2021 14:27:57 +0000 (09:27 -0500)]
NEWS: release-4.6

2 years agosystemtap.spec: actually add the wiki link
Serhei Makarov [Mon, 15 Nov 2021 14:27:43 +0000 (09:27 -0500)]
systemtap.spec: actually add the wiki link

2 years agosystemtap.spec: release-4.6
Serhei Makarov [Mon, 15 Nov 2021 13:32:56 +0000 (08:32 -0500)]
systemtap.spec: release-4.6

2 years agoPR28449: runtime/transport: bump up _stp_subbuf_size to 64K
Frank Ch. Eigler [Mon, 15 Nov 2021 02:59:05 +0000 (21:59 -0500)]
PR28449: runtime/transport: bump up _stp_subbuf_size to 64K

After commit cd48874296, it was reported that the kernel-side I/O
buffers could be exhausted more easily by the some tests in the
testsuite.  This resulted in "bufhdr corrupted ..." type messages
coming from the syscall.exp test case for example.

We bump up the $subject variable, so without "stap -s XYZ", the
default kernel->user transport will consist of 256 subbufs of 64K
each, per cpu.  (When a user does supply -s XYZ, the number gets
overridden, and the subbuf size may be quite a bit larger.)  With the
new default, the syscall.exp suite runs bufhdr-clean on an 8cpu box.

2 years agoPR28557: module probe insertion on modern kernels
Frank Ch. Eigler [Sun, 14 Nov 2021 21:28:12 +0000 (16:28 -0500)]
PR28557: module probe insertion on modern kernels

For reasons not completely understood, kernels in the 5.* range have
stopped taking module kprobes registrations of the form the runtime
has offered them.  New code in runtime/linux/kprobes.c
(stapkp_prepare_kprobe) now tried to fully relocate addresses itself,
rather than letting the kernel try it with symbols / kallsyms.

Added more diagnostic prints in nearby symbol/kprobe code paths and a
few more error checks in transport.

2 years agopre-release-4.6: tested kernel versions
Serguei Makarov [Tue, 9 Nov 2021 16:30:33 +0000 (11:30 -0500)]
pre-release-4.6: tested kernel versions

2 years agoNEWS: clarify liveness analysis entry
Serguei Makarov [Mon, 8 Nov 2021 20:52:55 +0000 (15:52 -0500)]
NEWS: clarify liveness analysis entry

2 years agoNEWS: couple more bpf additions
Serguei Makarov [Mon, 8 Nov 2021 20:12:07 +0000 (15:12 -0500)]
NEWS: couple more bpf additions

2 years agopre-release-4.6: regen examples index
Serguei Makarov [Mon, 8 Nov 2021 19:49:56 +0000 (14:49 -0500)]
pre-release-4.6: regen examples index

2 years agopre-release-4.6: regen docs
Serguei Makarov [Mon, 8 Nov 2021 19:46:57 +0000 (14:46 -0500)]
pre-release-4.6: regen docs

2 years agopre-release-4.6: make update-po
Serguei Makarov [Mon, 8 Nov 2021 18:46:37 +0000 (13:46 -0500)]
pre-release-4.6: make update-po

2 years agoAUTHORS: new authors for release-4.6
Serguei Makarov [Mon, 8 Nov 2021 18:44:24 +0000 (13:44 -0500)]
AUTHORS: new authors for release-4.6

2 years agoAdd NEWS blurb about riscv64 support.
William Cohen [Fri, 5 Nov 2021 13:34:45 +0000 (09:34 -0400)]
Add NEWS blurb about riscv64 support.

2 years agoprocfs_bpf.exp PR28544: fix string handling error
Serguei Makarov [Thu, 4 Nov 2021 15:33:36 +0000 (11:33 -0400)]
procfs_bpf.exp PR28544: fix string handling error

This was causing a procfs_bpf.exp failure on recent RHELs
as a non-zero-padded string passed from the procfs pipe
caused buffer garbage to be passed to the stap script.

2 years agoman/stap.1.in stapregex: clarify POSIX ERE features
Serguei Makarov [Thu, 4 Nov 2021 12:53:11 +0000 (08:53 -0400)]
man/stap.1.in stapregex: clarify POSIX ERE features

Although stapregex was based on re2c, its current feature set implements
POSIX Extended Regular Expressions. However, a lot of POSIX ERE docs
that come up in a web search include extra stuff (e.g. the Boost doc).
Refer the user more clearly to egrep(1) for the exact list of features.

2 years agopass-2 elaborate: autocast: suppress "Potential type mismatch in reassignment"
Frank Ch. Eigler [Tue, 2 Nov 2021 22:48:34 +0000 (18:48 -0400)]
pass-2 elaborate: autocast: suppress "Potential type mismatch in reassignment"

Analysis indicates this warning is not that helpful, and extra
diagnostics just added for autocasting should help work around
polymorphism issues that this warning would have identified earlier.

2 years agoAdd -faligned-new to CXXFLAGS when available to compile dyninst 10.1 code
William Cohen [Tue, 2 Nov 2021 15:20:27 +0000 (11:20 -0400)]
Add -faligned-new to CXXFLAGS when available to compile dyninst 10.1 code

Fedora 30 and 31 have Dyninst 10.1.  The code added to dyninst
by commit a00056bec6a0265afb592944dde2ff461b525e8d makes some data
structures cache aligned (128 bytes).  The c++ compiler ends up flagging that
as an error:

  CXX      stap-analysis.o
/notnfs/smakarov/stap-checkout/analysis.cxx: In constructor â€˜analysis::analysis(std::string)’:
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: error: â€˜new’ of type â€˜Dyninst::ParseAPI::SymtabCodeSource’ with extended alignment 128 [-Werror=aligned-new=]
   59 |  sts = new SymtabCodeSource(name_str);
      |                                     ^
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: note: uses â€˜void* operator new(std::size_t)’, which does not have an alignment parameter
/notnfs/smakarov/stap-checkout/analysis.cxx:59:37: note: use â€˜-faligned-new’ to enable C++17 over-aligned new support
cc1plus: all warnings being treated as errors
make[2]: *** [Makefile:1724: stap-analysis.o] Error 1

To make the compiler happy adding a -faligned-new option to the
CXXFLAGS when it is available.  This issue does not affect later
releases of dyninst as the problem code was removed from dyninst in
git commit d233ae7596cd74201d634c2f0f7d7a0e3d628e79.

2 years agodwarf type details: trace at -v level 5
Frank Ch. Eigler [Tue, 2 Nov 2021 17:24:20 +0000 (13:24 -0400)]
dwarf type details: trace at -v level 5

Our type-detail inference (tagging some staptree nodes with DWARF DIE
pointers) in pass 2 was not very verbose about its work, making
type-mismatch warnings harder to diagnose.  Add a ::print() virtual
function to exp_type_details() and derived classes.  Call it from
resolve_details(), renamed from resolved_details().

2 years agoruntime: port to kernel 5.15-rc
Frank Ch. Eigler [Mon, 1 Nov 2021 14:08:13 +0000 (10:08 -0400)]
runtime: port to kernel 5.15-rc

get_mm_exe_file got unexported.  Deal with it the usual way.

2 years agoconfigury: fix -ltbb for DYNINST_LIBS
Frank Ch. Eigler [Sun, 31 Oct 2021 00:04:10 +0000 (20:04 -0400)]
configury: fix -ltbb for DYNINST_LIBS

Some versions/builds of dyninst don't require -ltbb, and it is
unavailable on some platforms.  So look for it conditionally.

2 years agostaprun/relay.c: bypass compiler warning
Frank Ch. Eigler [Sat, 30 Oct 2021 23:50:21 +0000 (19:50 -0400)]
staprun/relay.c: bypass compiler warning

Newly added code did a read(2), deliberately ignoring how many bytes
were read.  Some gcc versions complain.  Phrase the same operation
differently to make gcc happier.

2 years agoPR28449: fix cross-cpu message ordering
Frank Ch. Eigler [Sat, 30 Oct 2021 19:21:31 +0000 (15:21 -0400)]
PR28449: fix cross-cpu message ordering

Correct unintended loss of cross-cpu message total-ordering via commit
8819e2a04596d by packetizing normal printf() traffic.  This also
restores bulk mode / stap-merge operation to same as before.  staprun
now has a builtin merge equivalent built on threads, with some
message-loss fault-tolerance.  A new "dumpalot" test produces ample
output with varying "-s BUFFER" runs.  While in the vicinity, the old
"relay_old.c" (<=rhel5) file is nuked; it was not even compiled.

2 years agosystemtap.base/labels.exp: also accept 'Child process exited'
Serguei Makarov [Fri, 29 Oct 2021 02:11:28 +0000 (22:11 -0400)]
systemtap.base/labels.exp: also accept 'Child process exited'

Finding more testcases which fail due to new 'Child process' status warnings.
Here the test program returns status 1 so the failure is spurious.

2 years agoAdd info about guru-mode checks and syscall_any tapset changes to NEWS.
William Cohen [Fri, 29 Oct 2021 16:45:14 +0000 (12:45 -0400)]
Add info about guru-mode checks and syscall_any tapset changes to NEWS.

2 years agoAdjust analysis code to compile with older Dyninst 9
William Cohen [Thu, 28 Oct 2021 20:13:56 +0000 (16:13 -0400)]
Adjust analysis code to compile with older Dyninst 9

The Block getInsn method and InsnLoc constructor have different
signature in older Dyninst 9.  To hide those differences between
version of Dyninst just put the method invocation in the constructor
and let the compiler figure out which type the parameter is.

2 years agoUpdate test_unused.exp to match current unused variable analysis output.
William Cohen [Thu, 28 Oct 2021 20:06:25 +0000 (16:06 -0400)]
Update test_unused.exp to match current unused variable analysis output.

2 years agoTolerate dyninst10's need for -lboost_system in analysis.cxx
William Cohen [Thu, 28 Oct 2021 17:38:02 +0000 (13:38 -0400)]
Tolerate dyninst10's need for -lboost_system in analysis.cxx

The analysis code uses dyninst.  As a result the new analysis code in
the translator will need to link in the boost_system library like
commit 891810c246d6de05a2df80c5b3e9f9aaa13231f7 does for stapdyn.

2 years agoMake the liveness warning 32-bit agnostic
William Cohen [Wed, 27 Oct 2021 17:49:12 +0000 (13:49 -0400)]
Make the liveness warning 32-bit agnostic

On 32-bit platforms Dwarf_Addr is long long unsigned int which doesn't
match the %lx (long unsigned int) print format to print the warning.
Cast the variable as (void *) so %p format can be used to print its
value on both 32-bit and 64-bit platforms.

2 years agoAssert that anything other than 32-bit or 64-bit processors will not be seen
William Cohen [Wed, 13 Oct 2021 19:56:21 +0000 (15:56 -0400)]
Assert that anything other than 32-bit or 64-bit processors will not be seen

One last diagnostic print to remove.  In this case the mapping between
dwarf register and Dyninst register name needs to take into account
whether this is 32-bit or 64-bit code.  However, there is a default in
the switch case to catch the anything other than 4 or 8 bytes.  If the
code see something other than one of those two values, something is
very wrong.  Figured best to just have an assert stop things, so the
problem is examined.

2 years agoRemove developmental diagnostic output in code.
William Cohen [Wed, 13 Oct 2021 19:45:10 +0000 (15:45 -0400)]
Remove developmental diagnostic output in code.

2 years agoAdd caching for the liveness data structure
William Cohen [Wed, 13 Oct 2021 19:27:30 +0000 (15:27 -0400)]
Add caching for the liveness data structure

Dyninst already caches information to make future queries at the same
location less expensive for an executable.  Thus, it is enough for the
code to cache the LivenessAnalyzer data on a per executable basis.
This information is stored in the cachedLivenessInfo member of
LivenessAnalyzer class.

2 years agoCache the dyninst of the binaries
William Cohen [Wed, 13 Oct 2021 14:43:33 +0000 (10:43 -0400)]
Cache the dyninst of the binaries

Reading and processing the binary with dyninst can take a lot of time
(and space).  Added caching to avoid repeated processing of the same
binary.

2 years agoAdd a test to check that the liveness analysis is reporting unused variables.
William Cohen [Tue, 12 Oct 2021 14:43:41 +0000 (10:43 -0400)]
Add a test to check that the liveness analysis is reporting unused variables.

2 years agoUse the elf_path in mod_info as that always points to the executable
William Cohen [Thu, 30 Sep 2021 19:18:59 +0000 (15:18 -0400)]
Use the elf_path in mod_info as that always points to the executable

For kernel probes q.dw.module_name just lists "kernel" rather than
the actual path to the binary.  The mod_info elf_path has more accurate
path to the actual executable, using that instead.

2 years agoRemove the unused attribute now that the location_context is used by liveness.
William Cohen [Wed, 29 Sep 2021 15:45:39 +0000 (11:45 -0400)]
Remove the unused attribute now that the location_context is used by liveness.

2 years agoOutput warning message when liveness detect write to dead variable.
William Cohen [Tue, 28 Sep 2021 19:52:05 +0000 (15:52 -0400)]
Output warning message when liveness detect write to dead variable.

2 years agoEliminate unnecessary CodeRegion discovery
William Cohen [Fri, 24 Sep 2021 16:04:21 +0000 (12:04 -0400)]
Eliminate unnecessary CodeRegion discovery

Documentation on findFuncs method seemed to require a CodeRegion passed in.
However, Dyninst developers said in this case can just pass in a NULL
(https://github.com/dyninst/dyninst/issues/1102).  Simplified
the code to eliminate the uneeded CodeRegion information.

2 years agoDo liveness analysis after location information set and use regno info
William Cohen [Wed, 22 Sep 2021 21:34:25 +0000 (17:34 -0400)]
Do liveness analysis after location information set and use regno info

Initially the call to the liveness analysis was being done before
the location information was setup.  Relocated the call after the
location information has been setup.

Corrected liveness analysis code to use the register number.  Also
added print out the function the liveness analysis is being run on.
Note that for probes on inlined functions this name will be different
than the probe point function name, it will be the actual function
that the code was inlined into.

2 years agoAdd register mappings for aarch64 and powerpc architectures
William Cohen [Wed, 22 Sep 2021 20:53:35 +0000 (16:53 -0400)]
Add register mappings for aarch64 and powerpc architectures

2 years agoAdd support to handle 32-bit x86 binaries
William Cohen [Tue, 21 Sep 2021 19:36:08 +0000 (15:36 -0400)]
Add support to handle 32-bit x86 binaries

Dyninst liveness analysis treats the analysis of 32-bit x86 and 64-bit
x86_64 code differently.  In dyninst the register names are different.
Thus, trying to get the liveness results for rdi (the 64-bit register
name) on 32-bit analysis will fail.  The analysis also needs to treat
32-bit and 64-bit a bit differently as there are difference in the
calling ABIs.

Right now the code dummy up using edi/rdi register which is the holds
the first argument in the register.  Doing this because the
location_context cts doesn't hold information outside the variable name.

2 years agoShow the liveness information at points being probed
William Cohen [Mon, 20 Sep 2021 13:46:04 +0000 (09:46 -0400)]
Show the liveness information at points being probed

This code is work-in-progress and to check whether the liveness
analysis is working.  Currently, the location context information for
the variable isn't being passed in and the setup of that is disabled.

2 years agoMove HAVE_DYNINST setting back to original/correct place.
William Cohen [Fri, 3 Sep 2021 21:14:12 +0000 (17:14 -0400)]
Move HAVE_DYNINST setting back to original/correct place.

2 years agoUpdate configure machinery and add files to hold Dyninst analysis
William Cohen [Mon, 30 Aug 2021 18:32:57 +0000 (14:32 -0400)]
Update configure machinery and add files to hold Dyninst analysis

The analysis uses tooling in Dyninst to do the analysis. However,
Dyninst is not available for some architectures. Needed to make the
configuration machinery only enable the Dyninst-based analysis for
supported machines such as x86-64 and aarch64.

The analysis.cxx is not currently connected to anything and doesn't do
any analysis.  For the moment it uses a couple Dyninst functions
verify that Dyninst libraries are being linked in.  This has been
tested to compile on both architectures that support Dyninst (x86_64)
and do not support Dyninst (32-bit Arm).

2 years agoAdd symbolic link so syscall_any tapset works for riscv bpf backend.
William Cohen [Mon, 25 Oct 2021 19:23:54 +0000 (15:23 -0400)]
Add symbolic link so syscall_any tapset works for riscv bpf backend.

2 years agoUpdate the syscall<->number mappings for syscall_any and add bpf support
William Cohen [Mon, 25 Oct 2021 15:59:49 +0000 (11:59 -0400)]
Update the syscall<->number mappings for syscall_any and add bpf support

2 years agoUpdate syscall_any number<->name maps to include syscallent-common.h entries. wcohen/bpf_syscall_any_v2
William Cohen [Mon, 25 Oct 2021 15:32:46 +0000 (11:32 -0400)]
Update syscall_any number<->name maps to include syscallent-common.h entries.

Some syscalls information had been moved to syscallent-common.h in
the strace code.  Need to use the #include in the syscallent*.h files
to get those entries.

2 years agoPull in the includes to get strace syscall info from syscallent-common.h
William Cohen [Mon, 25 Oct 2021 15:23:47 +0000 (11:23 -0400)]
Pull in the includes to get strace syscall info from syscallent-common.h

There are now a number of syscall in strace that are described in
src/linux/generic/syscall-common.h which is pulled into a number of
different architecture syscallent*.h includes.  Don't want to miss
those additional syscalls in the mappings.

2 years agostap_run.exp: accept 'WARNING: Child process exited due to signal'
Serguei Makarov [Thu, 14 Oct 2021 20:44:23 +0000 (16:44 -0400)]
stap_run.exp: accept 'WARNING: Child process exited due to signal'

This was causing numerous spurious FAIL outcomes on RHEL[89].
The extra "WARNING: Child process exited due to signal" is not an error,
it's merely stap communicating to the user that the child
process was interrupted, which is exactly what we do.

Not sure why it's printed on some systems and not others.
XXX There may be a deeper issue in that the tiny do-nothing binary
probed by the testcase (e.g. testsuite/systemtap.base/at_register.c)
was supposed to stop on its own and didn't.
Adding a delay to the first kill -INT $mypid makes the problem
more obvious.

2 years agoSupport softfloat by dyninst backend.
Stan Cox [Wed, 13 Oct 2021 16:43:35 +0000 (12:43 -0400)]
Support softfloat by dyninst backend.

The softfloat library has conflicting types for some types defined in
stdint.h, which -dyninst includes, so avoid by using cpp to redefine
them.  Add a float test to sdt_types.c.  Only test dyninst with
V3_uprobe.  Add x8664 float registers to register definition used by
dyninst.

2 years agoBZ2012907 systemtap.spec: use sysuser.d/* for user/group management
Frank Ch. Eigler [Tue, 12 Oct 2021 15:41:32 +0000 (11:41 -0400)]
BZ2012907 systemtap.spec: use sysuser.d/* for user/group management

Newer systemd systems (Fedora 32+) have an a declarative mechanism for
creation of system users/groups, instead of groupadd/useradd calls in
the %pre scripts.  Switch to this scheme for modern enough systems.

https://systemd.io/UIDS-GIDS/
https://fedoraproject.org/wiki/Changes/Adopting_sysusers.d_format

2 years agoAllow stopwatch example to run with bpf backend.
William Cohen [Mon, 11 Oct 2021 20:52:24 +0000 (16:52 -0400)]
Allow stopwatch example to run with bpf backend.

2 years agoAdd various tapset/bpf files (and links) to support syscall_any for BPF
William Cohen [Mon, 11 Oct 2021 20:46:02 +0000 (16:46 -0400)]
Add various tapset/bpf files (and links) to support syscall_any for BPF

2 years agoUpdate syscall_num.stp mappings between syscall number and name
William Cohen [Mon, 11 Oct 2021 20:26:06 +0000 (16:26 -0400)]
Update syscall_num.stp mappings between syscall number and name

Need to generate new versions of syscall_num.stp files that include
the preprocessor architecture guards so multiple syscall_num.stp
can be used by BPF code at the same time.

This is also using a more recent version of strace-code (ommit
940f7c9f71dd0514b933874c7b02230e0dd7dfd1) to include newer syscalls
in the mappings.

2 years agoAllow multiple architecture syscall_num.stp files to be used by bpf backend
William Cohen [Mon, 11 Oct 2021 20:17:41 +0000 (16:17 -0400)]
Allow multiple architecture syscall_num.stp files to be used by bpf backend

Systemtap's BPF still has the concept of target architecture and isn't
write once run anywhere for BPF code.  Thus, to make the syscall_any
tapset work the tapset needs to have all the different architecture
initialization code available and select the appropriate one based on
the architecture.  Thus, each syscalls_num.stp file has preprocessing
guards to make them empty unless the architecture matches.

2 years agoUpdate dump-syscalls.sh to work with newer strace-code
William Cohen [Mon, 11 Oct 2021 19:49:33 +0000 (15:49 -0400)]
Update dump-syscalls.sh to work with newer strace-code

There have been some changes in the strace-code:
-Header files now in strace-code/src/linux/*/syscallent.h
-mips headers use BASE_NR and file needs to be massaged to get numeric value
-corrected the name of riscv architecture name to riscv64

2 years agoAdd support for s390 floating point registers
Stan Cox [Fri, 8 Oct 2021 13:42:47 +0000 (09:42 -0400)]
Add support for s390 floating point registers

Add float registers.  Add move from float register to general
register.  Allow an sdt argument to be a float register.

2 years agostaprun: don't colorize the space following the warning/error tags
Sultan Alsawaf [Mon, 4 Oct 2021 21:15:58 +0000 (14:15 -0700)]
staprun: don't colorize the space following the warning/error tags

Brings the colorization back in line with the old behavior.

2 years agostaprun: make the previous commit obey the color_errors switch again
Sultan Alsawaf [Mon, 4 Oct 2021 20:53:59 +0000 (13:53 -0700)]
staprun: make the previous commit obey the color_errors switch again

The color_errors check inside print_color() was not preserved. Fix it.

2 years agostaprun: fix warning/error/dbug eprintf() races causing garbled output
Sultan Alsawaf [Mon, 4 Oct 2021 19:09:32 +0000 (12:09 -0700)]
staprun: fix warning/error/dbug eprintf() races causing garbled output

There are lots of races when printing warnings/errors/dbugs in staprun
because multiple eprintf() calls are used to print a single message and
stderr is not line-buffered. As a result, warnings/errors/dbugs race with
the relayfs reader threads printing to stdout and with other stap scripts
running concurrently in the same PTY. This causes the messages printed to
stderr and stdout to be garbled.

Fix all of this by using a single eprintf() for each warning/error/dbug
message, and by making stderr line-buffered so that we don't need to worry
about differing libc implementations potentially flushing a single message
in chunks rather than flushing the whole message in one go.

2 years agoruntime: make _stp_vlog() more robust to avoid truncating log messages
Sultan Alsawaf [Thu, 30 Sep 2021 02:42:26 +0000 (19:42 -0700)]
runtime: make _stp_vlog() more robust to avoid truncating log messages

Currently, _stp_vlog() very readily drops or truncates warnings, errors,
and debug messages. In the case of warnings and errors, this is quite
problematic because these messages are of high importance and, as such,
are even sent to stapio via the control channel rather than the relay
transport.

The reason why _stp_vlog() truncates and even drops these messages so
easily is twofold: the normal print buffer is used directly without any
attempt to flush it when there isn't enough space and it's used as
temporary storage for warnings and errors.

When warnings and errors are sent to the control channel, they are
copied into a new buffer, which is wasteful due to the copy operation
and the effort put into scrounging for space in the print buffer.
Instead of using a temporary buffer to construct warnings and errors,
it's more reliable and efficient to construct the message in one of the
control channel's buffers that would've been used anyway to send the
message.

In the case of debug messages, the print buffer can take appropriate
steps to ensure there's enough space via _stp_reserve_bytes(). Now, the
length of a debug message is calculated before it's generated, making it
possible to use _stp_reserve_bytes().

Altogether, this makes _stp_vlog() very resistant to losing both normal
debug messages and high-priority warning and error messages.

2 years agoPR27829: Support floating point values passed through sdt.h markers
Stan Cox [Thu, 30 Sep 2021 20:11:29 +0000 (16:11 -0400)]
PR27829: Support floating point values passed through sdt.h markers

Add the type to the individual arg entries in the .notes.stapsdt section;
currently SP@A, where S is optional '-' sign, P is precision of type and A is
address.  Revised format is SPT@A where T is optional 'f' for float variables.
Add x8664 float registers xmm8 - xmm15 and aarch64 float registers v8 - v31.
Parse the type field; result is currently ignored.  asm statements are
restricted to 30 arguments; sdt probes can have up to 12 arguments.  To fit
this into a single asm statement, precision and type are encoded into a single
field: 0xSSTT where SS is the precision and TT is the type as encoded by
__builtin_classify_type.  The sign S, precision P, and type T are decoded by
_SDT_SIGN, _SDT_SIZE, and _SDT_TYPE.  Test that the revised
.notes.stapsdt section interacts correctly with eu-elfutils and gdb.

2 years agotestsuite traceaio.c
Nir Soffer [Wed, 29 Sep 2021 19:31:13 +0000 (15:31 -0400)]
testsuite traceaio.c

Add simple test program calling io_submit() with several iocbs, testing
handling or PWRITE, PREAD, PWRITEV, and PREADV.

The test can be run manually by compiling the program, running it with
"stap -c", and inspecting the generated trace.

With more work, this can be used in "make installcheck", and verified
using expected output file.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agoFix traceaio with IO_CMD_{PREAD,PWRITE}
Nir Soffer [Wed, 29 Sep 2021 10:14:31 +0000 (06:14 -0400)]
Fix traceaio with IO_CMD_{PREAD,PWRITE}

IOCB_CMD_PREADV was used twice, skipping logging of iovecs for
IOCB_CMD_PWRITEV.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2 years agotraceaio example: tweak @cast and IOCB_CMD_*
Frank Ch. Eigler [Wed, 29 Sep 2021 08:48:22 +0000 (04:48 -0400)]
traceaio example: tweak @cast and IOCB_CMD_*

Make this test case operable without kernel debuginfo by using
@cast( ..., "kernel<header>") to extract iocb / iovec decls
from headers.  Rename IO_CMD_* values to IOCB_CMD_* to match
linux aio_abi.h

2 years agoFix traceaio with IO_CMD_{PREAD,PWRITE}
Nir Soffer [Wed, 29 Sep 2021 08:06:53 +0000 (04:06 -0400)]
Fix traceaio with IO_CMD_{PREAD,PWRITE}

When using IO_CMD_{PREAD,PWRITE} aio_nbytes is the size of a single
buffer aio_buf.

Previously the script logged unrelated memory contents from userspace:

[     0 sanlock(8214):] io_submit(140589225578496, 1, 0x7fdd5fefc718)
    iocb[   0]=0x7fdd58000b70, fd=16, opcode=0, offset=0, nbytes=1048576, buf=0x7fdd5c5f6000
        iovec[   0]=0x7fdd5c5f6000, base=0x3000412212010, len=16
        iovec[   1]=0x7fdd5c5f6010, base=0x0, len=1
        iovec[   2]=0x7fdd5c5f6020, base=0x1, len=16
        ...

Now we trace iovecs only when using IO_CMD_{PREADV,PWITEV}:

[     0 sanlock(8397):] io_submit(140589225566208, 1, 0x7fdd5e6f9718)
    iocb[   0]=0x7fdd48000b70, fd=19, opcode=0, offset=0, nbytes=1048576, buf=0x7fdd5c3f2000
[     0 sanlock(8397):] io_submit(140589225566208, 1, 0x7fdd5e6f9718)
    iocb[   0]=0x7fdd48000b70, fd=19, opcode=1, offset=512, nbytes=512, buf=0x7fdd4810a000

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
This page took 0.068959 seconds and 5 git commands to generate.