From: Jason Baron <jasonbaron0@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Rupesh Gujare <rupesh.gujare@atmel.com>,
devel@linuxdriverproject.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, shigekatsu.tateno@atmel.com,
jim.cromie@gmail.com, trenn@suse.de
Subject: Re: [PATCH] staging: ozwpan: Convert printk to dev_dbg()
Date: Wed, 26 Jun 2013 13:46:47 -0400 [thread overview]
Message-ID: <51CB2907.4010100@gmail.com> (raw)
In-Reply-To: <1372181390.1245.68.camel@joe-AO722>
On 06/25/2013 01:29 PM, Joe Perches wrote:
> On Tue, 2013-06-25 at 10:02 -0700, Greg KH wrote:
>> On Tue, Jun 25, 2013 at 05:30:02PM +0100, Rupesh Gujare wrote:
>>> convert all debug messages from printk to dev_dbg() & add kernel config to
>>> enable/disable these messages during compilation.
>> No, just use the built-in dynamic debug code in the kernel, no need to
>> provide any new macros or functions or most importantly, no new Kconfig
>> options.
> I think the Kconfig option is pretty poor too but a
> long needed extension to dev_dbg is to enable classes
> of messages by level or mask.
>
> There are many existing macros like
>
> #define module_dbg(level, fmt, ...)
> do {
> if (level >= some_module_var)
> debug_something(...);
> } while (0)
>
> and
>
> #define module_dbg(mask, fmt, ...)
> do {
> if (mask & some_module_var)
> debug_something(...)
> } while (0)
>
> It'd be nice to consolidate those in dev_dbg
>
> I'll get 'round to it one day if Jason doesn't.
>
Hi,
I've been a bit reluctant to add these 'flag' and 'level' to dynamic
debug b/c the debug statements can already be controlled individually,
and thus one could implement something pretty similar in userspace.
Also, it keeps things simpler.
That said, this has come up several times and might be a nice extension
for both the dynamic debug and non-dynamic debug case.
I think the interface could look something like:
pr_debug_level(&control_var, level, fmt, ...);
pr_debug_mask(&control_var, mask, fmt, ...);
and then you could do something like:
echo "grouping control_var level N +p" > /debugfs/dynamic_debug/control
or
echo "grouping control_var mask 0xN +p" > /debugfs/dynamic_debug/control
So we can think of the 'control_var' as 'grouping' debug statements
together. So it would provide a nice way of associating statements
together other than the existing: module, func, file, format, and line
selectors.
Thanks,
-Jason
next prev parent reply other threads:[~2013-06-26 17:46 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-25 16:30 [PATCH] staging: ozwpan: Convert printk to dev_dbg() Rupesh Gujare
2013-06-25 16:40 ` Joe Perches
2013-06-25 17:02 ` Greg KH
2013-06-25 17:29 ` Joe Perches
2013-06-25 17:38 ` Greg KH
2013-06-25 17:56 ` Joe Perches
2013-06-25 18:03 ` Joe Perches
2013-06-26 17:51 ` Jason Baron
2013-06-26 1:00 ` [PATCH] staging: ozwpan: Use normal Makefile, convert oz_trace to oz_dbg Joe Perches
2013-06-26 11:53 ` Rupesh Gujare
2013-06-26 13:56 ` Joe Perches
2013-06-26 14:19 ` Joe Perches
2013-07-04 12:35 ` [PATCH v2 0/5] Replace debug macro Rupesh Gujare
2013-07-04 14:31 ` Joe Perches
2013-07-04 12:35 ` [PATCH v2 1/5] staging: ozwpan: Remove extra debug logs Rupesh Gujare
2013-07-04 12:35 ` [PATCH v2 2/5] staging: ozwpan: Replace oz_trace with oz_dbg Rupesh Gujare
2013-07-04 12:35 ` [PATCH v2 3/5] staging: ozwpan: Remove old debug macro Rupesh Gujare
2013-07-04 12:35 ` [PATCH v2 4/5] staging: ozwpan: Convert macro to function Rupesh Gujare
2013-07-04 12:35 ` [PATCH v2 5/5] staging: ozwpan: Rename Kbuild to Makefile Rupesh Gujare
2013-07-04 12:45 ` Rupesh Gujare
2013-07-22 17:43 ` Rupesh Gujare
2013-07-22 17:55 ` Greg Kroah-Hartman
2013-07-22 22:08 ` Gujare, Rupesh
2013-07-23 12:44 ` [PATCH v3 0/5] staging: ozwpan: Replace debug macro Rupesh Gujare
2013-07-23 12:44 ` [PATCH v3 1/5] staging: ozwpan: Remove extra debug logs Rupesh Gujare
2013-07-23 12:45 ` [PATCH v3 2/5] staging: ozwpan: Replace oz_trace with oz_dbg Rupesh Gujare
2013-07-23 12:45 ` [PATCH v3 3/5] staging: ozwpan: Remove old debug macro Rupesh Gujare
2013-07-23 12:45 ` [PATCH v3 4/5] staging: ozwpan: Convert macro to function Rupesh Gujare
2013-07-23 12:45 ` [PATCH v3 5/5] staging: ozwpan: Rename Kbuild to Makefile Rupesh Gujare
2013-06-26 17:46 ` Jason Baron [this message]
2013-06-27 0:26 ` [PATCH] staging: ozwpan: Convert printk to dev_dbg() Joe Perches
2013-06-25 17:49 ` Rupesh Gujare
2013-06-25 17:55 ` Alan Stern
2013-06-25 17:57 ` Greg KH
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=51CB2907.4010100@gmail.com \
--to=jasonbaron0@gmail.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rupesh.gujare@atmel.com \
--cc=shigekatsu.tateno@atmel.com \
--cc=trenn@suse.de \
/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