[DTrace-devel] [PATCH 4/4] test: Do not depend on ext4

Kris Van Hees kris.van.hees at oracle.com
Wed Nov 27 16:51:47 UTC 2024


Resend to the list for Nick

On Wed, Oct 30, 2024 at 04:14:54PM -0400, Eugene Loh wrote:
> E.g.,
>     $ uname -r
>     5.15.0-205.149.5.1.el9uek.aarch64
>     $ sudo grep ext4_dir_operations /proc/kallmodsyms
>      ffffc45a59d9ee88 100 D ext4_dir_operations
>      $ sudo awk '/ext4/ { print NF }' /proc/kallmodsyms | uniq -c
>        2342 4
>     $ sudo grep -w ext4 /proc/kallmodsyms
> 
> So, lots of ext4 symbols (including ext4_dir_operations) but none of them
> are [ext4].  Bug in... kallmodsyms?
> 
> On 10/25/24 17:16, Kris Van Hees wrote:
> > I am not too sure about this patch...  We are not using kallmodsyms anymore
> > for newer kernels, and on older kernels that symbol certainly be listed as
> > [ext4].  So, if ext4_dir_operations *is* in the ext4 module code (compiled in
> > or loadable), then the proper ref to it would be ext4`ext4_dir_operations.
> > So the test should be able to use that - if not, that seems like a bug rather
> > than something to change in the test?
> > 
> > On Fri, Oct 04, 2024 at 12:43:55AM -0400, eugene.loh at oracle.com wrote:
> > > From: Eugene Loh <eugene.loh at oracle.com>
> > > 
> > > It is possible that there is no ext4 module, whether built-in or otherwise,
> > > even if its symbols are present.  E.g.,
> > >      # grep ext4_dir_operations /proc/kallmodsyms
> > >      ffffc45a59d9ee88 100 D ext4_dir_operations
> > >      # grep -w ext4 /proc/kallmodsyms
> > >      #
> > > 
> > > Meanwhile, in
> > >      ab883bae "tests, io, scalars: use kallsyms instead of kallmodsyms where possible"
> > > we read:
> > >      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.
> > > 
> > > With that patch, in test/unittest/scalars/tst.misc.x, we check:
> > >     -if ! $(grep -qw ext4 /proc/kallmodsyms); then
> > >     +if ! grep -qw ext4_dir_operations /proc/kallsyms; then
> > >          exit 1
> > >      fi
> > > 
> > > So it is possible for us to find
> > >          `ext4_dir_operations
> > > but not
> > >      ext4`ext4_dir_operations
> > > 
> > > Change the .d script to look simply for `ext4_dir_operations.
> > > 
> > > Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
> > > ---
> > >   test/unittest/scalars/tst.misc.d | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/test/unittest/scalars/tst.misc.d b/test/unittest/scalars/tst.misc.d
> > > index 60edab45e..6a5f4ae2e 100644
> > > --- a/test/unittest/scalars/tst.misc.d
> > > +++ b/test/unittest/scalars/tst.misc.d
> > > @@ -20,7 +20,7 @@
> > >   BEGIN
> > >   {
> > >   	printf("\nr_cpu_ids = 0x%x\n", `nr_cpu_ids);
> > > -	printf("ext4`ext4_dir_operations = %p\n", &ext4`ext4_dir_operations);
> > > +	printf("ext4`ext4_dir_operations = %p\n", &`ext4_dir_operations);
> > >   	printf("isofs`isofs_dir_operations = %p\n", &isofs`isofs_dir_operations);
> > >   	printf("vmlinux`major_names = %p\n", &vmlinux`major_names);
> > >   	x = 123;
> > > -- 
> > > 2.43.5
> > > 



More information about the DTrace-devel mailing list