From: Andrew Lunn <andrew.lunn@ascom.ch>
To: "B.A.T.M.A.N" <b.a.t.m.a.n@lists.open-mesh.net>
Subject: Re: [B.A.T.M.A.N.] [batman-adv] Use prinkt instead of debug_log
Date: Sun, 23 Aug 2009 15:54:51 +0200 [thread overview]
Message-ID: <20090823135451.GA17243@ma.tech.ascom.ch> (raw)
In-Reply-To: <20090823130934.GA28556@ma.tech.ascom.ch>
Hi Folks
I've been considering what to do with the remaining debug_log
calls.
We have three classes of output from debug_log:
1) Changes to HNA entries, all in translation-table.c.
2) Changes of routes, all in routing.c
3) All the remaining debug output scattered in a number of files.
1) and 2) are pretty low volume in terms of output, and code size.
3) is a lot more verbose and needs more code. It is also not so
efficient in that it does lots of string manipulations, creating ascii
representations of MAC addresses which rarely get output. That can be
fixed once we are close to integration to mainline and can drop
backward compatibility to older kernels. We can then use the %pM
format in printk. However, until then, it would be good to be able to
compile out this code.
Traditionally the network code uses pr_debug() for outputting debug
information. This is disabled by default and in order to see it, it is
necessary to add #define DEBUG to any file you want to see the debug
output from.
I don't think pr_debug is flexible enough for what we want at the
moment. My proposal is to add to main.h macros
#define CONFIG_BATMAN_DEBUG_ROUTE 1
#define CONFIG_BATMAN_DEBUG_BATMAN 0
#if CONFIG_BATMAN_DEBUG_ROUTE
pr_route_debug(format, a...) printk(KERN_DEBUG "batman:" format, ##a)
#else
pr_route_debug(format, a...)
#endif
#if CONFIG_BATMAN_DEBUG_BATMAN
pr_batman_debug(format, a...) printk(KERN_DEBUG "batman:" format, ##a)
#else
pr_batman_debug(format, a...)
#endif
So by default the routing updates will make it out, but the rest is
disabled by default.
What do others think?
Andrew
next prev parent reply other threads:[~2009-08-23 13:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-23 13:09 [B.A.T.M.A.N.] [batman-adv] Use prinkt instead of debug_log Andrew Lunn
2009-08-23 13:54 ` Andrew Lunn [this message]
2009-08-24 9:02 ` Marek Lindner
2009-08-24 10:08 ` Andrew Lunn
2009-08-24 12:16 ` Marek Lindner
2009-08-24 13:05 ` Andrew Lunn
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=20090823135451.GA17243@ma.tech.ascom.ch \
--to=andrew.lunn@ascom.ch \
--cc=b.a.t.m.a.n@lists.open-mesh.net \
/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