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