* [PATCH 19/20] test: fix modpath test
@ 2026-10-30 19:37 Kris Van Hees
2026-11-06 13:40 ` Nick Alcock
0 siblings, 1 reply; 2+ messages in thread
From: Kris Van Hees @ 2026-10-30 19:37 UTC (permalink / raw)
To: dtrace, dtrace-devel
The empty CTF case was failing because BTF was still providing the types
needed through the BTF-to-CTF conversion fallback.
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
test/unittest/options/tst.modpath.sh | 35 +++++++++++++---------------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/test/unittest/options/tst.modpath.sh b/test/unittest/options/tst.modpath.sh
index 7060a716..b9d92e8a 100755
--- a/test/unittest/options/tst.modpath.sh
+++ b/test/unittest/options/tst.modpath.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# Oracle Linux DTrace.
-# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2023, 2026, 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.
#
@@ -11,6 +11,8 @@ dtrace=$1
DIRNAME="$tmpdir/modpath.$$.$RANDOM"
mkdir -p $DIRNAME
cd $DIRNAME
+# Exercise CTF archive lookup without falling back to BTF.
+dt_flags="$dt_flags -xbtfpath=none"
# Create the directory where the CTF archive will end up.
mkdir -p mydirectory/kernel
@@ -25,11 +27,14 @@ else
echo basic check on DTrace passed
fi
-# Verify that modpath directs us to the (empty) directory, with no CTF info.
-$dtrace $dt_flags -xmodpath=mydirectory -lvP rawtp > empty.out
-if [ $? -ne 0 ]; then
- echo ERROR: empty check on DTrace failed
- cat empty.out
+# Without CTF or BTF, listing rawtp probes must fail with missing type data.
+if $dtrace $dt_flags -xmodpath=mydirectory -lvP rawtp > empty.out 2> empty.err; then
+ echo ERROR: empty check on DTrace unexpectedly succeeded
+ cat empty.out empty.err
+ exit 1
+elif ! grep -Fq 'No type data (CTF or BTF) found for vmlinux' empty.err; then
+ echo ERROR: empty check on DTrace failed for an unexpected reason
+ cat empty.out empty.err
exit 1
else
echo empty check on DTrace passed
@@ -49,30 +54,22 @@ else
fi
# Check the amount of CTF info we got from each run by seeing how many
-# rawtp args have non-trivial type info. While nempty should be 0,
-# nbasic and nfinal should be substantial and likely identical (but
-# we allow a generous tolerance).
+# rawtp args have non-trivial type info. Both nbasic and nfinal should be
+# substantial and likely identical (but we allow a generous tolerance).
nbasic=`gawk '/^[ ]*args\[/ && !/uint64_t/ && !/void \*/' basic.out | wc -l`
-nempty=`gawk '/^[ ]*args\[/ && !/uint64_t/ && !/void \*/' empty.out | wc -l`
nfinal=`gawk '/^[ ]*args\[/ && !/uint64_t/ && !/void \*/' final.out | wc -l`
-if [ $nempty -ne 0 ]; then
- echo ERROR: empty check turned up some CTF info
- cat empty.out
- echo got nbasic $nbasic nempty $nempty nfinal $nfinal
- exit 1
-fi
if [ $nbasic -lt 1000 ]; then
echo ERROR: basic check turned up little CTF info
cat basic.out
- echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+ echo got nbasic $nbasic nfinal $nfinal
exit 1
fi
if [ $nfinal -lt 1000 ]; then
echo ERROR: final check turned up little CTF info
cat final.out
- echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+ echo got nbasic $nbasic nfinal $nfinal
exit 1
fi
if [ $nbasic -gt $(($nfinal + 200)) -o $nfinal -gt $((nbasic + 200)) ]; then
@@ -81,7 +78,7 @@ if [ $nbasic -gt $(($nfinal + 200)) -o $nfinal -gt $((nbasic + 200)) ]; then
cat basic.out
echo ==== final.out:
cat final.out
- echo got nbasic $nbasic nempty $nempty nfinal $nfinal
+ echo got nbasic $nbasic nfinal $nfinal
exit 1
fi
--
2.52.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 19/20] test: fix modpath test
2026-10-30 19:37 [PATCH 19/20] test: fix modpath test Kris Van Hees
@ 2026-11-06 13:40 ` Nick Alcock
0 siblings, 0 replies; 2+ messages in thread
From: Nick Alcock @ 2026-11-06 13:40 UTC (permalink / raw)
To: Kris Van Hees; +Cc: dtrace, dtrace-devel
On 30 Oct 2026, Kris Van Hees spake thusly:
> The empty CTF case was failing because BTF was still providing the types
> needed through the BTF-to-CTF conversion fallback.
Ow.
> Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nix@esperi.org.uk>
(the other things this change does are all reasonable cleanups too.)
--
NULL && (void)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 13:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 19:37 [PATCH 19/20] test: fix modpath test Kris Van Hees
2026-11-06 13:40 ` Nick Alcock
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.