linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Joe Perches <joe@perches.com>
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 18:23:27 +0300	[thread overview]
Message-ID: <87y3b1vpjk.fsf@codeaurora.org> (raw)
In-Reply-To: <a731948bf875867be4246b72a661ce71833620b8.camel@perches.com> (Joe Perches's message of "Sat, 13 Oct 2018 07:19:31 -0700")

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. IIRC at least
ath6kl, ath9k and ath10k do that, most likely also others.

> Typical debugging would dynamic debugging on a per-line instance and
> 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.

> 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.

> Also, many callers of the rtw_<level> logging function do not include
> a terminating newline.
>
> Please consistently use a newline for each format.

But with this I do agree.

-- 
Kalle Valo

  reply	other threads:[~2018-10-13 15:23 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 [this message]
2018-10-13 20:28       ` Joe Perches
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=87y3b1vpjk.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=joe@perches.com \
    --cc=johannes@sipsolutions.net \
    --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).