linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kcov: ignore fault-inject and stacktrace
@ 2020-01-16 11:14 Dmitry Vyukov
  2020-01-16 11:39 ` Andrey Konovalov
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Vyukov @ 2020-01-16 11:14 UTC (permalink / raw)
  To: akpm; +Cc: Dmitry Vyukov, Andrey Konovalov, kasan-dev, linux-kernel

From: Dmitry Vyukov <dvyukov@google.com>

Don't instrument 3 more files that contain debugging facilities and
produce large amounts of uninteresting coverage for every syscall.
The following snippets are sprinkled all over the place in kcov
traces in a debugging kernel. We already try to disable instrumentation
of stack unwinding code and of most debug facilities. I guess we
did not use fault-inject.c at the time, and stacktrace.c was somehow
missed (or something has changed in kernel/configs).
This change both speeds up kcov (kernel doesn't need to store these
PCs, user-space doesn't need to process them) and frees trace buffer
capacity for more useful coverage.

should_fail
lib/fault-inject.c:149
fail_dump
lib/fault-inject.c:45

stack_trace_save
kernel/stacktrace.c:124
stack_trace_consume_entry
kernel/stacktrace.c:86
stack_trace_consume_entry
kernel/stacktrace.c:89
... a hundred frames skipped ...
stack_trace_consume_entry
kernel/stacktrace.c:93
stack_trace_consume_entry
kernel/stacktrace.c:86

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@google.com>
Cc: kasan-dev@googlegroups.com
Cc: linux-kernel@vger.kernel.org
---
 kernel/Makefile | 1 +
 lib/Makefile    | 1 +
 mm/Makefile     | 1 +
 3 files changed, 3 insertions(+)

diff --git a/kernel/Makefile b/kernel/Makefile
index e5ffd8c002541..5d935b63f812a 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -30,6 +30,7 @@ KCSAN_SANITIZE_softirq.o = n
 # and produce insane amounts of uninteresting coverage.
 KCOV_INSTRUMENT_module.o := n
 KCOV_INSTRUMENT_extable.o := n
+KCOV_INSTRUMENT_stacktrace.o := n
 # Don't self-instrument.
 KCOV_INSTRUMENT_kcov.o := n
 KASAN_SANITIZE_kcov.o := n
diff --git a/lib/Makefile b/lib/Makefile
index 004a4642938af..6cd19bb3085c5 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -16,6 +16,7 @@ KCOV_INSTRUMENT_rbtree.o := n
 KCOV_INSTRUMENT_list_debug.o := n
 KCOV_INSTRUMENT_debugobjects.o := n
 KCOV_INSTRUMENT_dynamic_debug.o := n
+KCOV_INSTRUMENT_fault-inject.o := n
 
 # Early boot use of cmdline, don't instrument it
 ifdef CONFIG_AMD_MEM_ENCRYPT
diff --git a/mm/Makefile b/mm/Makefile
index 3c53198835479..c9696f3ec8408 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -28,6 +28,7 @@ KCOV_INSTRUMENT_kmemleak.o := n
 KCOV_INSTRUMENT_memcontrol.o := n
 KCOV_INSTRUMENT_mmzone.o := n
 KCOV_INSTRUMENT_vmstat.o := n
+KCOV_INSTRUMENT_failslab.o := n
 
 CFLAGS_init-mm.o += $(call cc-disable-warning, override-init)
 CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides)
-- 
2.25.0.rc1.283.g88dfdc4193-goog


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

* Re: [PATCH] kcov: ignore fault-inject and stacktrace
  2020-01-16 11:14 [PATCH] kcov: ignore fault-inject and stacktrace Dmitry Vyukov
@ 2020-01-16 11:39 ` Andrey Konovalov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Konovalov @ 2020-01-16 11:39 UTC (permalink / raw)
  To: Dmitry Vyukov; +Cc: Andrew Morton, Dmitry Vyukov, kasan-dev, LKML

