Merge tag 'mtd/fixes-for-4.18-rc3' of git://git.infradead.org/linux-mtd
[linux-2.6-block.git] / lib / Kconfig.debug
index eb885942eb0f1e6f39fdc1fa93596395cdc3313f..8838d1158d192bfafe61fc234480ad9c9a05971f 100644 (file)
@@ -736,12 +736,15 @@ config ARCH_HAS_KCOV
          only for x86_64. KCOV requires testing on other archs, and most likely
          disabling of instrumentation for some early boot code.
 
+config CC_HAS_SANCOV_TRACE_PC
+       def_bool $(cc-option,-fsanitize-coverage=trace-pc)
+
 config KCOV
        bool "Code coverage for fuzzing"
        depends on ARCH_HAS_KCOV
+       depends on CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS
        select DEBUG_FS
-       select GCC_PLUGINS if !COMPILE_TEST
-       select GCC_PLUGIN_SANCOV if !COMPILE_TEST
+       select GCC_PLUGIN_SANCOV if !CC_HAS_SANCOV_TRACE_PC
        help
          KCOV exposes kernel code coverage information in a form suitable
          for coverage-guided fuzzing (randomized testing).
@@ -755,7 +758,7 @@ config KCOV
 config KCOV_ENABLE_COMPARISONS
        bool "Enable comparison operands collection by KCOV"
        depends on KCOV
-       default n
+       depends on $(cc-option,-fsanitize-coverage=trace-cmp)
        help
          KCOV also exposes operands of every comparison in the instrumented
          code along with operand sizes and PCs of the comparison instructions.
@@ -765,7 +768,7 @@ config KCOV_ENABLE_COMPARISONS
 config KCOV_INSTRUMENT_ALL
        bool "Instrument all code by default"
        depends on KCOV
-       default y if KCOV
+       default y
        help
          If you are doing generic system call fuzzing (like e.g. syzkaller),
          then you will want to instrument the whole kernel and you should
@@ -1503,6 +1506,10 @@ config NETDEV_NOTIFIER_ERROR_INJECT
 
          If unsure, say N.
 
+config FUNCTION_ERROR_INJECTION
+       def_bool y
+       depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
+
 config FAULT_INJECTION
        bool "Fault-injection framework"
        depends on DEBUG_KERNEL
@@ -1510,10 +1517,6 @@ config FAULT_INJECTION
          Provide fault-injection framework.
          For more details, see Documentation/fault-injection/.
 
-config FUNCTION_ERROR_INJECTION
-       def_bool y
-       depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
-
 config FAILSLAB
        bool "Fault-injection capability for kmalloc"
        depends on FAULT_INJECTION
@@ -1544,16 +1547,6 @@ config FAIL_IO_TIMEOUT
          Only works with drivers that use the generic timeout handling,
          for others it wont do anything.
 
-config FAIL_MMC_REQUEST
-       bool "Fault-injection capability for MMC IO"
-       depends on FAULT_INJECTION_DEBUG_FS && MMC
-       help
-         Provide fault-injection capability for MMC IO.
-         This will make the mmc core return data errors. This is
-         useful to test the error handling in the mmc block device
-         and to test how the mmc host driver handles retries from
-         the block device.
-
 config FAIL_FUTEX
        bool "Fault-injection capability for futexes"
        select DEBUG_FS
@@ -1561,6 +1554,12 @@ config FAIL_FUTEX
        help
          Provide fault-injection capability for futexes.
 
+config FAULT_INJECTION_DEBUG_FS
+       bool "Debugfs entries for fault-injection capabilities"
+       depends on FAULT_INJECTION && SYSFS && DEBUG_FS
+       help
+         Enable configuration of fault-injection capabilities via debugfs.
+
 config FAIL_FUNCTION
        bool "Fault-injection capability for functions"
        depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION
@@ -1571,11 +1570,15 @@ config FAIL_FUNCTION
          an error value and have to handle it. This is useful to test the
          error handling in various subsystems.
 
-config FAULT_INJECTION_DEBUG_FS
-       bool "Debugfs entries for fault-injection capabilities"
-       depends on FAULT_INJECTION && SYSFS && DEBUG_FS
+config FAIL_MMC_REQUEST
+       bool "Fault-injection capability for MMC IO"
+       depends on FAULT_INJECTION_DEBUG_FS && MMC
        help
-         Enable configuration of fault-injection capabilities via debugfs.
+         Provide fault-injection capability for MMC IO.
+         This will make the mmc core return data errors. This is
+         useful to test the error handling in the mmc block device
+         and to test how the mmc host driver handles retries from
+         the block device.
 
 config FAULT_INJECTION_STACKTRACE_FILTER
        bool "stacktrace filter for fault-injection capabilities"