Lines Matching +full:in +full:- +full:kernel
1 # SPDX-License-Identifier: GPL-2.0-only
2 menu "Kernel hacking"
18 The behavior is also controlled by the kernel command line
19 parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
26 in task context) or a caller "processor id" (if not in task context)
35 no option to enable/disable at the kernel command line parameter or
39 int "Default console loglevel (1-15)"
45 Setting a default here is equivalent to passing in loglevel=<x> in
46 the kernel bootargs. loglevel=<x> continues to override whatever
49 Note: This does not affect the log level of un-prefixed printk()
50 usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT
54 int "quiet console loglevel (1-15)"
58 loglevel to use when "quiet" is passed on the kernel commandline.
60 When "quiet" is passed on the kernel commandline this loglevel
65 int "Default message log level (1-7)"
71 This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
76 by default. To change that, use loglevel=<x> in the kernel bootargs,
83 This build option allows you to read kernel boot messages
85 specified in milliseconds on the kernel command line,
105 Compiles debug level messages into the kernel, which would not
107 enabled/disabled based on various levels of scope - per source file,
109 implicitly compiles in all pr_debug() and dev_dbg() calls, which
110 enlarges the kernel text size by about 2%.
113 pr_debug() calls in it are enabled by default, but can be
120 which is contained in the 'debugfs' filesystem or procfs.
147 nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
150 // enable all the messages in file svcsock.c
151 nullarbor:~ # echo -n 'file svcsock.c +p' >
154 // enable all the messages in the NFS server module
155 nullarbor:~ # echo -n 'module nfsd +p' >
158 // enable all 12 messages in the function svc_process()
159 nullarbor:~ # echo -n 'func svc_process +p' >
162 // disable all 12 messages in the function svc_process()
163 nullarbor:~ # echo -n 'func svc_process -p' >
166 See Documentation/admin-guide/dynamic-debug-howto.rst for additional
175 when you want to tie dynamic debug to your kernel modules with
177 the case of embedded system where the kernel image size is
181 bool "Support symbolic error names in printf"
184 If you say Y here, the kernel's printf implementation will
186 of the number 28. It makes the kernel image slightly larger
187 (about 3KB), but can make the kernel logs easier to read.
196 debugging but costs about 70-100K of memory.
200 menu "Compile-time checks and compiler options"
203 bool "Compile the kernel with debug info"
206 If you say Y here the resulting kernel image will include
207 debugging info resulting in a larger kernel image.
208 This adds debug symbols to the kernel and modules (gcc -g), and
209 is needed if you intend to use kernel crashdump or binary object
210 tools like crash, kgdb, LKCD, gdb, etc on the kernel.
211 Say Y here only if you plan to debug the kernel.
231 depends on $(cc-option,-gz=zlib)
232 depends on $(ld-option,--compress-debug-sections=zlib)
237 Users of dpkg-deb via scripts/package/builddeb may find an increase in
245 bool "Produce split debuginfo in .dwo files"
246 depends on $(cc-option,-gsplit-dwarf)
250 because it stores the information only once on disk in .dwo
251 files instead of multiple times in object files and executables.
252 In addition the debug information is also compressed.
261 depends on $(cc-option,-gdwarf-4)
266 variables in gdb on optimized code.
278 bool "Provide GDB scripts for kernel debugging"
280 This creates the required links to GDB helper scripts in the
283 additional functions are available to analyze a Linux kernel
284 instance. See Documentation/dev-tools/gdb-kernel-debugging.rst
293 Enable the __must_check logic in the kernel build. Disable this to
310 bool "Strip assembler-generated symbols during link"
313 Strip internal assembler-generated symbols during a link (symbols
322 assembler output. This may make the kernel slightly slower, but it helps
323 to keep kernel developers who have to stare a lot at assembler listings
330 This option will install uapi headers (headers exported to user-space)
331 into the usr/include directory for use during the kernel build.
332 This is unneeded for building the kernel itself, but needed for some
333 user-space program samples. It is also needed by some features such
342 any use of code/data previously in these sections would
343 most likely result in an oops.
344 In the code, functions and variables are annotated with
345 __init,, etc. (see the full list in include/linux/init.h),
346 which results in the code/data being placed in specific sections.
348 kernel build, and enabling this option causes the following
350 - Add the option -fno-inline-functions-called-once to gcc commands.
351 When inlining a function annotated with __init in a non-init
354 This option tells gcc to inline less (but it does result in
355 a larger kernel).
358 bool "Make section mismatch errors non-fatal"
373 it will slightly increase the kernel size and affect icache usage.
386 bool "Compile the kernel with frame pointers"
390 If you say Y here the resulting kernel image will be slightly
392 in case of kernel bugs. (precise oopses/stacktraces/warnings)
395 bool "Compile-time stack metadata validation"
399 Add compile-time checks to validate stack metadata, including frame
407 tools/objtool/Documentation/stack-validation.txt.
415 bool "Force weak per-cpu definitions"
418 s390 and alpha require percpu variables in modules to be
431 menu "Generic Kernel Debugging Instruments"
438 if the system crashes for example during kernel debugging (e.g., you
444 keys are documented in <file:Documentation/admin-guide/sysrq.rst>.
454 to a bitmask as described in Documentation/admin-guide/sysrq.rst.
479 debugfs is a virtual file system that kernel developers use to put
494 It can be overridden with kernel command line option
495 debugfs=[on,no-mount,off]. The restrictions apply for API access
514 Access is off. Clients get -PERM when trying to create nodes in
516 Client can then back-off or continue without debugfs access.
527 bool "Kernel debugging"
530 identify kernel problems.
550 kernel to track the life time of various objects and validate
560 bool "Debug objects in freed memory"
565 properly. This can make kmalloc/kfree-intensive workloads
599 int "debug_objects bootup default value (0-1)"
610 Say Y here to have the kernel do limited verification on memory
612 memory. This can make kmalloc/kfree-intensive workloads much slower.
624 off in a kernel built with CONFIG_SLUB_DEBUG_ON by specifying
625 "slub_debug=-".
632 SLUB statistics are useful to debug SLUBs allocation behavior in
638 Try running: slabinfo -DA
644 bool "Kernel memory leak detector"
652 detector. The memory allocation/freeing is traced in a way
655 only shown in /sys/kernel/debug/kmemleak. Enabling this
657 allocations. See Documentation/dev-tools/kmemleak.rst for more
663 In order to access the kmemleak file, debugfs needs to be
664 mounted (usually at /sys/kernel/debug).
680 tristate "Simple test for the kernel memory leak detector"
714 task has ever had available in the sysrq-T and sysrq-P debug output.
726 This is to ensure no erroneous behaviour occurs which could result in
740 Enable this to turn on extended checks in the virtual-memory system
750 can cause significant overhead, so only enable it in non-production
756 bool "Debug VM red-black trees"
759 Enable VM red-black tree debugging information and extra validations.
764 bool "Debug page-flags operations"
778 architecture page table helper functions on various platforms in
780 will help architecture code in making sure that any changes or
782 semantics of the generic MM. Platforms will have to opt in for
794 Enable some costly sanity checks in virtual to page code. This can
814 on the mminit_loglevel= command-line option.
824 debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
829 Example: Inject memory hotplug offline error (-12 == -ENOMEM)
831 # cd /sys/kernel/debug/notifier-error-inject/memory
832 # echo -12 > actions/MEM_GOING_OFFLINE/error
837 be called memory-notifier-error-inject.
847 been set up. This adds a fair amount of code to kernel memory
866 Say Y here if you want to check for overflows of kernel, IRQ
871 These kinds of bugs usually occur when call-chains in the
872 kernel get too deep, especially when interrupts are
875 Use this in cases where you see apparently random memory
876 corruption, especially if it appears in 'struct thread_info'
878 If in doubt, say "N".
898 Say Y here to enable the kernel to panic when it oopses. This
899 has the same effect as setting oops=panic on the kernel command
902 This feature is useful to ensure that the kernel does not do
903 anything erroneous after an oops which could result in data
918 Set the timeout value (in seconds) until a reboot occurs when
919 the kernel panics. If n = 0, then we wait forever. A timeout
931 Say Y here to enable the kernel to act as a watchdog to detect
934 Softlockups are bugs that cause the kernel to loop in kernel
943 Say Y here to enable the kernel to panic on "soft lockups",
944 which are bugs that cause the kernel to loop in kernel
948 The panic can be used in combination with panic_timeout,
951 high-availability systems that have uptime guarantees and
986 Say Y here to enable the kernel to act as a watchdog to detect
989 Hardlockups are bugs that cause the CPU to loop in kernel mode
998 Say Y here to enable the kernel to panic on "hard lockups",
999 which are bugs that cause the kernel to loop in kernel
1017 Say Y here to enable the kernel to detect "hung tasks",
1018 which are bugs that cause the task to be stuck in
1021 When a hung task is detected, the kernel will print the
1023 task will stay in uninterruptible state. If lockdep is
1028 int "Default timeout for hung task detection (in seconds)"
1032 This option controls the default timeout (in seconds) used
1033 to determine when a task has become non-responsive and should
1036 It can be adjusted at runtime via the kernel.hung_task_timeout_secs
1038 /proc/sys/kernel/hung_task_timeout_secs.
1041 Keeping the default should be fine in most cases.
1047 Say Y here to enable the kernel to panic on "hung tasks",
1048 which are bugs that cause the kernel to leave a task stuck
1049 in uninterruptible "D" state.
1051 The panic can be used in combination with panic_timeout,
1054 high-availability systems that have uptime guarantees and
1074 state. This can be configured through kernel parameter
1086 Also it could generate series of lockups with cooling-down periods.
1114 scheduler behavior and provide them in /proc/schedstat. These
1129 This may include checks in the timekeeping hotpaths, so this
1136 bool "Debug preemptible kernel"
1140 If you say Y here then the kernel will use a debug variant of the
1142 if kernel code uses it in a preemption-unsafe way. Also, the kernel
1166 This feature enables the kernel to prove that all locking
1167 that occurs in the kernel runtime is mathematically
1174 In short, this feature enables the kernel to report locking
1179 participant CPUs, tasks and irq-contexts would be needed
1184 reported by the kernel (once the event is observed that
1188 observed by the kernel, are mathematically correct), the
1189 kernel reports nothing.
1192 and rwsems - in which case all dependencies between these
1197 For more details, see Documentation/locking/lockdep-design.rst.
1200 bool "Enable raw_spinlock - spinlock nesting checks"
1210 addressed which is work in progress. This config switch allows to
1246 bool "Spinlock and rw-lock debugging: basic checks"
1252 best used in conjunction with the NMI watchdog so that spinlock
1270 injecting additional -EDEADLK wound/backoff cases. Together with
1275 it really should not be enabled in a production or distro kernel,
1276 even a debug kernel. If you are a driver writer, enable it. If
1295 mutex or rwsem) is incorrectly freed by the kernel, via any of the
1296 memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
1332 bool "Locking API boot-time self-tests"
1335 Say Y here if you want the kernel to run a short self-test during
1336 bootup. The self-test checks whether common types of locking bugs
1347 This option provides a kernel module that runs torture tests
1348 on kernel locking primitives. The kernel module may be built
1349 after the fact on the running kernel to be tested, if desired.
1351 Say Y here if you want kernel locking-primitive torture tests
1352 to be built into the kernel.
1359 This option provides a kernel module that runs tests on the
1362 It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction
1373 This option provides a kernel module that runs torture tests
1374 on the smp_call_function() family of primitives. The kernel
1375 module may be built after the fact on the running kernel to
1407 This option causes the kernel to create a /proc/pid/stack for
1409 It is also used by various kernel debugging features that require
1416 Some parts of the kernel contain bugs relating to their use of
1426 result in dmesg getting spammed for a surprisingly long
1431 address this, by default the kernel will issue only a single
1436 those developers interested in improving the security of
1462 If you say Y here, the kernel will delay the release of kobjects
1469 menu "Debug kernel data structures"
1475 Enable this to turn on extended checks in the linked-list
1484 Enable this to turn on extended checks in the priority-ordered
1485 linked-list (plist) walking routines. This checks the entire
1494 Enable this to turn on checks on scatter-gather tables. This can
1505 This is most useful for kernel developers to make sure that
1514 Select this option if the kernel should BUG when it encounters
1515 data corruption in kernel memory structures when they get checked
1533 security pointer in the cred struct is never seen to be invalid.
1537 source "kernel/rcu/Kconfig.debug"
1540 bool "Force round-robin CPU selection for unbound work items"
1547 preferred work items may be put on foreign CPUs. Kernel
1549 round-robin CPU selection to flush out usages which depend on the
1567 may introduce non-contiguous block device numbers. This
1569 the extended space and spreads them to discover kernel or
1607 to find out which userspace is blocking on what kernel operations.
1609 source "kernel/trace/Kconfig"
1615 If you want to debug problems which hang or crash the kernel early
1623 Even controlling a kernel debugger is possible using remote DMA.
1628 all OHCI1394 controllers which are found in the PCI config space.
1636 in charge of the OHCI-1394 controllers should be used instead.
1638 See Documentation/core-api/debugging-via-ohci1394.rst for more information.
1652 of memory, including kernel and userspace memory. Accidental
1654 be used by people debugging the kernel. Note that with PAT support
1655 enabled, even in this case there are restrictions on /dev/mem
1663 If in doubt, say Y.
1670 io-memory regardless of whether a driver is actively using that
1672 specific access can be used by people debugging kernel drivers.
1675 userspace access to *idle* io-memory ranges (see /proc/iomem) This
1679 If in doubt, say Y.
1687 menu "Kernel Testing and Coverage"
1709 interface /sys/kernel/debug/notifier-error-inject/pm
1714 Example: Inject PM suspend error (-12 = -ENOMEM)
1716 # cd /sys/kernel/debug/notifier-error-inject/pm/
1717 # echo -12 > actions/PM_SUSPEND_PREPARE/error
1722 be called pm-notifier-error-inject.
1733 /sys/kernel/debug/notifier-error-inject/OF-reconfig/
1739 be called of-reconfig-notifier-error-inject.
1749 interface /sys/kernel/debug/notifier-error-inject/netdev
1754 Example: Inject netdevice mtu change error (-22 = -EINVAL)
1756 # cd /sys/kernel/debug/notifier-error-inject/netdev
1757 # echo -22 > actions/NETDEV_CHANGEMTU/error
1762 be called netdev-notifier-error-inject.
1771 bool "Fault-injection framework"
1774 Provide fault-injection framework.
1775 For more details, see Documentation/fault-injection/.
1778 bool "Fault-injection capability for kmalloc"
1782 Provide fault-injection capability for kmalloc.
1785 bool "Fault-injection capability for alloc_pages()"
1788 Provide fault-injection capability for alloc_pages().
1794 Provides fault-injection capability to inject failures
1795 in usercopy functions (copy_from_user(), get_user(), ...).
1798 bool "Fault-injection capability for disk IO"
1801 Provide fault-injection capability for disk IO.
1804 bool "Fault-injection capability for faking disk interrupts"
1807 Provide fault-injection capability on end IO handling. This
1815 bool "Fault-injection capability for futexes"
1819 Provide fault-injection capability for futexes.
1822 bool "Debugfs entries for fault-injection capabilities"
1825 Enable configuration of fault-injection capabilities via debugfs.
1828 bool "Fault-injection capability for functions"
1831 Provide function-based fault-injection capability.
1835 error handling in various subsystems.
1838 bool "Fault-injection capability for MMC IO"
1841 Provide fault-injection capability for MMC IO.
1843 useful to test the error handling in the mmc block device
1848 bool "stacktrace filter for fault-injection capabilities"
1854 Provide stacktrace filter for fault-injection capabilities
1864 def_bool $(cc-option,-fsanitize-coverage=trace-pc)
1874 KCOV exposes kernel code coverage information in a form suitable
1875 for coverage-guided fuzzing (randomized testing).
1881 For more details, see Documentation/dev-tools/kcov.rst.
1886 depends on $(cc-option,-fsanitize-coverage=trace-cmp)
1888 KCOV also exposes operands of every comparison in the instrumented
1899 then you will want to instrument the whole kernel and you should
1905 hex "Size of interrupt coverage collection area in words"
1909 KCOV uses preallocated per-cpu areas to collect coverage from
1910 soft interrupts. This specifies the size of those areas in the
1920 tristate "Linux Kernel Dump Test Tool Module"
1929 Documentation on how to use the module can be found in
1930 Documentation/fault-injection/provoke-crashes.rst
1953 tristate "Array-based sort test"
1956 This option enables the self-test function of 'sort()' at boot,
1976 This option provides a kernel module that can be used to test
1977 the kernel stack backtrace code. This option is not useful
1978 for distributions or general kernels, but only for kernel
1987 tristate "Red-Black tree test"
1994 tristate "Reed-Solomon library test"
2000 This option enables the self-test function of rslib at boot,
2016 Enable this option to build test module which validates per-cpu
2022 tristate "Perform an atomic64_t self-test"
2034 This is a one-shot self test that permutes through the
2036 N-disk array. Recovery is performed with the asynchronous
2043 tristate "Test functions located in the hexdump module at runtime"
2046 tristate "Test functions located in the string_helpers module at runtime"
2065 tristate "Test functions located in the uuid module at runtime"
2083 Enable this option to test the kernel's integer (<linux/hash.h>),
2087 This is intended to help people writing architecture-specific
2130 no compiler warnings from C=1 sparse checker or -Wextra
2150 tristate "Test user/kernel boundary protections"
2155 user/kernel boundary testing is working. If it fails to load,
2156 a regression has been detected in the user/kernel memory boundary
2167 current setting. This is in particular useful for BPF JIT compiler
2168 development, but also to run regression tests against changes in
2198 actual firmware-using device. The contents can be rechecked by
2220 in TAP format (http://testanything.org/). Only useful for kernel devs
2224 For more information on KUnit and unit tests in general please refer
2225 to the KUnit documentation in Documentation/dev-tools/kunit/.
2236 For more information on KUnit and unit tests in general please refer
2237 to the KUnit documentation in Documentation/dev-tools/kunit/.
2242 tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
2251 in TAP format (https://testanything.org/). Only useful for kernel devs
2255 For more information on KUnit and unit tests in general please refer
2256 to the KUnit documentation in Documentation/dev-tools/kunit/.
2267 For more information on KUnit and unit tests in general please refer
2268 to the KUnit documentation in Documentation/dev-tools/kunit/.
2277 Tests the logic of macros defined in bits.h.
2278 For more information on KUnit and unit tests in general please refer
2279 to the KUnit documentation in Documentation/dev-tools/kunit/.
2309 Test the kernel's module loading mechanism: kmod. kmod implements
2310 support to load modules using the Linux kernel's usermode helper.
2314 into the kernel we disallow building it into the kernel since
2321 tools/testing/selftests/kmod/kmod.sh --help
2329 Test the kernel's ability to detect incorrect calls to
2330 virt_to_phys() done against the non-linear part of the
2331 kernel's virtual address map.
2350 Test kernel livepatching features for correctness. The tests will
2351 load test modules that will be livepatched in various scenarios.
2355 make -C tools/testing/selftests TARGETS=livepatch run_tests
2359 tools/testing/selftests/livepatch/test-callbacks.sh
2360 tools/testing/selftests/livepatch/test-livepatch.sh
2361 tools/testing/selftests/livepatch/test-shadow-vars.sh
2377 Test if the kernel is zero-initializing stack variables and
2387 Test if the kernel is zero-initializing heap and page allocations.
2401 Doing so will allow you to run tools/testing/selftest/vm/hmm-tests.
2410 Loading this module is safe if your kernel has the bug fixed.
2415 tristate "Test floating point operations in kernel space"
2418 Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu
2420 for self-testing floating point control register setting in
2430 This option adds a kernel parameter 'memtest', which allows memtest
2432 memtest=0, mean disabled; -- default
2441 bool "Microsoft Hyper-V driver testing"
2445 Select this option to enable Hyper-V vmbus testing.
2447 endmenu # "Kernel Testing and Coverage"
2451 endmenu # Kernel hacking