How to get use count from Linux kernel module?

断了今生、忘了曾经 提交于 2019-12-06 00:40:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!