linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: yhchuang@realtek.com, Larry.Finger@lwfinger.net,
	pkshih@realtek.com, tehuang@realtek.com, sgruszka@redhat.com,
	johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Subject: Re: [RFC v4 08/13] rtw88: debug files
Date: Sat, 13 Oct 2018 13:28:24 -0700	[thread overview]
Message-ID: <0a41d14b9a964b6b7825bf5c55c32f35166354cd.camel@perches.com> (raw)
In-Reply-To: <87y3b1vpjk.fsf@codeaurora.org>

On Sat, 2018-10-13 at 18:23 +0300, Kalle Valo wrote:
> Joe Perches <joe@perches.com> writes:
> 
> > On Sat, 2018-10-13 at 17:00 +0800, yhchuang@realtek.com wrote:
> > > From: Yan-Hsuan Chuang <yhchuang@realtek.com>
> > []
> > > diff --git a/drivers/net/wireless/realtek/rtw88/debug.c
> > > b/drivers/net/wireless/realtek/rtw88/debug.c
> > []
> > > +#ifdef CONFIG_RTW88_DEBUG
> > > +
> > > +void __rtw_dbg(struct rtw_dev *rtwdev, const char *fmt, ...)
> > > +{
> > > +	struct va_format vaf = {
> > > +		.fmt = fmt,
> > > +	};
> > > +	va_list args;
> > > +
> > > +	va_start(args, fmt);
> > > +	vaf.va = &args;
> > > +
> > > +	if (net_ratelimit())
> > > +		dev_dbg(rtwdev->dev, "%pV", &vaf);
> > > +
> > > +	va_end(args);
> > > +}
> > > +EXPORT_SYMBOL(__rtw_dbg);
> > > +
> > > +#define __rtw_fn(fn)							\
> > > +void __rtw_ ##fn(struct rtw_dev *rtwdev, const char *fmt, ...)		\
> > > +{									\
> > > +	struct va_format vaf = {					\
> > > +		.fmt = fmt,						\
> > > +	};								\
> > > +	va_list args;							\
> > > +									\
> > > +	va_start(args, fmt);						\
> > > +	vaf.va = &args;							\
> > > +	dev_ ##fn(rtwdev->dev, "%pV", &vaf);				\
> > > +	va_end(args);							\
> > > +}									\
> > > +EXPORT_SYMBOL(__rtw_ ##fn);
> > > +
> > > +__rtw_fn(info)
> > > +__rtw_fn(warn)
> > > +__rtw_fn(err)
> > 
> > It's very unusual to have _all_ the logging under a CONFIG_<FOO>_DEBUG
> > config guard flag.
> 
> For wireless drivers that is actually quite typical.

No, it isn't.

> IIRC at least ath6kl, ath9k and ath10k do that, most likely also others.

No, they don't.  Check again.

> > Typical debugging would dynamic debugging on a per-line instance andl
> > this uses a single dev_dbg for all debugging.
> 
> I don't recall seeing anyone using per-line dynamic debugging with
> wireless drivers. The drivers are so complex that enabling one message
> at a time doesn't really get you anywhere, that's why we mostly group
> messages into similar groups (or levels) to make it easier to enable
> certain debug messages.

You should look harder.  

> > This seems unnecessarily complexity for a negative gain.
> 
> I haven't reviewed the driver yet but from a quick look I don't see this
> as a problem.
  
It is unnecessarily complex.
This saves one dereference per call, but is it really worth it?



  reply	other threads:[~2018-10-13 20:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13  9:00 [RFC v4 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips yhchuang
2018-10-13  9:00 ` [RFC v4 01/13] rtw88: main files yhchuang
2018-10-13  9:00 ` [RFC v4 02/13] rtw88: core files yhchuang
2018-10-13  9:00 ` [RFC v4 03/13] rtw88: hci files yhchuang
2018-10-13  9:00 ` [RFC v4 04/13] rtw88: trx files yhchuang
2018-10-13  9:00 ` [RFC v4 05/13] rtw88: mac files yhchuang
2018-10-16  8:22   ` Stanislaw Gruszka
2018-10-13  9:00 ` [RFC v4 06/13] rtw88: fw and efuse files yhchuang
2018-10-16  8:25   ` Stanislaw Gruszka
2018-10-13  9:00 ` [RFC v4 07/13] rtw88: phy files yhchuang
2018-10-13  9:00 ` [RFC v4 08/13] rtw88: debug files yhchuang
2018-10-13 14:19   ` Joe Perches
2018-10-13 15:23     ` Kalle Valo
2018-10-13 20:28       ` Joe Perches [this message]
2018-11-04  4:45         ` Joe Perches
2018-11-15 14:15           ` Kalle Valo
2018-11-15 15:19             ` Joe Perches
2018-11-15 16:08               ` Kalle Valo
2018-10-13  9:00 ` [RFC v4 09/13] rtw88: chip files yhchuang
2018-10-13  9:00 ` [RFC v4 10/13] rtw88: 8822B init table yhchuang
2018-10-13  9:00 ` [RFC v4 11/13] rtw88: 8822C " yhchuang
2018-10-13  9:00 ` [RFC v4 12/13] rtw88: Kconfig & Makefile yhchuang
2018-10-13  9:00 ` [RFC v4 13/13] rtw88: add support for Realtek 802.11ac wireless chips yhchuang
2018-10-16  8:28 ` [RFC v4 00/13] rtw88: mac80211 driver for Realtek 802.11ac wireless network chips Stanislaw Gruszka

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=0a41d14b9a964b6b7825bf5c55c32f35166354cd.camel@perches.com \
    --to=joe@perches.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=sgruszka@redhat.com \
    --cc=tehuang@realtek.com \
    --cc=yhchuang@realtek.com \
    /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;
as well as URLs for NNTP newsgroup(s).