make {,g}dprintk() a no-op in non-debug builds

As discussed before, code absolutely wanting to get something into the
log should use {,g}printk() instead.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2015-03-26 11:11:13 +01:00
1 parent 18fb87e980
commit 28fbff96c1
2 files changed
+20 -10

No files matched your search

-10
View File
@@ -72,16 +72,6 @@
#define MB(_mb) (_AC(_mb, UL) << 20)
#define GB(_gb) (_AC(_gb, UL) << 30)
#ifndef __ASSEMBLY__
#define dprintk(_l, _f, _a...) \
printk(_l "%s:%d: " _f, __FILE__ , __LINE__ , ## _a )
#define gdprintk(_l, _f, _a...) \
printk(XENLOG_GUEST _l "%s:%d:%pv " _f, __FILE__, \
__LINE__, current, ## _a )
#endif /* !__ASSEMBLY__ */
#define __STR(...) #__VA_ARGS__
#define STR(...) __STR(__VA_ARGS__)
+20
View File
@@ -88,6 +88,26 @@ extern int printk_ratelimit(void);
#define gprintk(lvl, fmt, args...) \
printk(XENLOG_GUEST lvl "%pv " fmt, current, ## args)
#ifdef NDEBUG
static inline void
__attribute__ ((__format__ (__printf__, 2, 3)))
dprintk(const char *lvl, const char *fmt, ...) {}
static inline void
__attribute__ ((__format__ (__printf__, 2, 3)))
gdprintk(const char *lvl, const char *fmt, ...) {}
#else
#define dprintk(lvl, fmt, args...) \
printk(lvl "%s:%d: " fmt, __FILE__, __LINE__, ## args)
#define gdprintk(lvl, fmt, args...) \
printk(XENLOG_GUEST lvl "%s:%d:%pv " fmt, \
__FILE__, __LINE__, current, ## args)
#endif
/* vsprintf.c */
#define sprintf __xen_has_no_sprintf__
#define vsprintf __xen_has_no_vsprintf__
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.