如何获取“%d”的值? Linux内核的dynamic_debug信息中的变量?
我在自己定制的Linux内核中启用了config_dynamic_debug=y
,并按照内核源代码附带的dynamic_debug文档,运行以下命令来启用蓝牙子系统中调试信息的输出:
echo -n 'file net/bluetooth/bnep/core.c line 722 +p' > /sys/kernel/debug/dynamic_debug/control
这意味着文件 net/bluetooth/bnep/core.c
第 772 行中的调试信息将被记录。
bnep.ko模块加载后,我检查了/sys/kernel/debug/dynamic_debug/control
的输出,调试信息就在那里。
但大多数看起来像:
> net/bluetooth/bnep/core.c:422 [bnep]bnep_tx_frame - "skb %p dev %p type %d\012"
我很想知道 %p
或 %d
代表的值,但我不知道该怎么做。
非常感谢!
I enabled config_dynamic_debug=y
in the Linux kernel customized by myself, and following the dynamic_debug documentation shipped with kernel source code, I run the following command to enable the output of the debug information in bluetooth subsystem:
echo -n 'file net/bluetooth/bnep/core.c line 722 +p' > /sys/kernel/debug/dynamic_debug/control
which means the debug info in the line 772 of the file net/bluetooth/bnep/core.c
will be logged.
After the bnep.ko module is loaded, I checked the output of /sys/kernel/debug/dynamic_debug/control
, the debug information is there.
But most of them look like:
> net/bluetooth/bnep/core.c:422 [bnep]bnep_tx_frame - "skb %p dev %p type %d\012"
I really want to know the value represented by %p
or %d
, but I don't know how to do it.
Thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已启用该调试语句,这是从
/sys/kernel/debug/dynamic_debug/control
读取的信息。从现在开始,该调试消息将被发送到正常的内核日志,您可以使用 dmesg 和/或 syslog 守护程序查看该日志(通常会记录到 /var/log/ messages 或
/var/log/everything/
或一些类似的路径)。You have enabled that debug statement, which is what reading from
/sys/kernel/debug/dynamic_debug/control
tells you.From now on, that debug message will be sent to the normal kernel log, which you can view with
dmesg
and/or with your syslog daemon (which will normally log to/var/log/messages
or/var/log/everything/
, or some similar path).