[DTrace-devel] [PATCH] tests, io: don't use /proc/kallmodsyms

Eugene Loh eugene.loh at oracle.com
Mon Feb 5 19:44:41 UTC 2024


Fair enough.
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

But:

1)  How about renaming to "test: Use kallsyms instead of kallmodsyms 
where possible".

2)  Don't single out local2 in the commit message.  E.g., the change in 
check_io_probe_args is independent of local2's use.  How about just:

     Removing unnecessary dependencies on /proc/kallmodsyms
     lets tests pass on unmodified upstream kernels and kernels
     with the vmlinux.ranges patch too.

3)  Remove the corresponding dependency in 
test/unittest/scalars/tst.misc.x as well.

On 1/31/24 09:13, Nick Alcock wrote:
> 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.
>
> 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 ++--
>   2 files changed, 5 insertions(+), 5 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
>
> base-commit: 049dd8b1b9cf2cd45e57385247befb9e10f5a333



More information about the DTrace-devel mailing list