dynamic debug v2 - convert alsa
Subsystems (2)
PATCH 7/7 dynamic debug v2 - convert alsa
-convert alsa to new infrastructure
Signed-off-by Jason Baron <[email protected]>
---
include/sound/core.h | 14 ++++++++++---- lib/dynamic_printk.c | 1 - sound/core/misc.c | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-)
include/sound/core.h +10 -4
@@ -364,7 +364,11 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) printk(fmt ,##args)#endif -#ifdef CONFIG_SND_DEBUG +#if defined(CONFIG_SND_DEBUG ) && !defined(CONFIG_DYNAMIC_PRINTK_DEBUG ) +#define DEBUG 1 +#endif + +#if defined(CONFIG_SND_DEBUG ) || defined(CONFIG_DYNAMIC_PRINTK_DEBUG )#define __ASTRING__ (x) #x
@@ -376,11 +380,13 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)* Compiled only when Works like snd_printk() for debugging purpose. * Ignored when CONFIG_SND_DEBUG is not set. */ -#define snd_printd(fmt, args...) \ - snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) +#define snd_printd(fmt, args...) do { \ + if (dynamic_dbg_enabled(TYPE_BOOLEAN, 0, 0)) \ + snd_verbose_printd(__FILE__, __LINE__, fmt, ##args); \ + } while (0)#else #define snd_printd(fmt, args...) \ - printk(fmt ,##args) + pr_debug(fmt, ##args)#endif /** * snd_assert - run-time assertion macro
lib/dynamic_printk.c +0 -1
@@ -210,7 +210,6 @@ int register_debug_module(char *mod_name, int type, char *share_name, } }if (strcmp (mod_name, share_name) && (!elem->parent)) { -printk ("register_debug_module: %s :%s\n" , mod_name, share_name); parent =find_debug_module (share_name);if (!parent) {__add_debug_module (share_name);
sound/core/misc.c +1 -1
@@ -55,7 +55,7 @@ void snd_verbose_printk(const char *file, int line, const char *format, ...)EXPORT_SYMBOL (snd_verbose_printk);#endif -#if defined(CONFIG_SND_DEBUG ) && defined(CONFIG_SND_VERBOSE_PRINTK ) +#if (defined(CONFIG_SND_DEBUG ) || defined(CONFIG_DYNAMIC_PRINTK_DEBUG )) && defined(CONFIG_SND_VERBOSE_PRINTK )void snd_verbose_printd (const char *file,int line,const char *format, ...) {va_list args;