summaryrefslogtreecommitdiff
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorPark Ju Hyung <qkrwngud825@gmail.com>2016-12-31 05:07:17 +0900
committerMichael Bestas <mkbestas@lineageos.org>2019-12-23 23:43:33 +0200
commitc41564b077479f129fbd3ea8abff8adfb7604b50 (patch)
treedf476bdf0c6d7adc26a718b5ea8c881f38f72fd5 /include/linux/kernel.h
parent425799635358454521ca64d6366b2ccea29bdda0 (diff)
trace: add CONFIG_DISABLE_TRACE_PRINTK option
Poorly made kernel trees often use trace_printk() without properly guarding them in a #ifdef macro. Such usage of trace_printk() causes a warning at boot and additional memory allocation. This option serves to disable those all at once with ease. Change-Id: I2cb2085f48064bda8c18806597c5aee57237dca6 Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com> Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 05b63a1e9f84..3098b65177a3 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -605,6 +605,9 @@ do { \
* let gcc optimize the rest.
*/
+#ifdef CONFIG_DISABLE_TRACE_PRINTK
+#define trace_printk pr_debug
+#else
#define trace_printk(fmt, ...) \
do { \
char _______STR[] = __stringify((__VA_ARGS__)); \
@@ -627,6 +630,7 @@ do { \
else \
__trace_printk(_THIS_IP_, fmt, ##args); \
} while (0)
+#endif
extern __printf(2, 3)
int __trace_bprintk(unsigned long ip, const char *fmt, ...);