[PATCH 3/7] debug: use printk() instead pr_debug()

Kalle Valo kvalo at qca.qualcomm.com
Mon May 20 10:14:13 EDT 2013


Eugene Krasnikov <k.eugene.e at gmail.com> writes:

> It is not only about line numbers in the source code but also about
> whole files and flexibility that dynamic debug provides. I am not sure
> why Atheros/QCA is not using pr_debug but other vendors like
> TI(http://lxr.free-electrons.com/source/drivers/net/wireless/ti/wlcore/debug.h?a=blackfin#L78),
> Broadcom(http://lxr.free-electrons.com/source/drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h#L58),
> Marvel(http://lxr.free-electrons.com/source/drivers/net/wireless/mwifiex/main.c#L768)
> are using it rather spread.

Still in linux-wireless mailing list I have never heard any developer
asking a user to use dynamic debugging to provide more information. I
restate my statement: it's useless and more trouble than real benefit.
Trust me, no-one wants to involve with a mess of trying to figure out
all the time changing line numbers.

But if you want to keep it, I'm not going to loose my sleep on it :)
Let's try to find a compromise.

> What if we hide it behind CONFIG_DYNAMIC_DEBUG like this :
>
> #if defined(CONFIG_DYNAMIC_DEBUG)
>
> #define wcn36xx_dbg(mask, fmt, arg...) \
> if (debug_mask & mask) \
> pr_debug(DRIVER_PREFIX fmt "\n", ##arg)
> #else
>
> #define wcn36xx_dbg(mask, fmt, arg...) \
> if (debug_mask & mask) \
> printk(DRIVER_PREFIX fmt "\n", ##arg)
>
> #endif

So if CONFIG_DYNAMIC_DEBUG is enabled user/developer needs to use both
debug_mask and dynamic debug interface to enable the messages, right?
Sounds pretty awkward.

With a compile time check it would that the kernel needs to recompiled
if a user wants to use only debug_mask. How is this aproach better than
what I suggested? My suggestion had an extra jump, but the overhead from
that is minimal.

-- 
Kalle Valo



More information about the wcn36xx mailing list