Search Linux Wireless

Re: [PATCH 4/6] mac80211: clean up debugging

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2012-06-22 at 19:18 +0200, Johannes Berg wrote:
[]
> diff --git a/net/mac80211/debug.h b/net/mac80211/debug.h
[]
> +#ifdef CONFIG_MAC80211_IBSS_DEBUG
> +#define MAC80211_IBSS_DEBUG 1
> +#else
> +#define MAC80211_IBSS_DEBUG 0
> +#endif

[ a bunch of these...]

> +#ifdef CONFIG_MAC80211_MLME_DEBUG
> +#define MAC80211_MLME_DEBUG 1
> +#else
> +#define MAC80211_MLME_DEBUG 0
> +#endif

This is kind of ugly using UPPER_CASE globals.

Maybe something like:

extern unsigned int mac80211_debug;

#define MAC80211_DEBUG_IBSS	BIT(0)
...
#define MAC80211_DEBUG_MLME	BIT(x)

and in each appropriate location or with a
static inline somethingorother

#ifdef CONFIG_MAC80211_MLME_DEBUG
	mac80211_debug |= MAC80211_DEBUG_MLME;
#endif


> +#define _sdata_info(sdata, fmt, ...)					\
> +do {									\
> +	pr_info("%s: " fmt,						\
> +		(sdata)->name, ##__VA_ARGS__);				\
> +} while (0)
> +
> +#define _sdata_dbg(print, sdata, fmt, ...)				\
> +do {									\
> +	if (print)							\
> +		pr_debug("%s: " fmt,					\
> +			 (sdata)->name, ##__VA_ARGS__);			\
> +} while (0)
> +
> +#define _sdata_err(sdata, fmt, ...)					\
> +do {									\
> +	pr_debug("%s: " fmt,						\
> +		 (sdata)->name, ##__VA_ARGS__);				\
> +} while (0)
> +
> +#define _wiphy_dbg(print, wiphy, fmt, ...)				\
> +do {									\
> +	if (print)							\
> +		wiphy_dbg((wiphy), fmt, ##__VA_ARGS__);			\
> +} while (0)
> +
> +#define sdata_info(sdata, fmt, ...)					\
> +	_sdata_info(sdata, fmt, ##__VA_ARGS__)
> +#define sdata_err(sdata, fmt, ...)					\
> +	_sdata_err(sdata, fmt, ##__VA_ARGS__)
> +#define sdata_dbg(sdata, fmt, ...)					\
> +	_sdata_dbg(1, sdata, fmt, ##__VA_ARGS__)

Then maybe sdata_dbg become mac80211_dbg()

> +
> +#define ht_dbg(sdata, fmt, ...)						\
> +	_sdata_dbg(MAC80211_HT_DEBUG,					\
> +		   sdata, fmt, ##__VA_ARGS__)


> +
> +#define ht_dbg_ratelimited(sdata, fmt, ...)				\
> +	_sdata_dbg(MAC80211_HT_DEBUG && net_ratelimit(),		\
> +		   sdata, fmt, ##__VA_ARGS__)

[ a bunch more ]

and all these wrappers stay.


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux