Skip to content

Commit 43e76af

Browse files
dvyukovtorvalds
authored andcommitted
kcov: ignore fault-inject and stacktrace
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 Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Dmitry Vyukov <[email protected]> Reviewed-by: Andrey Konovalov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 2b75562 commit 43e76af

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ KCOV_INSTRUMENT_softirq.o := n
2727
# and produce insane amounts of uninteresting coverage.
2828
KCOV_INSTRUMENT_module.o := n
2929
KCOV_INSTRUMENT_extable.o := n
30+
KCOV_INSTRUMENT_stacktrace.o := n
3031
# Don't self-instrument.
3132
KCOV_INSTRUMENT_kcov.o := n
3233
KASAN_SANITIZE_kcov.o := n

lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ KCOV_INSTRUMENT_rbtree.o := n
1616
KCOV_INSTRUMENT_list_debug.o := n
1717
KCOV_INSTRUMENT_debugobjects.o := n
1818
KCOV_INSTRUMENT_dynamic_debug.o := n
19+
KCOV_INSTRUMENT_fault-inject.o := n
1920

2021
# Early boot use of cmdline, don't instrument it
2122
ifdef CONFIG_AMD_MEM_ENCRYPT

mm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ KCOV_INSTRUMENT_kmemleak.o := n
2020
KCOV_INSTRUMENT_memcontrol.o := n
2121
KCOV_INSTRUMENT_mmzone.o := n
2222
KCOV_INSTRUMENT_vmstat.o := n
23+
KCOV_INSTRUMENT_failslab.o := n
2324

2425
CFLAGS_init-mm.o += $(call cc-disable-warning, override-init)
2526
CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides)

0 commit comments

Comments
 (0)