trace: Add a 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: I3edd80bdc0cc6763c7184017f8c0a15de06952bb Signed-off-by: starlight5234 <starlight5234@protonmail.ch>
This commit is contained in:
parent
0752ac29bb
commit
ea73c00adc
@ -690,6 +690,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__)); \
|
||||
@ -712,6 +715,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, ...);
|
||||
|
@ -146,6 +146,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:
|
||||
|
Loading…
Reference in New Issue
Block a user