sys: add conf/std.debug, generic debugging options

The new sys/conf/std.debug contains the list of debugging options
enabled by default in -CURRENT, so they don't need to be listed
individually in every kernel config.

Introduce *-DEBUG variants of the major kernel configs.

(cherry picked and modified from commit 4f8f9d708e)

Reviewed by:	markj, imp, olce (previous version)
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D46871
This commit is contained in:
Kristof Provost 2024-04-23 15:11:24 -06:00
parent 342240c6e0
commit 0d4081ed69
11 changed files with 121 additions and 0 deletions

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/amd64
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG

View file

@ -0,0 +1,9 @@
#
# MINIMAL-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/amd64
#
include MINIMAL
include "std.debug"
ident MINIMAL-DEBUG

View file

@ -153,3 +153,14 @@ options KSTACK_PAGES=5
# Enable detailed accounting by the PV entry allocator.
options PV_STATS
#####################################################################
# Kernel sanitizers
#options COVERAGE # Generic kernel coverage. Used by KCOV
#options KCOV # Kernel Coverage Sanitizer
# Warning: KUBSAN can result in a kernel too large for loader to load
#options KUBSAN # Kernel Undefined Behavior Sanitizer
#options KCSAN # Kernel Concurrency Sanitizer
#options KASAN # Kernel Address Sanitizer
#options KMSAN # Kernel Memory Sanitizer

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/ARMv6
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/arm64
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG

29
sys/conf/std.debug Normal file
View file

@ -0,0 +1,29 @@
#
# std.debug -- Enable debug options for -CURRENT.
#
options BUF_TRACKING # Track buffer history
#options FULL_BUF_TRACKING # Track more buffer history
options DDB # Support DDB.
options FULL_BUF_TRACKING # Track more buffer history
options GDB # Support remote GDB.
options DEADLKRES # Enable the deadlock resolver
options INVARIANTS # Enable calls of extra sanity checking
options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
options QUEUE_MACRO_DEBUG_TRASH # Trash queue(2) internal pointers on invalidation
options WITNESS # Enable checks to detect deadlocks and cycles
options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed
options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default
options ALT_BREAK_TO_DEBUGGER # Enter debugger on keyboard escape sequence
#options DEBUG_VFS_LOCKS
# Net80211 debugging
options IEEE80211_DEBUG
# USB debugging
options USB_DEBUG
options HID_DEBUG
# CAM debugging
options CAMDEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/i386
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/powerpc
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/powerpc64
#
include GENERIC64
include "std.debug"
ident GENERIC64-DEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/powerpc64le
#
include GENERIC64LE
include "std.debug"
ident GENERIC64LE-DEBUG

View file

@ -0,0 +1,9 @@
#
# GENERIC-DEBUG -- WITNESS and INVARIANTS enabled kernel configuration file
# for FreeBSD/RISC-V
#
include GENERIC
include "std.debug"
ident GENERIC-DEBUG