Re: kldstat bug?

From: David Horn <dhorn2000_at_gmail.com>
Date: Sat, 21 Nov 2009 20:51:22 -0500
On Sat, Nov 21, 2009 at 3:09 PM, James R. Van Artsdalen
<james-freebsd-current_at_jrv.org> wrote:
> amd64, svn 199260, November 13, 2009
>
> Is this behavior of kldstat a bug?  Some modules found, some not, and
> the Id field differs even in success.
>
> # kldstat
> Id Refs Address            Size     Name
>  1   19 0xffffffff80100000 f15ee8   kernel
>  2    1 0xffffffff81016000 194220   zfs.ko
>  3    2 0xffffffff811ab000 3928     opensolaris.ko
>  4    1 0xffffffff811af000 24560    geom_mirror.ko
>  5    1 0xffffffff811d4000 9ac0     siis.ko
>  6    1 0xffffffff811de000 d0a8     ahci.ko
> # kldstat -m zfs
> Id  Refs Name
>  3    1 zfs
> # kldstat -m opensolaris
> Id  Refs Name
>  1    1 opensolaris
> # kldstat -m geom_mirror
> kldstat: can't find module geom_mirror: No such file or directory
> # kldstat -m siis
> kldstat: can't find module siis: No such file or directory
> # kldstat -m ahci
> kldstat: can't find module ahci: No such file or directory
> #
>

If you try using kldstat -v (verbose), you will likely understand a
little better.

There is a file id (for kernel modules *files* like siis.ko), and
there are module ids (for individual modules within the kernel module
file).  The relationship is not necessarily 1:1, as there can be more
than 1 module per kernel module file).

For example:

24    1 0xffffffff810a1000 3c13     siis.ko (/boot/kernel/siis.ko)
	Contains modules:
		Id Name
		440 siis/siisch
		441 pci/siis

Notice that the kernel module file (siis.ko) has an id of 24, and the
modules in that file (siis/siisch and pci/siis) each have there own
module id (440 and 441 repectively).

If you would do a kldstat -m pci/siis you would be able to find that
since the -m flag requires a module name, not a kernel module file
name.

Yes, module name versus kernel module file name and file id vs module
id can cause confusion.

Good Luck.

---Dave
Received on Sun Nov 22 2009 - 00:51:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC