问题
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.
来源:https://stackoverflow.com/questions/3288282/how-to-get-use-count-from-linux-kernel-module