[DTrace-devel] [PATCH v2 1/2] tests, io, scalars: use kallsyms instead of kallmodsyms where possible

Nick Alcock nick.alcock at oracle.com
Mon Feb 12 16:21:30 UTC 2024


io/tst.local2.sh works perfectly well with /proc/kallsyms with only a
tiny change in field numbering, which lets this test pass on
unmodified upstream kernels and kernels with the vmlinux.ranges
patch too.

scalars/tst.misc.x needs adjusting to check for the presence of the actual
symbols we are looking up, since the modules might well be built-in, and
thus not show up in /proc/kallsyms.

More elaborate tests like tst.aggmod_full* and the consumer tests are not
touched by this commit: fixing them is a bigger problem.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 test/unittest/io/check_io_probe_args.sh | 6 +++---
 test/unittest/io/tst.local2.sh          | 4 ++--
 test/unittest/scalars/tst.misc.x        | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/unittest/io/check_io_probe_args.sh b/test/unittest/io/check_io_probe_args.sh
index 9a74b712a4c1..00dadb7a0001 100755
--- a/test/unittest/io/check_io_probe_args.sh
+++ b/test/unittest/io/check_io_probe_args.sh
@@ -160,15 +160,15 @@ fi
 #
 
 if [ $UID -ne 0 ]; then
-    echo skipping iodone check since must be root to read PCs in kallmodsyms
+    echo skipping iodone check since must be root to read PCs in kallsyms
     retval=1
 else
     for pc in `gawk 'NF == 23 { print $14 }' $infile | grep -wv 0 | sort | uniq`; do
         gawk '$1 == "'$pc'" && /end.*io/ { found = 1; exit }
-            END { exit(found) }' /proc/kallmodsyms
+            END { exit(found) }' /proc/kallsyms
         if [ $? -eq 0 ]; then
             echo "  ERROR:", $pc, " is not an end-io function"
-            grep $pc /proc/kallmodsyms
+            grep $pc /proc/kallsyms
             retval=1
         fi
     done
diff --git a/test/unittest/io/tst.local2.sh b/test/unittest/io/tst.local2.sh
index df8fdf350358..abf230d017b0 100755
--- a/test/unittest/io/tst.local2.sh
+++ b/test/unittest/io/tst.local2.sh
@@ -90,7 +90,7 @@ END {
 }
 EOF
 
-myaddr=`awk '$4 == "xfs_end_bio"       {print $1}' /proc/kallmodsyms`
+myaddr=`awk '$3 == "xfs_end_bio"       {print $1}' /proc/kallsyms`
 echo check start bytes in log.write with xfs_end_bio address $myaddr
 awk -v myflags=520 -v nrecflag=1 -v myiodone=$myaddr -f awk.txt log.write
 if [ $? -ne 0 ]; then
@@ -99,7 +99,7 @@ if [ $? -ne 0 ]; then
     retval=1
 fi
 
-myaddr=`awk '$4 == "iomap_read_end_io" {print $1}' /proc/kallmodsyms`
+myaddr=`awk '$3 == "iomap_read_end_io" {print $1}' /proc/kallsyms`
 echo check start bytes in log.read with iomap_read_end_io address $myaddr
 awk -v myflags=460 -v nrecflag=2 -v myiodone=$myaddr -f awk.txt log.read
 if [ $? -ne 0 ]; then
diff --git a/test/unittest/scalars/tst.misc.x b/test/unittest/scalars/tst.misc.x
index 1dec0b49741b..b1d179572df3 100755
--- a/test/unittest/scalars/tst.misc.x
+++ b/test/unittest/scalars/tst.misc.x
@@ -1,10 +1,10 @@
 #!/bin/sh
 
-if ! $(grep -qw isofs /proc/kallmodsyms); then
+if ! grep -qw ext4_dir_operations /proc/kallsyms; then
     exit 1
 fi
 
-if ! $(grep -qw ext4 /proc/kallmodsyms); then
+if ! grep -qw isofs_dir_operations /proc/kallsyms; then
     exit 1
 fi
 

base-commit: c520f48bd684667611b0e5787fee98eeb5f54cbb
-- 
2.43.0.272.gce700b77fd




More information about the DTrace-devel mailing list