如何从Linux内核模块获取使用计数? [英] How to get use count from Linux kernel module?

查看:67
本文介绍了如何从Linux内核模块获取使用计数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发的内核模块的使用计数有问题,我想将其打印出来以进行调试.如何从模块代码中获取它?

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?

有问题的内核版本-Linux 2.6.32

Kernel version in question - Linux 2.6.32

推荐答案

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

这篇关于如何从Linux内核模块获取使用计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