Commit 00e14f04 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

make: Add DEBUG=1 option

This allows to use pr_debug and dprintk helpers.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 4c0fb12e
...@@ -49,6 +49,10 @@ ifneq ($(WERROR),0) ...@@ -49,6 +49,10 @@ ifneq ($(WERROR),0)
WARNINGS += -Werror WARNINGS += -Werror
endif endif
ifeq ($(DEBUG),1)
DEFINES += -DCR_DEBUG
endif
WARNINGS += -Wall -Wno-unused WARNINGS += -Wall -Wno-unused
CFLAGS += $(WARNINGS) $(DEFINES) CFLAGS += $(WARNINGS) $(DEFINES)
......
...@@ -60,15 +60,17 @@ extern void printk(const char *format, ...); ...@@ -60,15 +60,17 @@ extern void printk(const char *format, ...);
pr_err_jmp(label); \ pr_err_jmp(label); \
} while (0) } while (0)
#if 0 #ifdef CR_DEBUG
#define pr_debug(fmt, ...) \ #define pr_debug(fmt, ...) \
do { \ do { \
printk("%s (%s:%d): " fmt, \ printk("%s:%d:%s: " fmt, \
__func__, __FILE__, __LINE__, \ __FILE__, __LINE__,__func__, \
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while (0) } while (0)
#define dprintk(fmt, ...) printk(fmt, ##__VA_ARGS__)
#else #else
#define pr_debug(fmt, ...) #define pr_debug(fmt, ...)
#define dprintk(fmt, ...)
#endif #endif
#define die(fmt, ...) \ #define die(fmt, ...) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment