File tree Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Expand file tree Collapse file tree 3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -375,8 +375,6 @@ CFLAGS_KERNEL =
375
375
AFLAGS_KERNEL =
376
376
LDFLAGS_vmlinux =
377
377
CFLAGS_GCOV := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
378
- CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
379
-
380
378
381
379
# Use USERINCLUDE when you must reference the UAPI directories only.
382
380
USERINCLUDE := \
@@ -659,6 +657,7 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLA
659
657
KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
660
658
endif
661
659
660
+ include scripts/Makefile.kcov
662
661
include scripts/Makefile.gcc-plugins
663
662
664
663
ifdef CONFIG_READABLE_ASM
Original file line number Diff line number Diff line change @@ -756,6 +756,16 @@ config KCOV
756
756
757
757
For more details, see Documentation/dev-tools/kcov.rst.
758
758
759
+ config KCOV_ENABLE_COMPARISONS
760
+ bool "Enable comparison operands collection by KCOV"
761
+ depends on KCOV
762
+ default n
763
+ help
764
+ KCOV also exposes operands of every comparison in the instrumented
765
+ code along with operand sizes and PCs of the comparison instructions.
766
+ These operands can be used by fuzzing engines to improve the quality
767
+ of fuzzing coverage.
768
+
759
769
config KCOV_INSTRUMENT_ALL
760
770
bool "Instrument all code by default"
761
771
depends on KCOV
Original file line number Diff line number Diff line change
1
+ ifdef CONFIG_KCOV
2
+ CFLAGS_KCOV := $(call cc-option,-fsanitize-coverage=trace-pc,)
3
+ ifeq ($(CONFIG_KCOV_ENABLE_COMPARISONS),y)
4
+ CFLAGS_KCOV += $(call cc-option,-fsanitize-coverage=trace-cmp,)
5
+ endif
6
+
7
+ endif
You can’t perform that action at this time.
0 commit comments