如何从Linux内核模块获取使用计数?

发布于 2024-09-10 17:47:24 字数 82 浏览 1 评论 0原文

我对正在开发的内核模块的使用计数有疑问。我想打印它以进行调试。如何从模块代码中获取它?

有问题的内核版本 - Linux 2.6.32

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

海风掠过北极光 2024-09-17 17:47:24

module_refcount() 将为您提供所传递模块的使用计数。

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

囚我心虐我身 2024-09-17 17:47:24

/sbin/lsmod

第三列是使用次数。

/sbin/lsmod

The third column will be the number of usages.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文