I have a problem with use count of kernel module being developed.I'd like to print it for debugging purpose. How can I obtain it from the module code?
Kernel version in question - Linux 2.6.32
You can try lsmod | grep <module name> to see all loaded kernel modules that are using a module. You can also try dmesg | grep <module name> to see if the kernel logs have any clues as to which processes may be using a module. You may be able to remove the module using rmmod --force <module_name> .
Under Linux use the file /proc/modules shows what kernel modules (drivers) are currently loaded into memory.
Kernel modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. A module can be configured as built-in or loadable.
module_refcount()
will give you the use count of the module passed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With