Marek Lindner wrote:
/*
- Vis
@@ -160,3 +148,20 @@ int choose_orig(void *data, int32_t size); int is_my_mac(uint8_t *addr); int is_bcast(uint8_t *addr); int is_mcast(uint8_t *addr);
+#ifdef CONFIG_BATMAN_ADV_DEBUG +extern int debug;
+extern int bat_debug_type(int type); +extern int debug_log(struct bat_priv *bat_priv, char *fmt, ...);
+#define bat_dbg(type, bat_priv, fmt, arg...) do { \
if (bat_debug_type(type)) \
debug_log(bat_priv, fmt, ## arg); \
- } \
- while (0)
+#else /* !CONFIG_BATMAN_ADV_DEBUG */ +#define bat_dbg(type, bat_priv, fmt, arg...) do { \
- } \
- while (0)
+#endif
Can you please change that (at least the 'null' function) from a define to an static inline function? Otherwise there are a lot of "unused" warning when compiling without debug support.
static inline void bat_dbg(char type __attribute__((unused)), struct bat_priv *bat_priv __attribute__((unused)), char *fmt __attribute__((unused)), ...) { }
I will send a include guard patch later which is needed to get this working.
To you suggestion to add more information from kernel log to the debug log - it seems to be interesting, but we must ensure that those information are specific to a mesh device. I will sent a patch which modifies all printks later. Maybe we could discuss where it would be a benefit and where it is not needed (~54 printks are for discussion).
Best regards, Sven