mxi1
mxi1

Reputation: 166

How can I get the value of "%d" variables in dynamic_debug info of Linux kernel?

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!

Upvotes: 2

Views: 553

Answers (1)

ninjalj
ninjalj

Reputation: 43698

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).

Upvotes: 2

Related Questions