test: fbt return0: work on quiet systems
PATCH 1/5 test: fbt return0: work on quiet systems
These two tests probe on sys_poll and just hope something calls it. On sufficiently quiet systems, nothing does.
Define a trivial trigger to do so.
--- test/triggers/Build | 2 +- test/triggers/fbt-tst-poll.c | 23 ++++++++++++++++++++ test/unittest/fbtprovider/tst.return0.d | 6 ++++- test/unittest/providers/rawfbt/tst.return0.d | 6 ++++- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 test/triggers/fbt-tst-poll.c
test/triggers/Build +1 -1
@@ -4,7 +4,7 @@ # http://oss.oracle.com/licenses/upl. EXTERNAL_64BIT_TRIGGERS = testprobe readwholedir mmap bogus-ioctl open delaydie futex \ - periodic_output \ + periodic_output fbt-tst-poll \ pid-tst-args1 pid-tst-float pid-tst-fork pid-tst-gcc \ pid-tst-ret1 pid-tst-ret2 pid-tst-vfork pid-tst-weak1 pid-tst-weak2 \ proc-tst-sigwait proc-tst-omp proc-tst-pthread-exec profile-tst-ufuncsort \
test/triggers/fbt-tst-poll.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Oracle Linux DTrace. +* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. +* Licensed under the Universal Permissive License v 1.0 as shown at +* http://oss.oracle.com/licenses/upl. +*/ + +/* +* Simply loop, polling stdin for something that cannot happen until killed. +*/ + +#include <poll.h> + +int +main (int argc,char **argv) +{ +struct pollfd fd = {0 }; + + fd.fd =0 ; + fd.events =POLLPRI ; +for (;;) +poll (&fd,1 ,100 ); +}
test/unittest/fbtprovider/tst.return0.d +5 -1
@@ -11,11 +11,15 @@ * SECTION: FBT Provider/Probe arguments */ +/* @@trigger: fbt-tst-poll */ +/* @@trigger-timing: before */ +/* @@runtest-opts: $_pid */ + #pragma D option quiet #pragma D option statusrate=10ms fbt::do_sys_poll:return -/arg1 == 0/ +/pid == $1 && arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); exit(0);
test/unittest/providers/rawfbt/tst.return0.d +5 -1
@@ -9,11 +9,15 @@ * ASSERTION: simple rawfbt provider arg0 and probefunc print test. */ +/* @@trigger: fbt-tst-poll */ +/* @@trigger-timing: before */ +/* @@runtest-opts: $_pid */ + #pragma D option quiet #pragma D option statusrate=10ms rawfbt::do_sys_poll:return -/arg1 == 0/ +/pid == $1 && arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); exit(0);
base-commit: 877fcdeb25b370be182d51f27fb4bd8e4f739fb1
Signature · 1 line
2.51.0.284.g117bcb8de7
PATCH 2/5 test: nfs: don't require a locking daemon
On modern (NFSv4) systems, there is no guarantee that statd is running, and indeed it has probably been explicitly turned off (unless writable NFSv3 exports exist). This causes mount-time warnings that trigger test failures unless we disable locking.
No DTrace NFS tests need locking, so disable it.
--- test/triggers/io-mount-nfs.sh | 2 +- test/unittest/io/tst.nfs2.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
test/triggers/io-mount-nfs.sh +1 -1
@@ -18,4 +18,4 @@ fi mountdir=$1 serverpath=$2 -mount -t nfs -o nfsvers=3 127.0.0.1:$serverpath $mountdir +mount -t nfs -o nfsvers=3,nolock 127.0.0.1:$serverpath $mountdir
test/unittest/io/tst.nfs2.sh +2 -2
@@ -31,13 +31,13 @@ systemctl enable --now nfs-server > /dev/null 2>&1 mkdir $exdir exportfs -i -v -o "rw,sync,no_root_squash,insecure,fsid=8434437288" 127.0.0.1:$exdir > /dev/null mkdir $iodir - mount -t nfs -o nfsvers=3 127.0.0.1:$exdir $iodir + mount -t nfs -o nolock,nfsvers=3 127.0.0.1:$exdir $iodir $rundt "dd if=/dev/urandom of=$tempfile count=$filesize bs=1 status=none" -o log.write myinode=`stat $tempfile | gawk '/ Inode: / {print $4}'` umount $iodir # flush caches and remount to force IO echo 3 > /proc/sys/vm/drop_caches - mount -t nfs -o nfsvers=3 127.0.0.1:$exdir $iodir + mount -t nfs -o nolock,nfsvers=3 127.0.0.1:$exdir $iodir $rundt "sum $tempfile" -o log.read rm -f $tempfile umount $iodir
Signature · 1 line
2.51.0.284.g117bcb8de7
Re: [PATCH 2/5] test: nfs: don't require a locking daemon
Quoted 8 lines · Nick Alcock
On modern (NFSv4) systems, there is no guarantee that statd is running, and indeed it has probably been explicitly turned off (unless writable NFSv3 exports exist). This causes mount-time warnings that trigger test failures unless we disable locking.
No DTrace NFS tests need locking, so disable it.
Signed-off-by Nick Alcock <[email protected]>
Quoted 38 lines
--- test/triggers/io-mount-nfs.sh | 2 +- test/unittest/io/tst.nfs2.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)test/triggers/io-mount-nfs.sh +1
-1@@ -18,4 +18,4 @@ fi mountdir=$1 serverpath=$2 -mount -t nfs -o nfsvers=3 127.0.0.1:$serverpath $mountdir +mount -t nfs -o nfsvers=3,nolock 127.0.0.1:$serverpath $mountdirtest/unittest/io/tst.nfs2.sh +2
-2@@ -31,13 +31,13 @@ systemctl enable --now nfs-server > /dev/null 2>&1 mkdir $exdir exportfs -i -v -o "rw,sync,no_root_squash,insecure,fsid=8434437288" 127.0.0.1:$exdir > /dev/null mkdir $iodir - mount -t nfs -o nfsvers=3 127.0.0.1:$exdir $iodir + mount -t nfs -o nolock,nfsvers=3 127.0.0.1:$exdir $iodir $rundt "dd if=/dev/urandom of=$tempfile count=$filesize bs=1 status=none" -o log.write myinode=`stat $tempfile | gawk '/ Inode: / {print $4}'` umount $iodir # flush caches and remount to force IO echo 3 > /proc/sys/vm/drop_caches - mount -t nfs -o nfsvers=3 127.0.0.1:$exdir $iodir + mount -t nfs -o nolock,nfsvers=3 127.0.0.1:$exdir $iodir $rundt "sum $tempfile" -o log.read rm -f $tempfile umount $iodirSignature · 1 line
2.51.0.284.g117bcb8de7
PATCH 3/5 test: preprocessor: work on GCC 16
In reply to Nick AlcockGCC commit c397a8c12296b75a91ae51e4889debf023e6c338 ("libcpp, genmatch:
Use gcc_diag instead of printf for libcpp diagnostics") made libcpp quote identifiers and tokens in diagnostics like the rest of GCC does. We have several tests that rely on the old error formatting: sed away quotes and smartquotes into quotes or nothing (as appropriate to match older GCCs), until such time as GCC 15 is obsolete (a long long time away).
--- test/unittest/preprocessor/err.defincomp.r.p | 1 + test/unittest/preprocessor/err.ifdefincomp.r.p | 4 ++++ test/unittest/preprocessor/err.incompelse.r.p | 4 ++++ test/unittest/preprocessor/err.mulelse.r.p | 1 + 4 files changed, 10 insertions(+) create mode 120000 test/unittest/preprocessor/err.defincomp.r.p create mode 100755 test/unittest/preprocessor/err.ifdefincomp.r.p create mode 100755 test/unittest/preprocessor/err.incompelse.r.p create mode 120000 test/unittest/preprocessor/err.mulelse.r.p
test/unittest/preprocessor/err.defincomp.r.p new file +1 -0
@@ -0,0 +1 @@ +err.incompelse.r.p
test/unittest/preprocessor/err.ifdefincomp.r.p new file +4 -0
@@ -0,0 +1,4 @@ +#!/usr/bin/sed -f +# GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum +# supported, we have to sed it back again. +s,[‘’],",g
test/unittest/preprocessor/err.incompelse.r.p new file +4 -0
@@ -0,0 +1,4 @@ +#!/usr/bin/sed -f +# GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum +# supported, we have to sed it back again. +s,[‘’],,g
test/unittest/preprocessor/err.mulelse.r.p new file +1 -0
@@ -0,0 +1 @@ +err.incompelse.r.p
Signature · 1 line
2.51.0.284.g117bcb8de7
Re: [PATCH 3/5] test: preprocessor: work on GCC 16
Quoted 9 lines · Nick Alcock
GCC commit
c397a8c12296b75a91ae51e4889debf023e6c338("libcpp, genmatch:
Usegcc_diaginstead of printf for libcpp diagnostics") made libcpp quote identifiers and tokens in diagnostics like the rest of GCC does. We have several tests that rely on the old error formatting: sed away quotes and smartquotes into quotes or nothing (as appropriate to match older GCCs), until such time as GCC 15 is obsolete (a long long time away).Signed-off-by Nick Alcock <[email protected]>
Quoted 50 lines
--- test/unittest/preprocessor/err.defincomp.r.p | 1 + test/unittest/preprocessor/err.ifdefincomp.r.p | 4 ++++ test/unittest/preprocessor/err.incompelse.r.p | 4 ++++ test/unittest/preprocessor/err.mulelse.r.p | 1 + 4 files changed, 10 insertions(+) create mode 120000 test/unittest/preprocessor/err.defincomp.r.p create mode 100755 test/unittest/preprocessor/err.ifdefincomp.r.p create mode 100755 test/unittest/preprocessor/err.incompelse.r.p create mode 120000 test/unittest/preprocessor/err.mulelse.r.ptest/unittest/preprocessor/err.defincomp.r.p new file +1
-0@@ -0,0 +1 @@ +err.incompelse.r.ptest/unittest/preprocessor/err.ifdefincomp.r.p new file +4
-0@@ -0,0 +1,4 @@ +#!/usr/bin/sed -f +# GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum +# supported, we have to sed it back again. +s,[??????],",gtest/unittest/preprocessor/err.incompelse.r.p new file +4
-0@@ -0,0 +1,4 @@ +#!/usr/bin/sed -f +# GCC 16 improved diagnostics formatting. Until GCC 16 is the minimum +# supported, we have to sed it back again. +s,[??????],,gtest/unittest/preprocessor/err.mulelse.r.p new file +1
-0@@ -0,0 +1 @@ +err.incompelse.r.pSignature · 1 line
2.51.0.284.g117bcb8de7
PATCH 4/5 test: tid_pid: don't assume the type of pthread_t
In reply to Nick AlcockGCC 16 warns about this mismatch.
--- test/unittest/builtinvar/tst.tid_pid.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
test/unittest/builtinvar/tst.tid_pid.sh +1 -1
@@ -51,7 +51,7 @@ int main(int c, char **v) { pthread_create(&mythr, NULL, &foo, NULL); /* Also report the pthread_t. */ - printf("created pthread_t %lld\n\n", mythr); + printf("created pthread_t %llu\n\n", (long long unsigned) mythr); fflush(stdout); /* Wait endlessly. DTrace will kill me when it is done. */
Signature · 1 line
2.51.0.284.g117bcb8de7
Re: [PATCH 4/5] test: tid_pid: don't assume the type of pthread_t
Quoted 3 lines · Nick Alcock
GCC 16 warns about this mismatch.
Signed-off-by Nick Alcock <[email protected]>
Quoted 20 lines
--- test/unittest/builtinvar/tst.tid_pid.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)test/unittest/builtinvar/tst.tid_pid.sh +1
-1@@ -51,7 +51,7 @@ int main(int c, char **v) { pthread_create(&mythr, NULL, &foo, NULL); /* Also report the pthread_t. */ - printf("created pthread_t %lld\n\n", mythr); + printf("created pthread_t %llu\n\n", (long long unsigned) mythr); fflush(stdout); /* Wait endlessly. DTrace will kill me when it is done. */Signature · 1 line
2.51.0.284.g117bcb8de7
PATCH 5/5 test: dupstruct: fix extra duplicate identifier case
In reply to Nick AlcockWe were failing to handle one case where duplicate members or variables are now reported as duplicate members, enumerators, or variables. (It was concealed inside an .r.p.)
--- test/unittest/types/err.D_UNKNOWN.dupstruct.r | 2 +- test/utils/libctf.r.p | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
test/unittest/types/err.D_UNKNOWN.dupstruct.r +1 -1
@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member or variable name +dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member, enumerator, or variable name
test/utils/libctf.r.p +2 -1
@@ -1,7 +1,8 @@ #!/usr/bin/gawk -f # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. -/Duplicate member or variable name\.$/ { sub(/\.$/, ""); } +/Duplicate member or variable name/ { sub(/Duplicate member/, "&, enumerator,"); } +/Duplicate member, enumerator, or variable name\.$/ { sub(/\.$/, ""); } /Member name not found\.$/ { sub(/\.$/, ""); } /enum union pirate:/ { sub(/enum union pirate/, "enum struct pirate"); } { print; }
Signature · 1 line
2.51.0.284.g117bcb8de7
Re: [PATCH 5/5] test: dupstruct: fix extra duplicate identifier case
Quoted 5 lines · Nick Alcock
We were failing to handle one case where duplicate members or variables are now reported as duplicate members, enumerators, or variables. (It was concealed inside an .r.p.)
Signed-off-by Nick Alcock <[email protected]>
Quoted 30 lines
--- test/unittest/types/err.D_UNKNOWN.dupstruct.r | 2 +- test/utils/libctf.r.p | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)test/unittest/types/err.D_UNKNOWN.dupstruct.r +1
-1@@ -1,2 +1,2 @@ -- @@stderr -- -dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member or variable name +dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member, enumerator, or variable nametest/utils/libctf.r.p +2
-1@@ -1,7 +1,8 @@ #!/usr/bin/gawk -f # Licensed under the Universal Permissive License v 1.0 as shown at # http://oss.oracle.com/licenses/upl. -/Duplicate member or variable name\.$/ { sub(/\.$/, ""); } +/Duplicate member or variable name/ { sub(/Duplicate member/, "&, enumerator,"); } +/Duplicate member, enumerator, or variable name\.$/ { sub(/\.$/, ""); } /Member name not found\.$/ { sub(/\.$/, ""); } /enum union pirate:/ { sub(/enum union pirate/, "enum struct pirate"); } { print; }Signature · 1 line
2.51.0.284.g117bcb8de7
Quoted 4 lines · Nick Alcock
These two tests probe on
sys_polland just hope something calls it. On sufficiently quiet systems, nothing does.Define a trivial trigger to do so.
Why not change the probe to be on hrtimer_nanosleep and use periodic_output as trigger, rather than adding another trigger executable?
Quoted 98 lines
Signed-off-by Nick Alcock <[email protected]>--- test/triggers/Build | 2 +- test/triggers/fbt-tst-poll.c | 23 ++++++++++++++++++++ test/unittest/fbtprovider/tst.return0.d | 6 ++++- test/unittest/providers/rawfbt/tst.return0.d | 6 ++++- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 test/triggers/fbt-tst-poll.ctest/triggers/Build +1
-1@@ -4,7 +4,7 @@ # http://oss.oracle.com/licenses/upl. EXTERNAL_64BIT_TRIGGERS = testprobe readwholedir mmap bogus-ioctl open delaydie futex \ - periodic_output \ + periodic_output fbt-tst-poll \ pid-tst-args1 pid-tst-float pid-tst-fork pid-tst-gcc \ pid-tst-ret1 pid-tst-ret2 pid-tst-vfork pid-tst-weak1 pid-tst-weak2 \ proc-tst-sigwait proc-tst-omp proc-tst-pthread-exec profile-tst-ufuncsort \test/triggers/fbt-tst-poll.c new file +23
-0@@ -0,0 +1,23 @@ +/* +* Oracle Linux DTrace. +* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved. +* Licensed under the Universal Permissive License v 1.0 as shown at +* http://oss.oracle.com/licenses/upl. +*/ + +/* +* Simply loop, polling stdin for something that cannot happen until killed. +*/ + +#include <poll.h> + +int +main (int argc,char **argv) +{ +struct pollfd fd = {0 }; + + fd.fd =0 ; + fd.events =POLLPRI ; +for (;;) +poll (&fd,1 ,100 ); +}test/unittest/fbtprovider/tst.return0.d +5
-1@@ -11,11 +11,15 @@ * SECTION: FBT Provider/Probe arguments */ +/* @@trigger: fbt-tst-poll */ +/* @@trigger-timing: before */ +/* @@runtest-opts: $_pid */ + #pragma D option quiet #pragma D option statusrate=10ms fbt::do_sys_poll:return -/arg1 == 0/ +/pid == $1 && arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); exit(0);test/unittest/providers/rawfbt/tst.return0.d +5
-1@@ -9,11 +9,15 @@ * ASSERTION: simple rawfbt provider arg0 and probefunc print test. */ +/* @@trigger: fbt-tst-poll */ +/* @@trigger-timing: before */ +/* @@runtest-opts: $_pid */ + #pragma D option quiet #pragma D option statusrate=10ms rawfbt::do_sys_poll:return -/arg1 == 0/ +/pid == $1 && arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); exit(0);base-commit:
877fcdeb25b370be182d51f27fb4bd8e4f739fb1Signature · 1 line
2.51.0.284.g117bcb8de7
On 6 Oct 2025, Kris Van Hees spake thusly:
Quoted 8 lines · Nick Alcock
Quoted 4 lines
These two tests probe on
sys_polland just hope something calls it. On sufficiently quiet systems, nothing does.Define a trivial trigger to do so.
Why not change the probe to be on
hrtimer_nanosleepand useperiodic_outputas trigger, rather than adding another trigger executable?
Happy to. I wasn't sure if we depended on it being poll :)
Patch coming shortly.
Signature · 1 line
NULL && (void)
PATCH v2 1/5 test: fbt return0: work on quiet systems
In reply to Kris Van HeesThese two tests probe on sys_poll and just hope something calls it. On sufficiently quiet systems, nothing does.
Use hrtimer_nanosleep instead.
--- test/unittest/fbtprovider/tst.return0.d | 4 +++- test/unittest/fbtprovider/tst.return0.r | 2 +- test/unittest/providers/rawfbt/tst.return0.d | 4 +++- test/unittest/providers/rawfbt/tst.return0.r | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)
test/unittest/fbtprovider/tst.return0.d +3 -1
@@ -11,10 +11,12 @@ * SECTION: FBT Provider/Probe arguments */ +/* @@trigger: periodic_output */ + #pragma D option quiet #pragma D option statusrate=10ms -fbt::do_sys_poll:return +fbt:vmlinux:hrtimer_nanosleep:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0);
test/unittest/fbtprovider/tst.return0.r +1 -1
@@ -1 +1 @@ -do_sys_poll ffffffffffffffff returned 0 +hrtimer_nanosleep ffffffffffffffff returned 0
test/unittest/providers/rawfbt/tst.return0.d +3 -1
@@ -9,10 +9,12 @@ * ASSERTION: simple rawfbt provider arg0 and probefunc print test. */ +/* @@trigger: periodic_output */ + #pragma D option quiet #pragma D option statusrate=10ms -rawfbt::do_sys_poll:return +fbt:vmlinux:hrtimer_nanosleep:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0);
test/unittest/providers/rawfbt/tst.return0.r +1 -1
@@ -1 +1 @@ -do_sys_poll ffffffffffffffff returned 0 +hrtimer_nanosleep ffffffffffffffff returned 0
base-commit: 877fcdeb25b370be182d51f27fb4bd8e4f739fb1
Signature · 1 line
2.51.0.284.g117bcb8de7
Quoted 6 lines · Nick Alcock
These two tests probe on
sys_polland just hope something calls it. On sufficiently quiet systems, nothing does.Use
hrtimer_nanosleepinstead.Signed-off-by Nick Alcock <[email protected]>
Quoted 62 lines
--- test/unittest/fbtprovider/tst.return0.d | 4 +++- test/unittest/fbtprovider/tst.return0.r | 2 +- test/unittest/providers/rawfbt/tst.return0.d | 4 +++- test/unittest/providers/rawfbt/tst.return0.r | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-)test/unittest/fbtprovider/tst.return0.d +3
-1@@ -11,10 +11,12 @@ * SECTION: FBT Provider/Probe arguments */ +/* @@trigger: periodic_output */ + #pragma D option quiet #pragma D option statusrate=10ms -fbt::do_sys_poll:return +fbt:vmlinux:hrtimer_nanosleep:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0);test/unittest/fbtprovider/tst.return0.r +1
-1@@ -1 +1 @@ -do_sys_poll ffffffffffffffff returned 0 +hrtimer_nanosleep ffffffffffffffff returned 0test/unittest/providers/rawfbt/tst.return0.d +3
-1@@ -9,10 +9,12 @@ * ASSERTION: simple rawfbt provider arg0 and probefunc print test. */ +/* @@trigger: periodic_output */ + #pragma D option quiet #pragma D option statusrate=10ms -rawfbt::do_sys_poll:return +fbt:vmlinux:hrtimer_nanosleep:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0);test/unittest/providers/rawfbt/tst.return0.r +1
-1@@ -1 +1 @@ -do_sys_poll ffffffffffffffff returned 0 +hrtimer_nanosleep ffffffffffffffff returned 0base-commit:
877fcdeb25b370be182d51f27fb4bd8e4f739fb1Signature · 1 line
2.51.0.284.g117bcb8de7