Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting names of all kernel modules used by a particular module

Tags:

linux-kernel

In the output of lsmod command, Used by column sometimes does not have the name of the kernel modules used by the module. For example, consider the following part-output of the lsmod command:

 Module                  Size  Used by
 xen_blkfront           16512  4 
 ext3                  137007  1 
 jbd                    54383  1 ext3
 mbcache                 7438  1 ext3

In the above output, ext3 module is used by 1 module, but its name is not there. Similarly, xen_blkfront module is used by 4 modules, but there are no names for those modules. But, jdb and mbcache modules are used by ext3 module. So, is there a way to get these missing module names ?

I need this because the kernel does not allow me to rmmod ext3 module saying "ERROR: Module ext3 is in use".

like image 939
ravirj Avatar asked Sep 05 '25 17:09

ravirj


1 Answers

The "Used by" column shows not only the number of referencing modules, but the numer of times that any kernel code has taken a reference to the module.

For file systems and device drivers, this typically happens when a file/device is opened.

The source of those references is not tracked.

like image 162
CL. Avatar answered Sep 11 '25 03:09

CL.