Getting output of brcmf_dbg()?

I'd like to enable and see "info" and possibly "trace" level output from brcmf_dbg() in the brcmfmac driver+utils, but it's not clear how to get it. What's the easiest way to log it all, starting from boot-time driver initialisation?

Related, do I need to recompile with the answer to the above baked-in or can I do it via R/W of appropriate config+log files? (I'm using the stock18.06.2 release on a Netgear R8000 but can compile if needed)

AFAIR brcmf_dbg() uses dev_dbg() internally which means you need to compile OpenWrt image with the CONFIG_KERNEL_DYNAMIC_DEBUG.

Then you need to specify brcmf_msg_level value, in your case you need a bit sum of:

#define BRCMF_TRACE_VAL		0x00000002
#define BRCMF_INFO_VAL		0x00000004

Finally you need to enable debugging messages using /sys/kernel/debug/dynamic_debug/control

Thanks!

Can you clarify how/where should I specify "brcmf_msg_level value= 6" ( 2 || 4)? And is CONFIG_KERNEL_DYNAMIC_DEBUG a makeconfig option to be selected, or a setting to be manually edited in the makefile/env?

Hopefully the rest will work first time when I try compiling with debug support - and thanks!

I think there are two ways:

  1. insmod brcmfmac.ko debug=0x6 (I'm afraid modprobe doesn't support passing parameters)
  2. echo 6 > /sys/module/brcmfmac/parameters/debug

Check it :wink:
It's an option available in the make menuconfig. Please note it's possible to search, just press / after entering make menuconfig and write symbol name there.