All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] tracing: instruct KCOV not to track tracing files
@ 2018-11-30 15:09 ` Anders Roxell
  0 siblings, 0 replies; 4+ messages in thread
From: Anders Roxell @ 2018-11-30 15:09 UTC (permalink / raw)
  To: rostedt, mingo
  Cc: keescook, catalin.marinas, will.deacon, linux-kernel,
	linux-arm-kernel, Anders Roxell, Arnd Bergmann

When we have KCOV enabled and running ftrace startup tests we end up in
a softlockup. Kcov and ftrace tracing each other makes it really slow:

[  275.141388] Testing tracer wakeup_dl:  PASSED
[  304.738345] Testing tracer function_graph:
[  716.236822] watchdog: BUG: soft lockup - CPU#0 stuck for 21s! [ksoftirqd/0:9]

Rework so that we don't let KCOV look at tracing files. Could probably
be more selective here, but in in general letting KCOV and ftrace check
each isn't the best idea.

Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 kernel/trace/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index f81dadbc7c4a..c7c73b976103 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -6,6 +6,11 @@ ifdef CONFIG_FUNCTION_TRACER
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
 
+# If instrumentation of this dir is enabled, the function tracer gets really
+# slow. Probably could be more selective here, but note that files related
+# to tracing.shouldn't be traced anyway.
+KCOV_INSTRUMENT		:= n
+
 ifdef CONFIG_FTRACE_SELFTEST
 # selftest needs instrumentation
 CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE)
-- 
2.19.2


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

* [PATCH 2/3] tracing: instruct KCOV not to track tracing files
@ 2018-11-30 15:09 ` Anders Roxell
  0 siblings, 0 replies; 4+ messages in thread
From: Anders Roxell @ 2018-11-30 15:09 UTC (permalink / raw)
  To: rostedt, mingo
  Cc: Anders Roxell, keescook, Arnd Bergmann, catalin.marinas,
	will.deacon, linux-kernel, linux-arm-kernel

When we have KCOV enabled and running ftrace startup tests we end up in
a softlockup. Kcov and ftrace tracing each other makes it really slow:

[  275.141388] Testing tracer wakeup_dl:  PASSED
[  304.738345] Testing tracer function_graph:
[  716.236822] watchdog: BUG: soft lockup - CPU#0 stuck for 21s! [ksoftirqd/0:9]

Rework so that we don't let KCOV look at tracing files. Could probably
be more selective here, but in in general letting KCOV and ftrace check
each isn't the best idea.

Co-developed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
---
 kernel/trace/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
index f81dadbc7c4a..c7c73b976103 100644
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -6,6 +6,11 @@ ifdef CONFIG_FUNCTION_TRACER
 ORIG_CFLAGS := $(KBUILD_CFLAGS)
 KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
 
+# If instrumentation of this dir is enabled, the function tracer gets really
+# slow. Probably could be more selective here, but note that files related
+# to tracing.shouldn't be traced anyway.
+KCOV_INSTRUMENT		:= n
+
 ifdef CONFIG_FTRACE_SELFTEST
 # selftest needs instrumentation
 CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE)
-- 
2.19.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH 2/3] tracing: instruct KCOV not to track tracing files
  2018-11-30 15:09 ` Anders Roxell
@ 2018-11-30 15:22   ` Steven Rostedt
  -1 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2018-11-30 15:22 UTC (permalink / raw)
  To: Anders Roxell
  Cc: mingo, keescook, catalin.marinas, will.deacon, linux-kernel,
	linux-arm-kernel, Arnd Bergmann

On Fri, 30 Nov 2018 16:09:35 +0100
Anders Roxell <anders.roxell@linaro.org> wrote:

> When we have KCOV enabled and running ftrace startup tests we end up in
> a softlockup. Kcov and ftrace tracing each other makes it really slow:
> 
> [  275.141388] Testing tracer wakeup_dl:  PASSED
> [  304.738345] Testing tracer function_graph:
> [  716.236822] watchdog: BUG: soft lockup - CPU#0 stuck for 21s! [ksoftirqd/0:9]
> 
> Rework so that we don't let KCOV look at tracing files. Could probably
> be more selective here, but in in general letting KCOV and ftrace check
> each isn't the best idea.
> 
> Co-developed-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  kernel/trace/Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index f81dadbc7c4a..c7c73b976103 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -6,6 +6,11 @@ ifdef CONFIG_FUNCTION_TRACER
>  ORIG_CFLAGS := $(KBUILD_CFLAGS)
>  KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
>  
> +# If instrumentation of this dir is enabled, the function tracer gets really
> +# slow. Probably could be more selective here, but note that files related
> +# to tracing.shouldn't be traced anyway.
> +KCOV_INSTRUMENT		:= n
> +

The entire directory is also set to not be traced by function tracing,
which also is a bit overkill, as there's functions in this directory
that can (and probably should) be.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

>  ifdef CONFIG_FTRACE_SELFTEST
>  # selftest needs instrumentation
>  CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE)


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

* Re: [PATCH 2/3] tracing: instruct KCOV not to track tracing files
@ 2018-11-30 15:22   ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2018-11-30 15:22 UTC (permalink / raw)
  To: Anders Roxell
  Cc: keescook, Arnd Bergmann, catalin.marinas, will.deacon,
	linux-kernel, mingo, linux-arm-kernel

On Fri, 30 Nov 2018 16:09:35 +0100
Anders Roxell <anders.roxell@linaro.org> wrote:

> When we have KCOV enabled and running ftrace startup tests we end up in
> a softlockup. Kcov and ftrace tracing each other makes it really slow:
> 
> [  275.141388] Testing tracer wakeup_dl:  PASSED
> [  304.738345] Testing tracer function_graph:
> [  716.236822] watchdog: BUG: soft lockup - CPU#0 stuck for 21s! [ksoftirqd/0:9]
> 
> Rework so that we don't let KCOV look at tracing files. Could probably
> be more selective here, but in in general letting KCOV and ftrace check
> each isn't the best idea.
> 
> Co-developed-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> ---
>  kernel/trace/Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile
> index f81dadbc7c4a..c7c73b976103 100644
> --- a/kernel/trace/Makefile
> +++ b/kernel/trace/Makefile
> @@ -6,6 +6,11 @@ ifdef CONFIG_FUNCTION_TRACER
>  ORIG_CFLAGS := $(KBUILD_CFLAGS)
>  KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS))
>  
> +# If instrumentation of this dir is enabled, the function tracer gets really
> +# slow. Probably could be more selective here, but note that files related
> +# to tracing.shouldn't be traced anyway.
> +KCOV_INSTRUMENT		:= n
> +

The entire directory is also set to not be traced by function tracing,
which also is a bit overkill, as there's functions in this directory
that can (and probably should) be.

Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

>  ifdef CONFIG_FTRACE_SELFTEST
>  # selftest needs instrumentation
>  CFLAGS_trace_selftest_dynamic.o = $(CC_FLAGS_FTRACE)


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2018-11-30 15:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30 15:09 [PATCH 2/3] tracing: instruct KCOV not to track tracing files Anders Roxell
2018-11-30 15:09 ` Anders Roxell
2018-11-30 15:22 ` Steven Rostedt
2018-11-30 15:22   ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.