How to get use count from Linux kernel module?

2019-04-07 00:37发布

问题:

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

回答1:

module_refcount() will give you the use count of the module passed.



回答2:

/sbin/lsmod

The third column will be the number of usages.