1 From 68e76e034b6b1c1ce2eece1ab8ae4008e14be470 Mon Sep 17 00:00:00 2001
2 From: Randy Dunlap <rdunlap@infradead.org>
3 Date: Mon, 15 Jan 2018 11:07:27 -0800
4 Subject: tracing: Prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
6 From: Randy Dunlap <rdunlap@infradead.org>
8 commit 68e76e034b6b1c1ce2eece1ab8ae4008e14be470 upstream.
10 I regularly get 50 MB - 60 MB files during kernel randconfig builds.
11 These large files mostly contain (many repeats of; e.g., 124,594):
13 In file included from ../include/linux/string.h:6:0,
14 from ../include/linux/uuid.h:20,
15 from ../include/linux/mod_devicetable.h:13,
16 from ../scripts/mod/devicetable-offsets.c:3:
17 ../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
20 ../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
22 ../include/linux/string.h:425:2: note: in expansion of macro 'if'
23 if (p_size == (size_t)-1 && q_size == (size_t)-1)
26 This only happens when CONFIG_FORTIFY_SOURCE=y and
27 CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
30 Link: http://lkml.kernel.org/r/9199446b-a141-c0c3-9678-a3f9107f2750@infradead.org
32 Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
33 Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
34 Cc: Arnd Bergmann <arnd@arndb.de>
35 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38 kernel/trace/Kconfig | 2 +-
39 1 file changed, 1 insertion(+), 1 deletion(-)
41 --- a/kernel/trace/Kconfig
42 +++ b/kernel/trace/Kconfig
43 @@ -343,7 +343,7 @@ config PROFILE_ANNOTATED_BRANCHES
44 on if you need to profile the system's use of these macros.
46 config PROFILE_ALL_BRANCHES
47 - bool "Profile all if conditionals"
48 + bool "Profile all if conditionals" if !FORTIFY_SOURCE
49 select TRACE_BRANCH_PROFILING
51 This tracer profiles all branch conditions. Every if ()