[DTrace-devel] [oracle/dtrace-utils] 936f7e: libproc: make Psystem_daemon() detect modern syste...
Kris Van Hees
noreply at github.com
Thu Aug 14 22:38:32 UTC 2025
Branch: refs/heads/devel
Home: https://github.com/oracle/dtrace-utils
Commit: 936f7e5a0ba4a742580953c986899a10dde64dd2
https://github.com/oracle/dtrace-utils/commit/936f7e5a0ba4a742580953c986899a10dde64dd2
Author: Nick Alcock <nick.alcock at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M libproc/Pcontrol.c
Log Message:
-----------
libproc: make Psystem_daemon() detect modern systemd properly
Psystem_daemon() is used when carrying out shortlived grabs to detect
whether a process is too risky to carry out invasive grabs of (you wouldn't
usually want to stop syslogd or, God forbid, try to ptrace PID 1, unless
explicitly requested via -p: the process just coming up in routine probe
firing is not enough).
This has two code paths: a reliable one for systemd systems (which checks to
see if the process is in the system slice, which contains precisely and only
system daemons), and an unreliable one for other systems (which does the old
Unix approach of consdering anything in the user uid range or with a TTY or
with open standard FDs to TTYs to be not system daemons, and everything else
to possibly be one).
We were checking to see if a system was systemd by looking for the systemd
cgroup hierarchy name in any of the victim process's cgroups. This was
reliable back in the days of cgroups v1, but alas in v2 where systemd runs
all the cgroups if it runs any and there are no longer multiple hierarchies,
systemd no longer names its cgroups this way and the test fails, causing us
to fall back to the unreliable pre-systemd approach.
Use a more reliable approach to detect systemd, the same approach used by
sd_booted() in libsystemd; check for the existence of the
/run/systemd/system directory. Fix slice detection to work in the absence
of a systemd hierarchy name (but keep it working when a hierarchy name
*is* present, for older systems), and everything else works unchanged.
We also arrange to fall back to the old code for any processes that are
entirely outside of systemd management: this covers kernel threads,
the occasional process that is part of systemd itself, and also processes
running using Delegate= to give over their subtree's cgroup management to
something else.
Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 8fee290763aaa12288dc7da762882d8fa7e4a1cc
https://github.com/oracle/dtrace-utils/commit/8fee290763aaa12288dc7da762882d8fa7e4a1cc
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.onlyenabled.r
M test/unittest/usdt/tst.onlyenabled.sh
Log Message:
-----------
test: Make the USDT "only enabled" test more stringent
What if a program has an is-enabled probe without the corresponding
parent probe? It should at least compile, and we test that.
Add more checks to the test:
- the is-enabled branch is not taken when run without dtrace
- the parent USDT probe is listed with "dtrace -l"
- the is-enabled branch is not taken even when run with dtrace
if the parent probe is not enabled
- the is-enabled branch is taken when run with dtrace
and the parent probe is enabled; however, the parent probe
does not fire since it is not in the test trigger
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: c5d9395763bdce843f36ad14d9ea4a25fe3569c3
https://github.com/oracle/dtrace-utils/commit/c5d9395763bdce843f36ad14d9ea4a25fe3569c3
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/usdt/tst.enable_pid.sh
A test/unittest/usdt/tst.enable_pid.x
Log Message:
-----------
test: Wait for output to flush out in enable_pid
Our luck with this test has been quite good, but it sometimes fails
to show its last lines of output. That is, we send a USR1 to the
trigger processes to set off the final output and we immediately
cat the output files. If there is any delay in handling the signal,
the last output will be missing.
Have the processes terminate themselves when their last output is
flushed; then wait for those processes. Also, skip testing altogether if
there is only a single processor to run the two, hard-spinning processes.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: a652eddee1c2069e3549f7bbebd3748c8bd045f5
https://github.com/oracle/dtrace-utils/commit/a652eddee1c2069e3549f7bbebd3748c8bd045f5
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M GNUmakefile
Log Message:
-----------
bpf: compile BPF library functions with -ffreestanding
Per Jose, we should be compiling our BPF code with -ffreestanding to
ensure that BPF-specific standard header files are used instead of
host-specific ones.
References:
https://gcc.gnu.org/PR121259
https://bugs.gentoo.org/959876
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Sam James <sam at gentoo.org>
Tested-by: Sam James <sam at gentoo.org>
Commit: b3f9fd31e173b0372c65a33dc166fe18c75d3091
https://github.com/oracle/dtrace-utils/commit/b3f9fd31e173b0372c65a33dc166fe18c75d3091
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/aggs/tst.ustack.r
A test/unittest/aggs/tst.ustack.r.p
Log Message:
-----------
test: Suppress some white space
The test suite turns pointers into "{ptr}" so that results
comparisons will not be sensitive to particular pointer offset
values.
If these offsets change in width -- say, from 0xf0 to 0x100 --
the amount of white space in the postprocessed output can change.
Add additional postprocessing to a test that sometimes fails due
to this problem.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: c42d8c095086adb2597f869d6a8143b68d01fe27
https://github.com/oracle/dtrace-utils/commit/c42d8c095086adb2597f869d6a8143b68d01fe27
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/pid/tst.manypids.sh
Log Message:
-----------
test: Extend timeout for many-pids test
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: 90c51681fd5e347543f02dfc7925f92f133c9080
https://github.com/oracle/dtrace-utils/commit/90c51681fd5e347543f02dfc7925f92f133c9080
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M INCOMPATIBILITIES
M cmd/dtrace.c
A test/unittest/dtrace-util/tst.ListProbes.r
A test/unittest/dtrace-util/tst.ListProbes.sh
Log Message:
-----------
Make sure all probes are listed in default case
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Alan Maguire <alan.maguire at oracle.com>
Commit: 633e1c217336bd6d2e18022e8371ac2e047e4b21
https://github.com/oracle/dtrace-utils/commit/633e1c217336bd6d2e18022e8371ac2e047e4b21
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M libdtrace/dt_prov_uprobe.c
Log Message:
-----------
Optimize USDT discovery a little
We want to reduce the performance cost of USDT discovery if possible.
Specifically, a number of statements -- with probe descriptions such as
"dtrace:::BEGIN" that could never specify USDT probes -- will not get
their clause flags set with DT_CLSFLAG_USDT_EXCLUDE. So these statements
get considered unnecessarily during periodic probe discovery.
Therefore:
*) Expand ignore_clause(dtp, n, uprp) to support the case uprp==NULL.
This case is independent of any knowledge of a specific underlying
probe.
*) During probe discovery, check ignore_clause(dtp, i, NULL). This
sets the DT_CLSFLAG_USDT_[INCLUDE|EXCLUDE] flag and allows faster
exclusion of statements that do not need to be reconsidered.
To take advantage of this optimization, users should specify providers.
E.g., instead of "BEGIN" (which could conceivably be a USDT probe),
specify "dtrace:::BEGIN".
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: 1cd56071dc6ee552cbd9fdf2465522084d5de557
https://github.com/oracle/dtrace-utils/commit/1cd56071dc6ee552cbd9fdf2465522084d5de557
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M libdtrace/dt_bpf.c
M libdtrace/dt_cg.c
M libdtrace/dt_impl.h
A test/unittest/options/err.no-w-or-destructive2.d
A test/unittest/options/err.no-w-or-destructive2.r
R test/unittest/usdt/err.Z_no-w.r
R test/unittest/usdt/err.Z_no-w.sh
Log Message:
-----------
Need -w for destructive actions, even if clause is not used
If a clause includes a destructive action but -w is not used, dtrace
should not start up, even if the clause is ignored (due to -Z).
Solaris treated this as a runtime error. We should do the same.
The test err.Z_no-w.sh was misguided and is replaced by a more
direct test.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 4f58b864a0e61b6ea70465f7e65d3ca64278f533
https://github.com/oracle/dtrace-utils/commit/4f58b864a0e61b6ea70465f7e65d3ca64278f533
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M include/dtrace/pid.h
M libdtrace/dt_pid.c
M libdtrace/dt_prov_uprobe.c
Log Message:
-----------
support stapsdt ELF-note-defined static probes
As well as using dtrace -G to generate USDT probes, programs and
libraries may have added static probes via stapsdt ELF notes.
Read ELF notes from binaries from /proc/ maps associated with processes
and parse them to retrieve uprobe address and argument-related info
to create the associated uprobe.
Probe arguments can be either constants, register values or dereferences
or dereferences from register values (plus offset), identical to the
updated USDT ELF note handling.
A new provider - stapsdt - implements this support, as stapsdt probes do
not dynamically register themselves with DTrace. This makes them less
powerful than DTrace-based USDT probes, but they do exist in programs and
libraries so should be supported.
As well as supporting ELF-note stapsdt defined probes in programs and
libraries, this patch supports dynamically-created probes that
are created via libstapsdt [1]. libstapsdt allows dynamic languages
like python to declare and fire probes by dynamically creating
a memfd-based shared library containing ELF notes for the probes.
With these changes we can also trace these probes. This is very
useful since libstapsdt has python, NodeJS, go and luaJIT bindings.
[1] https://github.com/linux-usdt/libstapsdt
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 5d4758679e16b52aea0361c4162cec6b6f714101
https://github.com/oracle/dtrace-utils/commit/5d4758679e16b52aea0361c4162cec6b6f714101
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/sdt_notes.h
A test/unittest/usdt/tst.stapsdt-notes.r
A test/unittest/usdt/tst.stapsdt-notes.sh
Log Message:
-----------
selftests/usdt: add test for stapsdt note-defined probe firing, args
Add test identical to the args tests to verify probe firing and
arg retrieval work for stapsdt notes-defined STAP_PROBEn() probes.
Need a copy of the sdt.h file which is public domain, so add it
in the test directory.
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 5771baf4b55eb703e7be05306a6bbd87aa2350f3
https://github.com/oracle/dtrace-utils/commit/5771baf4b55eb703e7be05306a6bbd87aa2350f3
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.stapsdt-notes-lib.r
A test/unittest/usdt/tst.stapsdt-notes-lib.sh
Log Message:
-----------
selftests/usdt: add test for stapsdt notes in shared library
To ensure stapsdt notes are found/fire for shared libraries, create
a shared library and trace the stapsdt probes in it. To ensure the
library is loaded when DTrace has started, call it early in the
program lifetime and sleep until DTrace starts; at that point
trace the probes with the pid and ensure they fire with expected args.
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 28d9dae5be730d23fa32690e6e5e665e1422be36
https://github.com/oracle/dtrace-utils/commit/28d9dae5be730d23fa32690e6e5e665e1422be36
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.stapsdt-notes-args.r
A test/unittest/usdt/tst.stapsdt-notes-args.sh
Log Message:
-----------
selftests/usdt: add test covering different forms of stapsdt note args
Add a test exercising various arg types supported by stapsdt notes;
register values, register + offset and constants. The test generates
a binary with probes represented as follows on x86_64:
Displaying notes found in: .note.stapsdt
Owner Data size Description
stapsdt 0x00000048 NT_STAPSDT (SystemTap probe descriptors)
Provider: test_prov
Name: args
Location: 0x0000000000400557, Base: 0x00000000004005f8, Semaphore: 0x0000000000000000
Arguments: -4 at -4(%rbp) 8@%rax 8@%rdx -4@$18
Verify we get expected data for the probe arguments.
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: b88e1e4b49c534e32d5ed08739dad90f16a143ca
https://github.com/oracle/dtrace-utils/commit/b88e1e4b49c534e32d5ed08739dad90f16a143ca
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.stapsdt-notes-pie.sh
Log Message:
-----------
selftests/usdt: add test for stapsdt note-defined probe firing in -fPIE binary
Add test identical to the binary test ensuring that -fPIE is specified
in CFLAGS; this verifies that compilers that use such flags by default
(as is the case for Debian) can instrument stapsdt notes.
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 22932a9875ecd01a4d299b869a80ab05ff0f8c7c
https://github.com/oracle/dtrace-utils/commit/22932a9875ecd01a4d299b869a80ab05ff0f8c7c
Author: Alan Maguire <alan.maguire at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.stapsdt-notes-isenabled.r
A test/unittest/usdt/tst.stapsdt-notes-isenabled.sh
Log Message:
-----------
selftests/usdt: add is-enabled stapsdt tests using semaphores
Is-eanbled probes are implemented using semaphores where the
semaphore address is specified in the ELF notes and passed
in at probe creation time to have the kernel reference-count
probes; this allows us to have argument assembly code that
only gets executed when the stapsdt probe is in use.
Test is-enabled probes and ensure that the kernel-controlled
semaphore is not incremented for disabled probes. Also test
that provider/probe names with double-underscores are converted
to dashes, i.e. one__probe because :one-probe.
Signed-off-by: Alan Maguire <alan.maguire at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 900d08cc01a0a02f2615098de3261f32d25b785e
https://github.com/oracle/dtrace-utils/commit/900d08cc01a0a02f2615098de3261f32d25b785e
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
A test/unittest/usdt/tst.stapsdt-notes-l.sh
A test/unittest/usdt/tst.stapsdt-notes-lv.sh
Log Message:
-----------
test: add -l and -lv tests for stapsdt probes
The stapsdt support in DTrace provides limited support for argument data
for probes. The number of arguments passed to a probe and their native
type (signed or unsigned int of size 1, 2, 4, or 8 bytes) is discoverable.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: 631747acd38a6ba63d2ace67b2cb976ca152cd09
https://github.com/oracle/dtrace-utils/commit/631747acd38a6ba63d2ace67b2cb976ca152cd09
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M libdtrace/dt_pid.c
M libdtrace/dt_prov_uprobe.c
Log Message:
-----------
Fix various memory leaks related to stapsdt and usdt probes
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Alan Maguire <alan.maguire at oracle.com>
Tested-by: Alan Maguire <alan.maguire at oracle.com>
Commit: 907a03a814bf803fb5e1f23469134c007776c04b
https://github.com/oracle/dtrace-utils/commit/907a03a814bf803fb5e1f23469134c007776c04b
Author: Nick Alcock <nick.alcock at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/utils/Build
Log Message:
-----------
test: install get_remote.sh
Otherwise this produces horrible output for every test run in
the entire testsuite when the testsuite is installed from an RPM.
Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
Reviewed-by: Alan Maguire <alan.maguire at oracle.com>
Commit: 6cfa1d0143b877527d1b4b72ff39950340123fd7
https://github.com/oracle/dtrace-utils/commit/6cfa1d0143b877527d1b4b72ff39950340123fd7
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/codegen/tst.tstring_ternary_nested.r
Log Message:
-----------
test: Fix tstring_ternary_nested .r file
In commit 5b20226bc ("cg: optimize ternary expressions for strings"),
new tests were added. Fix the apparent typo that is in one of them.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: a8b7c77942c3dcc7394b3b82801c830eb0bf2483
https://github.com/oracle/dtrace-utils/commit/a8b7c77942c3dcc7394b3b82801c830eb0bf2483
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/disasm/tst.vartab-bvar.sh
Log Message:
-----------
test: Remove errant debug statement
In commit e7eaa6216
("test: sdt:task::task_rename takes only 4 args on newer kernels"),
a debug statement was apparently added and left in, causing mismatch
with the .r results file. Remove the statement.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 5c639877bfb8da46855f8a23af3d07282424b173
https://github.com/oracle/dtrace-utils/commit/5c639877bfb8da46855f8a23af3d07282424b173
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-06 (Wed, 06 Aug 2025)
Changed paths:
M test/unittest/actions/return/tst.override-getpid-entry.r.p
M test/unittest/actions/return/tst.override-getpid-entry.sh
M test/unittest/actions/return/tst.override-getpid-return.r.p
M test/unittest/actions/return/tst.override-getpid-return.sh
Log Message:
-----------
test: Fix post processing of return-action override-pid tests
In commit ee8c066e8 ("rawfbt: selectively allow return() in clauses"),
tests were introduced to check that return values are overwritten. A
pid check value is output and used to facilitate comparisons to a .r
results file.
The post processing logic was flawed in two respects:
1 The check value was being pulled from the "01" entry. Therefore,
the "00" entry, typically appearing first, would not be converted.
2 Values were not sorted. Sometimes this means the disorder just
described would be avoided and the test would pass. Mostly,
it means that behavior can be erratic.
Sort results and use the "00" pid value for converting test results.
Add $dt_flags to the $dtrace line while we're at it.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: fb5a118124af9f752326dc52d823a28c1bbd6554
https://github.com/oracle/dtrace-utils/commit/fb5a118124af9f752326dc52d823a28c1bbd6554
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-11 (Mon, 11 Aug 2025)
Changed paths:
M libdtrace/dt_cg.c
A test/unittest/variables/inline/tst.procfs-cwd.d
A test/unittest/variables/inline/tst.procfs-root.d
A test/unittest/variables/inline/tst.sched-chip.d
A test/unittest/variables/inline/tst.sched-cpu.d
A test/unittest/variables/inline/tst.sched-lgrp.d
A test/unittest/variables/inline/tst.sched-pset.d
Log Message:
-----------
vars: ensure 'cwd' and 'root' work and test other inline vars
Inline variable declarations that provide a tstring value were not
ensuring that tstring data got propagated correctly.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: fa94aae1da96f38066891f66870645d42cec4198
https://github.com/oracle/dtrace-utils/commit/fa94aae1da96f38066891f66870645d42cec4198
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-11 (Mon, 11 Aug 2025)
Changed paths:
M libdtrace/dt_prov_uprobe.c
A test/unittest/pid/tst.multi-return.d
A test/unittest/pid/tst.multi-return.r
Log Message:
-----------
Add function name to underlying return probes
In commit 35a4f05c2
("Add support for pid function "-" with absolute offset"),
function names were removed from underlying probe descriptions.
That was so that pid absolute offset probes (pid$pid:a.out:-:$absoff),
with function "-", could sit on the same underlying probes as
pid$pid:$mod:$fun:entry, pid$pid:$mod:$fun:$off, and USDT probes.
While that made sense for those probes, it did not make sense for pid
return probes: their underlying probes, all with probe name "return",
are no longer distinguishable. Further, there was no need for any such
change, since no other probes will have the same underlying return probe.
Name underlying return probes with function name.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Commit: 9a4cd7999fab6670c0a6b34df84b49c2feeae3f3
https://github.com/oracle/dtrace-utils/commit/9a4cd7999fab6670c0a6b34df84b49c2feeae3f3
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-11 (Mon, 11 Aug 2025)
Changed paths:
M libdtrace/dt_aggregate.c
M libdtrace/dt_aggregate.h
M libdtrace/dt_consume.c
M libdtrace/dtrace.h
M test/unittest/options/tst.aggrate-slow.d
Log Message:
-----------
Snapshot aggregations just in time
Currently, dtrace periodically calls dtrace_work(), which in turn calls
dtrace_consume(), which among other things calls dtrace_aggregate_snap().
But aggregations are kept in entirety in the kernel's BPF maps. There
is no need to snapshot the aggregations into user space unless we're
actually going to do something with aggregations.
Snapshot aggregations just in time -- that is, if there is a clear(),
trunc(), or printa() or if aggregations are to be printed at the end
of a dtrace session.
Skip the aggrate-slow test. Just-in-time snapshots mean the semantics
of aggrate have changed. A fast aggrate means nothing. A slow aggrate
means we are supposed to use stale aggregation data, which would be
baffling. A future patch is advised to deprecate aggrate entirely.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 4e8c23df7a3bfbea431a8e63399c67cfee659dc4
https://github.com/oracle/dtrace-utils/commit/4e8c23df7a3bfbea431a8e63399c67cfee659dc4
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-11 (Mon, 11 Aug 2025)
Changed paths:
M bpf/get_dvar.c
A test/unittest/assocs/tst.collision.d
Log Message:
-----------
dvar: ensure dynamic variables cannot overwrite eachother
As Eugene discovered, it was possible for dynamic variables (elements
of associative arrays and TLS variables) to overwrite eachother. The
problem turns out to be due to the implementation of the BPF helper
bpf_map_update_elem(). In order for the update to be seen as an atomic
operation, it does not update the value of the map element in-place but
instead allocates a new element and places it in front of the old one
before it removes the old one. The result is that the address of the
map element changes as a result of the bpf_map_update_elem() call.
Fortunately, we can just assign the address of the map element in the
value that we obtained using bpf_map_lookup_elem() because that gives
us a pointer to the map value, and we can assign directly into it.
In other words, we do not need the 2nd bpf_map_update_elem() anyway,
and since that was the culprit, removing it resolves the issue.
Test included.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 564efa04c98ae749897cafb5421e1b6fd9c7c109
https://github.com/oracle/dtrace-utils/commit/564efa04c98ae749897cafb5421e1b6fd9c7c109
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-12 (Tue, 12 Aug 2025)
Changed paths:
A test/unittest/sdt/tst.args-3.d
A test/unittest/sdt/tst.args-3.r
A test/unittest/sdt/tst.args-3.x
A test/unittest/sdt/tst.args-4.d
A test/unittest/sdt/tst.args-4.r
A test/unittest/sdt/tst.args-4.x
R test/unittest/sdt/tst.args.d
R test/unittest/sdt/tst.args.r
Log Message:
-----------
test: adjust sdt.tst.args.d for task_rename tracepoint differences
As of kernel 6.14, the task_rename tracepoint provides only 3 arguments
rather than 4 (the pid got dropped).
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 84cc72b83cf668cac50e27ea2d2819cebab00991
https://github.com/oracle/dtrace-utils/commit/84cc72b83cf668cac50e27ea2d2819cebab00991
Author: Eugene Loh <eugene.loh at oracle.com>
Date: 2025-08-12 (Tue, 12 Aug 2025)
Changed paths:
M libdtrace/dt_cg.c
A test/unittest/error/tst.trace_string.d
Log Message:
-----------
Pad strings in the output buffer with NUL bytes after terminating byte
The consumer checks if there are non-NUL bytes after the terminating
NUL byte to decide whether to print the contents of the output buffer
as a string or as raw bytes. So, for strings, make sure that the
string is padded with NUL bytes.
A robust test that shows the problem can be hard to devise. Some tests
encounter the problem. This patch adds another test that might show
the problem.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Nick Alcock <nick.alcock at oracle.com>
Commit: 9de4acfd1c49089887a5b6fcbccd4b16204c9e60
https://github.com/oracle/dtrace-utils/commit/9de4acfd1c49089887a5b6fcbccd4b16204c9e60
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M test/unittest/actions/trace/tst.array-char-multi-nul.d
M test/unittest/actions/trace/tst.array-char-str-multi-nul.d
M test/unittest/actions/trace/tst.array-char-str-no-nul.d
M test/unittest/actions/trace/tst.array-char-str.d
M test/unittest/actions/trace/tst.array-char-unprintable.d
Log Message:
-----------
test: fix typos and clarify assertions
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 421d58afe1393e4edf38f81e50667722a2a7184a
https://github.com/oracle/dtrace-utils/commit/421d58afe1393e4edf38f81e50667722a2a7184a
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M test/unittest/actions/trace/tst.array.d
M test/unittest/actions/trace/tst.array.r
Log Message:
-----------
test: improve test condition
Test with content that could be interpreted as a string if the consumer
handles things wrong.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: c7d9f2fea3e8d7af63e7915dabaaf1b537963c38
https://github.com/oracle/dtrace-utils/commit/c7d9f2fea3e8d7af63e7915dabaaf1b537963c38
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M test/unittest/actions/trace/tst.struct-1-byte.r
Log Message:
-----------
test: fix expected output for tst.struct-1-byte.d
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 8e6924a643f00609c7cfc3008031b590f85cee46
https://github.com/oracle/dtrace-utils/commit/8e6924a643f00609c7cfc3008031b590f85cee46
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M libdtrace/dt_consume.c
A test/unittest/actions/trace/tst.str-empty.d
A test/unittest/actions/trace/tst.str-empty.r
Log Message:
-----------
trace: handle the empty string in a sensible way
The trace("") action would dump a series of 0x00 bytes (strsize of
them) rather than printing an empty string. While that is the legacy
behaviour, it does not really make any sense to do so. The trace
action is described as printing data as a string if possible, and a
block of 0-bytes can certainly be printed as an empty string.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 2cc19c55c52bbe3b1161bb43d5d08e8eed11120a
https://github.com/oracle/dtrace-utils/commit/2cc19c55c52bbe3b1161bb43d5d08e8eed11120a
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M libdtrace/dt_bpf.c
M libdtrace/dt_cg.c
M test/unittest/codegen/tst.str_const_length.d
M test/unittest/codegen/tst.str_data_size.d
M test/unittest/codegen/tst.str_store_var.d
M test/unittest/funcs/inet_ntoa6/tst.inet_ntoa6.strsize_10.r
M test/unittest/funcs/strjoin/tst.strjoin-bordercases.d
M test/unittest/funcs/strjoin/tst.strjoin-capped-size-2.d
M test/unittest/funcs/strjoin/tst.strjoin-capped-size-3.d
M test/unittest/funcs/strjoin/tst.strjoin-capped-size.d
M test/unittest/funcs/strjoin/tst.strjoin_nonDPTR.d
A test/unittest/funcs/strlen/tst.capped-size.d
R test/unittest/funcs/strlen/tst.capped-sizw.d
M test/unittest/funcs/strtok/tst.strtok_long.d
M test/unittest/funcs/strtok/tst.strtok_long.r
M test/unittest/funcs/substr/tst.substr-stored-len.d
M test/unittest/funcs/substr/tst.substr-strsize.d
M test/unittest/funcs/substr/tst.substr_nonDPTR.d
M test/unittest/funcs/tst.basename_nonDPTR.d
M test/unittest/funcs/tst.inet_ntoa_nonDPTR.d
M test/unittest/funcs/tst.lltostr-short.d
M test/unittest/variables/tvar/tst.str-size.d
Log Message:
-----------
string: ensure string size is handled correctly
A string is defined as a character array of size strsize. Strings
that are less that strsize in length are terminated by a NUL byte.
This implies that the NUL byte is part of the array and therefore,
strsize is indeed the size of the array and not the maximum number
of characters in the string.
Tests are adjusted to reflect this behaviour.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: d96bf293af145ba9f9abed1f4ee118f8a2b1c441
https://github.com/oracle/dtrace-utils/commit/d96bf293af145ba9f9abed1f4ee118f8a2b1c441
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M bpf/get_dvar.c
Log Message:
-----------
bpf: force generating code that all verifiers accept
The compiler could optimize val = *valp in a way where the verifier on
older kernels would complain. We use inline assembler to force the
not optimize this expression and instead to always read the value as a
scalar.
The kernel gained support for using map_value addresses read from the
stack with commit cd17d38f8b28f ("bpf: Permits pointers on stack for
helper calls") which first appeared in kernel 5.11.
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Commit: 51b2ebdd59eddaeab2eb4ce8d164feb9f8b18954
https://github.com/oracle/dtrace-utils/commit/51b2ebdd59eddaeab2eb4ce8d164feb9f8b18954
Author: Kris Van Hees <kris.van.hees at oracle.com>
Date: 2025-08-14 (Thu, 14 Aug 2025)
Changed paths:
M libdtrace/dt_prov_uprobe.c
Log Message:
-----------
uprobe: do not call populate_args() for pid probes
Only USDT (regular and is-enabled) probes need populate_args().
Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Compare: https://github.com/oracle/dtrace-utils/compare/6642cf0c84de...51b2ebdd59ed
To unsubscribe from these emails, change your notification settings at https://github.com/oracle/dtrace-utils/settings/notifications
More information about the DTrace-devel
mailing list