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