| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 1 | menu "Kernel hacking" | 
 | 2 |  | 
 | 3 | source "lib/Kconfig.debug" | 
 | 4 |  | 
| Robin Getz | a45d575 | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 5 | config DEBUG_STACKOVERFLOW | 
 | 6 | 	bool "Check for stack overflows" | 
 | 7 | 	depends on DEBUG_KERNEL | 
 | 8 | 	help | 
 | 9 | 	  This option will cause messages to be printed if free stack space | 
 | 10 | 	  drops below a certain limit. | 
 | 11 |  | 
 | 12 | config DEBUG_STACK_USAGE | 
 | 13 | 	bool "Enable stack utilization instrumentation" | 
 | 14 | 	depends on DEBUG_KERNEL | 
 | 15 | 	help | 
 | 16 | 	  Enables the display of the minimum amount of free stack which each | 
 | 17 | 	  task has ever had available in the sysrq-T output. | 
 | 18 |  | 
 | 19 | 	  This option will slow down process creation somewhat. | 
 | 20 |  | 
| Robin Getz | 9f06c38 | 2008-10-10 18:13:21 +0800 | [diff] [blame] | 21 | config DEBUG_VERBOSE | 
 | 22 | 	bool "Verbose fault messages" | 
 | 23 | 	default y | 
 | 24 | 	select PRINTK | 
 | 25 | 	help | 
 | 26 | 	  When a program crashes due to an exception, or the kernel detects | 
 | 27 | 	  an internal error, the kernel can print a not so brief message | 
 | 28 | 	  explaining what the problem was. This debugging information is | 
 | 29 | 	  useful to developers and kernel hackers when tracking down problems, | 
 | 30 | 	  but mostly meaningless to other people. This is always helpful for | 
 | 31 | 	  debugging but serves no purpose on a production system. | 
 | 32 | 	  Most people should say N here. | 
 | 33 |  | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 34 | config DEBUG_MMRS | 
 | 35 | 	bool "Generate Blackfin MMR tree" | 
 | 36 | 	select DEBUG_FS | 
 | 37 | 	help | 
 | 38 | 	  Create a tree of Blackfin MMRs via the debugfs tree.  If | 
 | 39 | 	  you enable this, you will find all MMRs laid out in the | 
 | 40 | 	  /sys/kernel/debug/blackfin/ directory where you can read/write | 
 | 41 | 	  MMRs directly from userspace.  This is obviously just a debug | 
 | 42 | 	  feature. | 
 | 43 |  | 
 | 44 | config DEBUG_HWERR | 
 | 45 | 	bool "Hardware error interrupt debugging" | 
 | 46 | 	depends on DEBUG_KERNEL | 
 | 47 | 	help | 
 | 48 | 	  When enabled, the hardware error interrupt is never disabled, and | 
 | 49 | 	  will happen immediately when an error condition occurs.  This comes | 
 | 50 | 	  at a slight cost in code size, but is necessary if you are getting | 
 | 51 | 	  hardware error interrupts and need to know where they are coming | 
 | 52 | 	  from. | 
 | 53 |  | 
| Robin Getz | b9a3899 | 2009-05-18 18:33:26 +0000 | [diff] [blame] | 54 | config EXACT_HWERR | 
 | 55 | 	bool "Try to make Hardware errors exact" | 
 | 56 | 	depends on DEBUG_HWERR | 
 | 57 | 	help | 
 | 58 | 	  By default, the Blackfin hardware errors are not exact - the error | 
 | 59 |           be reported multiple cycles after the error happens. This delay | 
 | 60 | 	  can cause the wrong application, or even the kernel to receive a | 
 | 61 | 	  signal to be killed. If you are getting HW errors in your system, | 
 | 62 | 	  try turning this on to ensure they are at least comming from the | 
 | 63 | 	  proper thread. | 
 | 64 |  | 
 | 65 | 	  On production systems, it is safe (and a small optimization) to say N. | 
 | 66 |  | 
| Robin Getz | 0c7a6b2 | 2008-10-08 16:27:12 +0800 | [diff] [blame] | 67 | config DEBUG_DOUBLEFAULT | 
 | 68 | 	bool "Debug Double Faults" | 
 | 69 | 	default n | 
 | 70 | 	help | 
 | 71 | 	  If an exception is caused while executing code within the exception | 
 | 72 | 	  handler, the NMI handler, the reset vector, or in emulator mode, | 
 | 73 | 	  a double fault occurs. On the Blackfin, this is a unrecoverable | 
 | 74 | 	  event. You have two options: | 
 | 75 | 	  - RESET exactly when double fault occurs. The excepting | 
 | 76 | 	    instruction address is stored in RETX, where the next kernel | 
 | 77 | 	    boot will print it out. | 
 | 78 | 	  - Print debug message. This is much more error prone, although | 
 | 79 | 	    easier to handle. It is error prone since: | 
 | 80 | 	    - The excepting instruction is not committed. | 
 | 81 | 	    - All writebacks from the instruction are prevented. | 
 | 82 | 	    - The generated exception is not taken. | 
 | 83 | 	    - The EXCAUSE field is updated with an unrecoverable event | 
 | 84 | 	    The only way to check this is to see if EXCAUSE contains the | 
 | 85 | 	    unrecoverable event value at every exception return. By selecting | 
 | 86 | 	    this option, you are skipping over the faulting instruction, and  | 
 | 87 | 	    hoping things stay together enough to print out a debug message. | 
 | 88 |  | 
 | 89 | 	  This does add a little kernel code, but is the only method to debug | 
 | 90 | 	  double faults - if unsure say "Y" | 
 | 91 |  | 
 | 92 | choice | 
 | 93 | 	prompt "Double Fault Failure Method" | 
 | 94 | 	default DEBUG_DOUBLEFAULT_PRINT | 
 | 95 | 	depends on DEBUG_DOUBLEFAULT | 
 | 96 |  | 
 | 97 | config DEBUG_DOUBLEFAULT_PRINT | 
 | 98 | 	bool "Print" | 
 | 99 |  | 
 | 100 | config DEBUG_DOUBLEFAULT_RESET | 
 | 101 | 	bool "Reset" | 
 | 102 |  | 
 | 103 | endchoice | 
 | 104 |  | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 105 | config DEBUG_HUNT_FOR_ZERO | 
 | 106 | 	bool "Catch NULL pointer reads/writes" | 
 | 107 | 	default y | 
 | 108 | 	help | 
 | 109 | 	  Say Y here to catch reads/writes to anywhere in the memory range | 
 | 110 | 	  from 0x0000 - 0x0FFF (the first 4k) of memory.  This is useful in | 
 | 111 | 	  catching common programming errors such as NULL pointer dereferences. | 
 | 112 |  | 
 | 113 | 	  Misbehaving applications will be killed (generate a SEGV) while the | 
 | 114 | 	  kernel will trigger a panic. | 
 | 115 |  | 
 | 116 | 	  Enabling this option will take up an extra entry in CPLB table. | 
 | 117 | 	  Otherwise, there is no extra overhead. | 
 | 118 |  | 
 | 119 | config DEBUG_BFIN_HWTRACE_ON | 
 | 120 | 	bool "Turn on Blackfin's Hardware Trace" | 
 | 121 | 	default y | 
 | 122 | 	help | 
 | 123 | 	  All Blackfins include a Trace Unit which stores a history of the last | 
 | 124 | 	  16 changes in program flow taken by the program sequencer. The history | 
 | 125 | 	  allows the user to recreate the program sequencer’s recent path. This | 
 | 126 | 	  can be handy when an application dies - we print out the execution | 
 | 127 | 	  path of how it got to the offending instruction. | 
 | 128 |  | 
 | 129 | 	  By turning this off, you may save a tiny amount of power. | 
 | 130 |  | 
 | 131 | choice | 
 | 132 | 	prompt "Omit loop Tracing" | 
 | 133 | 	default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | 
 | 134 | 	depends on DEBUG_BFIN_HWTRACE_ON | 
 | 135 | 	help | 
 | 136 | 	  The trace buffer can be configured to omit recording of changes in | 
 | 137 | 	  program flow that match either the last entry or one of the last | 
 | 138 | 	  two entries. Omitting one of these entries from the record prevents | 
 | 139 | 	  the trace buffer from overflowing because of any sort of loop (for, do | 
 | 140 | 	  while, etc) in the program. | 
 | 141 |  | 
 | 142 | 	  Because zero-overhead Hardware loops are not recorded in the trace buffer, | 
 | 143 | 	  this feature can be used to prevent trace overflow from loops that | 
 | 144 | 	  are nested four deep. | 
 | 145 |  | 
 | 146 | config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | 
 | 147 | 	bool "Trace all Loops" | 
 | 148 | 	help | 
 | 149 | 	  The trace buffer records all changes of flow  | 
 | 150 |  | 
 | 151 | config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE | 
 | 152 | 	bool "Compress single-level loops" | 
 | 153 | 	help | 
 | 154 | 	  The trace buffer does not record single loops - helpful if trace  | 
 | 155 | 	  is spinning on a while or do loop. | 
 | 156 |  | 
 | 157 | config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO | 
 | 158 | 	bool "Compress two-level loops" | 
 | 159 | 	help | 
 | 160 | 	  The trace buffer does not record loops two levels deep. Helpful if | 
 | 161 | 	  the trace is spinning in a nested loop | 
 | 162 |  | 
 | 163 | endchoice | 
 | 164 |  | 
 | 165 | config DEBUG_BFIN_HWTRACE_COMPRESSION | 
 | 166 | 	int | 
 | 167 | 	depends on DEBUG_BFIN_HWTRACE_ON | 
 | 168 | 	default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF | 
 | 169 | 	default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE | 
 | 170 | 	default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO | 
 | 171 |  | 
 | 172 |  | 
 | 173 | config DEBUG_BFIN_HWTRACE_EXPAND | 
 | 174 | 	bool "Expand Trace Buffer greater than 16 entries" | 
 | 175 | 	depends on DEBUG_BFIN_HWTRACE_ON | 
 | 176 | 	default n | 
 | 177 | 	help | 
 | 178 | 	  By selecting this option, every time the 16 hardware entries in | 
 | 179 | 	  the Blackfin's HW Trace buffer are full, the kernel will move them | 
 | 180 | 	  into a software buffer, for dumping when there is an issue. This  | 
 | 181 | 	  has a great impact on performance, (an interrupt every 16 change of  | 
 | 182 | 	  flows) and should normally be turned off, except in those nasty | 
 | 183 | 	  debugging sessions | 
 | 184 |  | 
 | 185 | config DEBUG_BFIN_HWTRACE_EXPAND_LEN | 
 | 186 | 	int "Size of Trace buffer (in power of 2k)" | 
 | 187 | 	range 0 4 | 
 | 188 | 	depends on DEBUG_BFIN_HWTRACE_EXPAND | 
 | 189 | 	default 1 | 
 | 190 | 	help | 
 | 191 | 	  This sets the size of the software buffer that the trace information | 
 | 192 | 	  is kept in. | 
 | 193 | 	  0 for (2^0)  1k, or 256 entries, | 
 | 194 | 	  1 for (2^1)  2k, or 512 entries, | 
 | 195 | 	  2 for (2^2)  4k, or 1024 entries, | 
 | 196 | 	  3 for (2^3)  8k, or 2048 entries, | 
 | 197 | 	  4 for (2^4) 16k, or 4096 entries | 
 | 198 |  | 
 | 199 | config DEBUG_BFIN_NO_KERN_HWTRACE | 
| Mike Frysinger | e60cb8a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 200 | 	bool "Turn off hwtrace in CPLB handlers" | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 201 | 	depends on DEBUG_BFIN_HWTRACE_ON | 
| Mike Frysinger | e60cb8a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 202 | 	default y | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 203 | 	help | 
| Mike Frysinger | e60cb8a | 2009-01-07 23:14:38 +0800 | [diff] [blame] | 204 | 	  The CPLB error handler contains a lot of flow changes which can | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 205 | 	  quickly fill up the hardware trace buffer.  When debugging crashes, | 
 | 206 | 	  the hardware trace may indicate that the problem lies in kernel | 
 | 207 | 	  space when in reality an application is buggy. | 
 | 208 |  | 
 | 209 | 	  Say Y here to disable hardware tracing in some known "jumpy" pieces | 
 | 210 | 	  of code so that the trace buffer will extend further back. | 
 | 211 |  | 
 | 212 | config EARLY_PRINTK | 
 | 213 | 	bool "Early printk"  | 
 | 214 | 	default n | 
| Sonic Zhang | 0cfbb32 | 2008-10-09 17:39:37 +0800 | [diff] [blame] | 215 | 	select SERIAL_CORE_CONSOLE | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 216 | 	help | 
 | 217 | 	  This option enables special console drivers which allow the kernel | 
 | 218 | 	  to print messages very early in the bootup process. | 
 | 219 |  | 
 | 220 | 	  This is useful for kernel debugging when your machine crashes very | 
 | 221 | 	  early before the console code is initialized. After enabling this | 
 | 222 | 	  feature, you must add "earlyprintk=serial,uart0,57600" to the | 
 | 223 | 	  command line (bootargs). It is safe to say Y here in all cases, as | 
 | 224 | 	  all of this lives in the init section and is thrown away after the | 
 | 225 | 	  kernel boots completely. | 
 | 226 |  | 
| Graf Yang | 60ffdb3 | 2010-01-20 10:56:24 +0000 | [diff] [blame] | 227 | config NMI_WATCHDOG | 
 | 228 | 	bool "Enable NMI watchdog to help debugging lockup on SMP" | 
 | 229 | 	default n | 
| Graf Yang | c429886 | 2010-03-17 09:00:32 +0000 | [diff] [blame] | 230 | 	depends on SMP | 
| Graf Yang | 60ffdb3 | 2010-01-20 10:56:24 +0000 | [diff] [blame] | 231 | 	help | 
 | 232 | 	  If any CPU in the system does not execute the period local timer | 
 | 233 | 	  interrupt for more than 5 seconds, then the NMI handler dumps debug | 
 | 234 | 	  information. This information can be used to debug the lockup. | 
 | 235 |  | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 236 | config CPLB_INFO | 
 | 237 | 	bool "Display the CPLB information" | 
 | 238 | 	help | 
| Mike Frysinger | cf93425 | 2008-02-02 15:32:40 +0800 | [diff] [blame] | 239 | 	  Display the CPLB information via /proc/cplbinfo. | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 240 |  | 
 | 241 | config ACCESS_CHECK | 
 | 242 | 	bool "Check the user pointer address" | 
 | 243 | 	default y | 
 | 244 | 	help | 
 | 245 | 	  Usually the pointer transfer from user space is checked to see if its | 
 | 246 | 	  address is in the kernel space. | 
 | 247 |  | 
 | 248 | 	  Say N here to disable that check to improve the performance. | 
 | 249 |  | 
| Mike Frysinger | c40cdb2 | 2009-08-27 01:46:48 +0000 | [diff] [blame] | 250 | config BFIN_ISRAM_SELF_TEST | 
 | 251 | 	bool "isram boot self tests" | 
 | 252 | 	default n | 
 | 253 | 	help | 
 | 254 | 	  Run some self tests of the isram driver code at boot. | 
 | 255 |  | 
| Robin Getz | 6ce3e9c | 2010-03-16 14:40:17 +0000 | [diff] [blame] | 256 | config BFIN_PSEUDODBG_INSNS | 
 | 257 | 	bool "Support pseudo debug instructions" | 
 | 258 | 	default n | 
 | 259 | 	help | 
 | 260 | 	  This option allows the kernel to emulate some pseudo instructions which | 
 | 261 | 	  allow simulator test cases to be run under Linux with no changes. | 
 | 262 |  | 
 | 263 | 	  Most people should say N here. | 
 | 264 |  | 
| Mike Frysinger | 74ce832 | 2007-11-21 23:50:49 +0800 | [diff] [blame] | 265 | endmenu |