xref: /haiku/build/config_headers/kernel_debug_config.h (revision 58481f0f6ef1a61ba07283f012cafbc2ed874ead)
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 // Set to 0 to disable support for kernel breakpoints.
22 #define KERNEL_BREAKPOINTS				1
23 
24 
25 // block/file cache
26 
27 // Enables debugger commands.
28 #define DEBUG_BLOCK_CACHE				KDEBUG_LEVEL_1
29 
30 // Enables checks that non-dirty blocks really aren't changed. Seriously
31 // degrades performance when the block cache is used heavily.
32 #define BLOCK_CACHE_DEBUG_CHANGED		KDEBUG_LEVEL_2
33 
34 // Enables a global list of file maps and related debugger commands.
35 #define DEBUG_FILE_MAP					KDEBUG_LEVEL_1
36 
37 
38 // heap
39 
40 // Initialize newly allocated memory with something non zero.
41 #define PARANOID_KERNEL_MALLOC			KDEBUG_LEVEL_2
42 
43 // Check for double free, and fill freed memory with 0xdeadbeef.
44 #define PARANOID_KERNEL_FREE			KDEBUG_LEVEL_2
45 
46 // Validate sanity of the heap after each operation (slow!).
47 #define PARANOID_HEAP_VALIDATION		0
48 
49 // Store size, thread and team info at the end of each allocation block.
50 // Enables the "allocations*" debugger commands.
51 #define KERNEL_HEAP_LEAK_CHECK			0
52 
53 
54 // interrupts
55 
56 // Adds statistics and unhandled counter per interrupts. Enables the "ints"
57 // debugger command.
58 #define DEBUG_INTERRUPTS				KDEBUG_LEVEL_1
59 
60 
61 // semaphores
62 
63 // Enables tracking of the last threads that acquired/released a semaphore.
64 #define DEBUG_SEM_LAST_ACQUIRER			KDEBUG_LEVEL_1
65 
66 
67 // SMP
68 
69 // Enables spinlock caller debugging. When acquiring a spinlock twice on a
70 // non-SMP machine, this will give a clue who locked it the first time.
71 // Furthermore (also on SMP machines) the "spinlock" debugger command will be
72 // available.
73 #define DEBUG_SPINLOCKS					KDEBUG_LEVEL_2
74 
75 
76 // VM
77 
78 // Enables the vm_page::queue, i.e. it is tracked which queue the page should
79 // be in.
80 #define DEBUG_PAGE_QUEUE				0
81 
82 // Enables extra debug fields in the vm_page used to track page transitions
83 // between caches.
84 #define DEBUG_PAGE_CACHE_TRANSITIONS	0
85 
86 // Enables a global list of all vm_cache structures.
87 #define DEBUG_CACHE_LIST				KDEBUG_LEVEL_1
88 
89 // Enables swap support.
90 #define ENABLE_SWAP_SUPPORT				1
91 
92 // When set limits the amount of available RAM (in MB).
93 //#define LIMIT_AVAILABLE_MEMORY	256
94 
95 
96 #endif	// KERNEL_DEBUG_CONFIG_H
97