|
@@ -1,6 +1,7 @@
|
|
|
#ifndef __KERNEL_PRINTK__
|
|
|
#define __KERNEL_PRINTK__
|
|
|
|
|
|
+#include <log.h>
|
|
|
#include <stdio.h>
|
|
|
#include <linux/compiler.h>
|
|
|
|
|
@@ -28,49 +29,56 @@
|
|
|
0; \
|
|
|
})
|
|
|
|
|
|
-#define __printk(level, fmt, ...) \
|
|
|
-({ \
|
|
|
- level < CONFIG_LOGLEVEL ? printk(fmt, ##__VA_ARGS__) : 0; \
|
|
|
-})
|
|
|
-
|
|
|
#ifndef pr_fmt
|
|
|
#define pr_fmt(fmt) fmt
|
|
|
#endif
|
|
|
|
|
|
-#define pr_emerg(fmt, ...) \
|
|
|
- __printk(0, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_alert(fmt, ...) \
|
|
|
- __printk(1, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_crit(fmt, ...) \
|
|
|
- __printk(2, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_err(fmt, ...) \
|
|
|
- __printk(3, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_warning(fmt, ...) \
|
|
|
- __printk(4, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_warn pr_warning
|
|
|
-#define pr_notice(fmt, ...) \
|
|
|
- __printk(5, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#define pr_info(fmt, ...) \
|
|
|
- __printk(6, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-
|
|
|
-#define pr_cont(fmt, ...) \
|
|
|
- printk(fmt, ##__VA_ARGS__)
|
|
|
-
|
|
|
-/* pr_devel() should produce zero code unless DEBUG is defined */
|
|
|
-#ifdef DEBUG
|
|
|
-#define pr_devel(fmt, ...) \
|
|
|
- __printk(7, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#else
|
|
|
-#define pr_devel(fmt, ...) \
|
|
|
- no_printk(pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
-#endif
|
|
|
+#define pr_emerg(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 0 ? log_emerg(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_alert(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 1 ? log_alert(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_crit(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 2 ? log_crit(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_err(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 3 ? log_err(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_warn(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 4 ? log_warning(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_notice(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 5 ? log_notice(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_info(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 6 ? log_info(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_debug(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 7 ? log_debug(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
+#define pr_devel(fmt, ...) \
|
|
|
+({ \
|
|
|
+ CONFIG_LOGLEVEL > 7 ? log_debug(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
|
|
|
-#ifdef DEBUG
|
|
|
-#define pr_debug(fmt, ...) \
|
|
|
- __printk(7, pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
+#ifdef CONFIG_LOG
|
|
|
+#define pr_cont(fmt, ...) \
|
|
|
+({ \
|
|
|
+ gd->logl_prev < CONFIG_LOGLEVEL ? \
|
|
|
+ log_cont(fmt, ##__VA_ARGS__) : 0; \
|
|
|
+})
|
|
|
#else
|
|
|
-#define pr_debug(fmt, ...) \
|
|
|
- no_printk(pr_fmt(fmt), ##__VA_ARGS__)
|
|
|
+#define pr_cont(fmt, ...) \
|
|
|
+ printk(fmt, ##__VA_ARGS__)
|
|
|
#endif
|
|
|
|
|
|
#define printk_once(fmt, ...) \
|