Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 4/6] mac80211: clean up debugging
Date: Sat, 23 Jun 2012 09:03:20 -0700	[thread overview]
Message-ID: <1340467400.7758.19.camel@joe2Laptop> (raw)
In-Reply-To: <1340385525-14487-5-git-send-email-johannes@sipsolutions.net>

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.



  parent reply	other threads:[~2012-06-23 16:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-22 17:18 [PATCH v2 0/6] mac80211 debugging Johannes Berg
2012-06-22 17:18 ` [PATCH 1/6] mac80211: remove TKIP debug Johannes Berg
2012-06-22 17:18 ` [PATCH 2/6] mac80211: two small verbose debug cleanups Johannes Berg
2012-06-22 17:18 ` [PATCH 3/6] mac80211: pass sdata to some RX functions Johannes Berg
2012-06-22 17:18 ` [PATCH 4/6] mac80211: clean up debugging Johannes Berg
2012-06-23  8:02   ` Joe Perches
2012-06-23 13:04     ` Johannes Berg
2012-06-23 15:40       ` Joe Perches
2012-06-24  9:30         ` Johannes Berg
2012-06-25 21:29           ` Jason Baron
2012-06-26  5:23             ` Joe Perches
2012-06-23 16:03   ` Joe Perches [this message]
2012-06-22 17:18 ` [PATCH 5/6] mac80211: rename driver-trace file Johannes Berg
2012-06-22 17:18 ` [PATCH 6/6] mac80211: trace debug messages Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2012-06-22 13:14 mac80211 logging/tracing Johannes Berg
2012-06-22 13:14 ` [PATCH 4/6] mac80211: clean up debugging Johannes Berg
2012-06-22 14:37   ` Joe Perches
2012-06-22 14:43     ` Johannes Berg
2012-06-22 14:49       ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340467400.7758.19.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox