1 #ifndef KERNEL_DEBUG_CONFIG_H 2 #define KERNEL_DEBUG_CONFIG_H 3 4 // Master switch: 5 // 0: Disables all debug code that hasn't been enabled otherwise. 6 // 1: Enables some lightweight debug code. 7 // 2: Enables more debug code. Will impact performance. 8 #define KDEBUG_LEVEL 2 9 10 #define KDEBUG_LEVEL_2 (KDEBUG_LEVEL >= 2) 11 #define KDEBUG_LEVEL_1 (KDEBUG_LEVEL >= 1) 12 #define KDEBUG_LEVEL_0 (KDEBUG_LEVEL >= 0) 13 14 15 // general kernel debugging 16 17 // Enables kernel ASSERT()s and various checks, locking primitives aren't 18 // benaphore-style. 19 #define KDEBUG KDEBUG_LEVEL_2 20 21 // Size of the heap used by the kernel debugger. 22 #define KDEBUG_HEAP (64 * 1024) 23 24 // Set to 0 to disable support for kernel breakpoints. 25 #define KERNEL_BREAKPOINTS 1 26 27 28 // block/file cache 29 30 // Enables debugger commands. 31 #define DEBUG_BLOCK_CACHE KDEBUG_LEVEL_1 32 33 // Enables checks that non-dirty blocks really aren't changed. Seriously 34 // degrades performance when the block cache is used heavily. 35 #define BLOCK_CACHE_DEBUG_CHANGED KDEBUG_LEVEL_2 36 37 // Enables a global list of file maps and related debugger commands. 38 #define DEBUG_FILE_MAP KDEBUG_LEVEL_1 39 40 41 // heap 42 43 // Initialize newly allocated memory with something non zero. 44 #define PARANOID_KERNEL_MALLOC KDEBUG_LEVEL_2 45 46 // Check for double free, and fill freed memory with 0xdeadbeef. 47 #define PARANOID_KERNEL_FREE KDEBUG_LEVEL_2 48 49 // Validate sanity of the heap after each operation (slow!). 50 #define PARANOID_HEAP_VALIDATION 0 51 52 // Store size, thread and team info at the end of each allocation block. 53 // Enables the "allocations*" debugger commands. 54 #define KERNEL_HEAP_LEAK_CHECK 0 55 56 57 // interrupts 58 59 // Adds statistics and unhandled counter per interrupts. Enables the "ints" 60 // debugger command. 61 #define DEBUG_INTERRUPTS KDEBUG_LEVEL_1 62 63 64 // semaphores 65 66 // Enables tracking of the last threads that acquired/released a semaphore. 67 #define DEBUG_SEM_LAST_ACQUIRER KDEBUG_LEVEL_1 68 69 70 // SMP 71 72 // Enables spinlock caller debugging. When acquiring a spinlock twice on a 73 // non-SMP machine, this will give a clue who locked it the first time. 74 // Furthermore (also on SMP machines) the "spinlock" debugger command will be 75 // available. 76 #define DEBUG_SPINLOCKS KDEBUG_LEVEL_2 77 78 #define DEBUG_SPINLOCK_LATENCIES 0 79 80 81 // VM 82 83 // Enables the vm_page::queue field, i.e. it is tracked which queue the page 84 // should be in. 85 #define DEBUG_PAGE_QUEUE 0 86 87 // Enables the vm_page::access_count field, which is used to detect invalid 88 // concurrent access to the page. 89 #define DEBUG_PAGE_ACCESS KDEBUG_LEVEL_2 90 91 // Enables a global list of all vm_cache structures. 92 #define DEBUG_CACHE_LIST KDEBUG_LEVEL_1 93 94 // Enables swap support. 95 #define ENABLE_SWAP_SUPPORT 1 96 97 // When set limits the amount of available RAM (in MB). 98 //#define LIMIT_AVAILABLE_MEMORY 256 99 100 101 #endif // KERNEL_DEBUG_CONFIG_H 102