On Thu, Jan 16, 2020 at 12:14 PM Dmitry Vyukov <dvyukov@gmail.com> wrote:
>
> From: Dmitry Vyukov <dvyukov@google.com>
>
> Don't instrument 3 more files that contain debugging facilities and
> produce large amounts of uninteresting coverage for every syscall.
> The following snippets are sprinkled all over the place in kcov
> traces in a debugging kernel. We already try to disable instrumentation
> of stack unwinding code and of most debug facilities. I guess we
> did not use fault-inject.c at the time, and stacktrace.c was somehow
> missed (or something has changed in kernel/configs).
> This change both speeds up kcov (kernel doesn't need to store these
> PCs, user-space doesn't need to process them) and frees trace buffer
> capacity for more useful coverage.
>
> should_fail
> lib/fault-inject.c:149
> fail_dump
> lib/fault-inject.c:45
>
> stack_trace_save
> kernel/stacktrace.c:124
> stack_trace_consume_entry
> kernel/stacktrace.c:86
> stack_trace_consume_entry
> kernel/stacktrace.c:89
> ... a hundred frames skipped ...
> stack_trace_consume_entry
> kernel/stacktrace.c:93
> stack_trace_consume_entry
> kernel/stacktrace.c:86
>
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>

Reviewed-by: Andrey Konovalov <andreyknvl@google.com>

> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Andrey Konovalov <andreyknvl@google.com>
> Cc: kasan-dev@googlegroups.com
> Cc: linux-kernel@vger.kernel.org
> ---
>  kernel/Makefile | 1 +
>  lib/Makefile    | 1 +
>  mm/Makefile     | 1 +
>  3 files changed, 3 insertions(+)
>
> diff --git a/kernel/Makefile b/kernel/Makefile
> index e5ffd8c002541..5d935b63f812a 100644
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -30,6 +30,7 @@ KCSAN_SANITIZE_softirq.o = n
>  # and produce insane amounts of uninteresting coverage.
>  KCOV_INSTRUMENT_module.o := n
>  KCOV_INSTRUMENT_extable.o := n
> +KCOV_INSTRUMENT_stacktrace.o := n
>  # Don't self-instrument.
>  KCOV_INSTRUMENT_kcov.o := n
>  KASAN_SANITIZE_kcov.o := n
> diff --git a/lib/Makefile b/lib/Makefile
> index 004a4642938af..6cd19bb3085c5 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -16,6 +16,7 @@ KCOV_INSTRUMENT_rbtree.o := n
>  KCOV_INSTRUMENT_list_debug.o := n
>  KCOV_INSTRUMENT_debugobjects.o := n
>  KCOV_INSTRUMENT_dynamic_debug.o := n
> +KCOV_INSTRUMENT_fault-inject.o := n
>
>  # Early boot use of cmdline, don't instrument it
>  ifdef CONFIG_AMD_MEM_ENCRYPT
> diff --git a/mm/Makefile b/mm/Makefile
> index 3c53198835479..c9696f3ec8408 100644
> --- a/mm/Makefile
> +++ b/mm/Makefile
> @@ -28,6 +28,7 @@ KCOV_INSTRUMENT_kmemleak.o := n
>  KCOV_INSTRUMENT_memcontrol.o := n
>  KCOV_INSTRUMENT_mmzone.o := n
>  KCOV_INSTRUMENT_vmstat.o := n
> +KCOV_INSTRUMENT_failslab.o := n
>
>  CFLAGS_init-mm.o += $(call cc-disable-warning, override-init)
>  CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides)
> --
> 2.25.0.rc1.283.g88dfdc4193-goog
>

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

end of thread, other threads:[~2020-01-16 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 11:14 [PATCH] kcov: ignore fault-inject and stacktrace Dmitry Vyukov
2020-01-16 11:39 ` Andrey Konovalov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).