linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* dynamic debug
@ 2012-06-22 12:23 Johannes Berg
  2012-06-22 14:26 ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2012-06-22 12:23 UTC (permalink / raw)
  To: Joe Perches, Jim Cromie, Jason Baron; +Cc: linux-wireless

Joe, Jim, Jason,

Joe's conversion of mac80211 to pr_debug() was pretty much a disaster,
now people have to first select what they want in Kconfig, and then
still enable dynamic debug in debugfs... That doesn't make any sense at
all, and requires teaching everybody new tricks, so I'm basically
reverting it for now in favour of pr_info() instead of pr_debug().

I'd actually not mind using pr_debug() if it meant we could get rid of
all the Kconfig symbols, but that's not possible.

The biggest problem here really is that the dynamic debug infrastructure
lets us enable messages at runtime, which is great, but the granularity
is useless since you only have these possibilities:
 * module name
 * file name
 * function name
 * line number
 * format string match

The module is obviously way too broad for most modules, and the others
are way too fine-grained.

To actually make it useful, there needs to be a "key" that you can use,
e.g. in mac80211 I could do

DECLARE_DYNDBG_KEY(ps);

and in some C file, I'd have to do the matching DEFINE_DYNDBG_KEY(ps),
similar to how tracing works.

Then, I would get

 * an inline function ps_dbg()
 * a macro "is_ps_debug" or so, so that you can use the enable/disable
   bit of this key, say to create wrappers like netdev_ps_dbg
   (probably needs to be a macro if it uses jump labels which it should
   I think)

and probably some other magic. The DEFINE_ macro would create some
structure, and that would go into some special module section, so that
then the dyn debug core can collect all these keys and allow us to do
something like

 echo mac80211:ps > dynamic_debug/control

That would actually allow us to get rid of all our own Kconfig symbols
and would allow a lot of drivers to get rid of their own infrastructure
for enabling/disabling certain "log levels" etc...

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-06-22 17:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-22 12:23 dynamic debug Johannes Berg
2012-06-22 14:26 ` Joe Perches
2012-06-22 14:34   ` Johannes Berg
2012-06-22 14:41     ` Joe Perches
2012-06-22 14:48       ` Johannes Berg
2012-06-22 15:21       ` Johannes Berg
2012-06-22 15:32         ` Joe Perches
2012-06-22 15:36           ` Johannes Berg
2012-06-22 17:30           ` Johannes Berg

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