From c41564b077479f129fbd3ea8abff8adfb7604b50 Mon Sep 17 00:00:00 2001 From: Park Ju Hyung Date: Sat, 31 Dec 2016 05:07:17 +0900 Subject: 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 Signed-off-by: Alex Naidis --- kernel/trace/Kconfig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'kernel') diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 3c7b7a9bcad1..d8b00f94c63d 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -136,6 +136,20 @@ config GENERIC_TRACER bool select TRACING +if TRACING + +config DISABLE_TRACE_PRINTK + bool "Force disable trace_printk() usage" + default y + help + When trace_printk() is used in any of the kernel source, it enables + debugging functions which are not desired for production kernel. + Enabling this option will replace trace_printk() with pr_debug(). + + If in doubt, say Y. + +endif + # # Minimum requirements an architecture has to meet for us to # be able to offer generic tracing facilities: -- cgit v1.2.3