mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
@ 2018-01-15 19:07 Randy Dunlap
  2018-01-15 19:10 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-01-15 19:07 UTC (permalink / raw)
  To: LKML, Steven Rostedt

From: Randy Dunlap <rdunlap@infradead.org>

I regularly get 50 MB - 60 MB files during kernel randconfig builds.
These large files mostly contain (many repeats of; e.g., 124,594):

In file included from ../include/linux/string.h:6:0,
                 from ../include/linux/uuid.h:20,
                 from ../include/linux/mod_devicetable.h:13,
                 from ../scripts/mod/devicetable-offsets.c:3:
../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
    ______f = {     \
    ^
../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
                       ^
../include/linux/string.h:425:2: note: in expansion of macro 'if'
  if (p_size == (size_t)-1 && q_size == (size_t)-1)
  ^

This only happens when CONFIG_FORTIFY_SOURCE=y and
CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
FORTIFY_SOURCE=y.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 kernel/trace/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- orig/kernel/trace/Kconfig
+++ next/kernel/trace/Kconfig
@@ -355,7 +355,7 @@ config PROFILE_ANNOTATED_BRANCHES
 	  on if you need to profile the system's use of these macros.
 
 config PROFILE_ALL_BRANCHES
-	bool "Profile all if conditionals"
+	bool "Profile all if conditionals" if !FORTIFY_SOURCE
 	select TRACE_BRANCH_PROFILING
 	help
 	  This tracer profiles all branch conditions. Every if ()

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
  2018-01-15 19:07 [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y Randy Dunlap
@ 2018-01-15 19:10 ` Steven Rostedt
  2018-01-15 19:12   ` Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2018-01-15 19:10 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: LKML

On Mon, 15 Jan 2018 11:07:27 -0800
Randy Dunlap <rdunlap@infradead.org> wrote:

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> I regularly get 50 MB - 60 MB files during kernel randconfig builds.
> These large files mostly contain (many repeats of; e.g., 124,594):
> 
> In file included from ../include/linux/string.h:6:0,
>                  from ../include/linux/uuid.h:20,
>                  from ../include/linux/mod_devicetable.h:13,
>                  from ../scripts/mod/devicetable-offsets.c:3:
> ../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
>     ______f = {     \
>     ^
> ../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
>                        ^
> ../include/linux/string.h:425:2: note: in expansion of macro 'if'
>   if (p_size == (size_t)-1 && q_size == (size_t)-1)
>   ^
> 
> This only happens when CONFIG_FORTIFY_SOURCE=y and
> CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
> FORTIFY_SOURCE=y.
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

I'm actually working on a patch that I need to send to Linus before
4.15 is released. Want me to add this one too? Or do you have your own
branch to push to mainline with?

-- Steve

> ---
>  kernel/trace/Kconfig |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- orig/kernel/trace/Kconfig
> +++ next/kernel/trace/Kconfig
> @@ -355,7 +355,7 @@ config PROFILE_ANNOTATED_BRANCHES
>  	  on if you need to profile the system's use of these macros.
>  
>  config PROFILE_ALL_BRANCHES
> -	bool "Profile all if conditionals"
> +	bool "Profile all if conditionals" if !FORTIFY_SOURCE
>  	select TRACE_BRANCH_PROFILING
>  	help
>  	  This tracer profiles all branch conditions. Every if ()

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
  2018-01-15 19:10 ` Steven Rostedt
@ 2018-01-15 19:12   ` Randy Dunlap
  2018-01-15 19:14     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-01-15 19:12 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML

On 01/15/2018 11:10 AM, Steven Rostedt wrote:
> On Mon, 15 Jan 2018 11:07:27 -0800
> Randy Dunlap <rdunlap@infradead.org> wrote:
> 
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> I regularly get 50 MB - 60 MB files during kernel randconfig builds.
>> These large files mostly contain (many repeats of; e.g., 124,594):
>>
>> In file included from ../include/linux/string.h:6:0,
>>                  from ../include/linux/uuid.h:20,
>>                  from ../include/linux/mod_devicetable.h:13,
>>                  from ../scripts/mod/devicetable-offsets.c:3:
>> ../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
>>     ______f = {     \
>>     ^
>> ../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
>>                        ^
>> ../include/linux/string.h:425:2: note: in expansion of macro 'if'
>>   if (p_size == (size_t)-1 && q_size == (size_t)-1)
>>   ^
>>
>> This only happens when CONFIG_FORTIFY_SOURCE=y and
>> CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
>> FORTIFY_SOURCE=y.
>>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> 
> I'm actually working on a patch that I need to send to Linus before
> 4.15 is released. Want me to add this one too? Or do you have your own
> branch to push to mainline with?

I don't have any branch to push.  Please merge it whenever you think it's
appropriate.

Thanks.

> -- Steve
> 
>> ---
>>  kernel/trace/Kconfig |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> --- orig/kernel/trace/Kconfig
>> +++ next/kernel/trace/Kconfig
>> @@ -355,7 +355,7 @@ config PROFILE_ANNOTATED_BRANCHES
>>  	  on if you need to profile the system's use of these macros.
>>  
>>  config PROFILE_ALL_BRANCHES
>> -	bool "Profile all if conditionals"
>> +	bool "Profile all if conditionals" if !FORTIFY_SOURCE
>>  	select TRACE_BRANCH_PROFILING
>>  	help
>>  	  This tracer profiles all branch conditions. Every if ()
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y
  2018-01-15 19:12   ` Randy Dunlap
@ 2018-01-15 19:14     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2018-01-15 19:14 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: LKML

On Mon, 15 Jan 2018 11:12:46 -0800
Randy Dunlap <rdunlap@infradead.org> wrote:

> On 01/15/2018 11:10 AM, Steven Rostedt wrote:
> > On Mon, 15 Jan 2018 11:07:27 -0800
> > Randy Dunlap <rdunlap@infradead.org> wrote:
> >   
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >>
> >> I regularly get 50 MB - 60 MB files during kernel randconfig builds.
> >> These large files mostly contain (many repeats of; e.g., 124,594):
> >>
> >> In file included from ../include/linux/string.h:6:0,
> >>                  from ../include/linux/uuid.h:20,
> >>                  from ../include/linux/mod_devicetable.h:13,
> >>                  from ../scripts/mod/devicetable-offsets.c:3:
> >> ../include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static [enabled by default]
> >>     ______f = {     \
> >>     ^
> >> ../include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if'
> >>                        ^
> >> ../include/linux/string.h:425:2: note: in expansion of macro 'if'
> >>   if (p_size == (size_t)-1 && q_size == (size_t)-1)
> >>   ^
> >>
> >> This only happens when CONFIG_FORTIFY_SOURCE=y and
> >> CONFIG_PROFILE_ALL_BRANCHES=y, so prevent PROFILE_ALL_BRANCHES if
> >> FORTIFY_SOURCE=y.
> >>
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>  
> > 
> > I'm actually working on a patch that I need to send to Linus before
> > 4.15 is released. Want me to add this one too? Or do you have your own
> > branch to push to mainline with?  
> 
> I don't have any branch to push.  Please merge it whenever you think it's
> appropriate.
> 

I'll take it. Thanks,

-- Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-15 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15 19:07 [PATCH] tracing: prevent PROFILE_ALL_BRANCHES when FORTIFY_SOURCE=y Randy Dunlap
2018-01-15 19:10 ` Steven Rostedt
2018-01-15 19:12   ` Randy Dunlap
2018-01-15 19:14     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®