Kconfig.debug 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. menu "Kernel hacking"
  2. source "lib/Kconfig.debug"
  3. config HAVE_ARCH_KGDB
  4. def_bool y
  5. config DEBUG_VERBOSE
  6. bool "Verbose fault messages"
  7. default y
  8. select PRINTK
  9. help
  10. When a program crashes due to an exception, or the kernel detects
  11. an internal error, the kernel can print a not so brief message
  12. explaining what the problem was. This debugging information is
  13. useful to developers and kernel hackers when tracking down problems,
  14. but mostly meaningless to other people. This is always helpful for
  15. debugging but serves no purpose on a production system.
  16. Most people should say N here.
  17. config DEBUG_MMRS
  18. bool "Generate Blackfin MMR tree"
  19. select DEBUG_FS
  20. help
  21. Create a tree of Blackfin MMRs via the debugfs tree. If
  22. you enable this, you will find all MMRs laid out in the
  23. /sys/kernel/debug/blackfin/ directory where you can read/write
  24. MMRs directly from userspace. This is obviously just a debug
  25. feature.
  26. config DEBUG_HWERR
  27. bool "Hardware error interrupt debugging"
  28. depends on DEBUG_KERNEL
  29. help
  30. When enabled, the hardware error interrupt is never disabled, and
  31. will happen immediately when an error condition occurs. This comes
  32. at a slight cost in code size, but is necessary if you are getting
  33. hardware error interrupts and need to know where they are coming
  34. from.
  35. config DEBUG_DOUBLEFAULT
  36. bool "Debug Double Faults"
  37. default n
  38. help
  39. If an exception is caused while executing code within the exception
  40. handler, the NMI handler, the reset vector, or in emulator mode,
  41. a double fault occurs. On the Blackfin, this is a unrecoverable
  42. event. You have two options:
  43. - RESET exactly when double fault occurs. The excepting
  44. instruction address is stored in RETX, where the next kernel
  45. boot will print it out.
  46. - Print debug message. This is much more error prone, although
  47. easier to handle. It is error prone since:
  48. - The excepting instruction is not committed.
  49. - All writebacks from the instruction are prevented.
  50. - The generated exception is not taken.
  51. - The EXCAUSE field is updated with an unrecoverable event
  52. The only way to check this is to see if EXCAUSE contains the
  53. unrecoverable event value at every exception return. By selecting
  54. this option, you are skipping over the faulting instruction, and
  55. hoping things stay together enough to print out a debug message.
  56. This does add a little kernel code, but is the only method to debug
  57. double faults - if unsure say "Y"
  58. choice
  59. prompt "Double Fault Failure Method"
  60. default DEBUG_DOUBLEFAULT_PRINT
  61. depends on DEBUG_DOUBLEFAULT
  62. config DEBUG_DOUBLEFAULT_PRINT
  63. bool "Print"
  64. config DEBUG_DOUBLEFAULT_RESET
  65. bool "Reset"
  66. endchoice
  67. config DEBUG_ICACHE_CHECK
  68. bool "Check Instruction cache coherency"
  69. depends on DEBUG_KERNEL
  70. depends on DEBUG_HWERR
  71. help
  72. Say Y here if you are getting weird unexplained errors. This will
  73. ensure that icache is what SDRAM says it should be by doing a
  74. byte wise comparison between SDRAM and instruction cache. This
  75. also relocates the irq_panic() function to L1 memory, (which is
  76. un-cached).
  77. config DEBUG_HUNT_FOR_ZERO
  78. bool "Catch NULL pointer reads/writes"
  79. default y
  80. help
  81. Say Y here to catch reads/writes to anywhere in the memory range
  82. from 0x0000 - 0x0FFF (the first 4k) of memory. This is useful in
  83. catching common programming errors such as NULL pointer dereferences.
  84. Misbehaving applications will be killed (generate a SEGV) while the
  85. kernel will trigger a panic.
  86. Enabling this option will take up an extra entry in CPLB table.
  87. Otherwise, there is no extra overhead.
  88. config DEBUG_BFIN_HWTRACE_ON
  89. bool "Turn on Blackfin's Hardware Trace"
  90. default y
  91. help
  92. All Blackfins include a Trace Unit which stores a history of the last
  93. 16 changes in program flow taken by the program sequencer. The history
  94. allows the user to recreate the program sequencer’s recent path. This
  95. can be handy when an application dies - we print out the execution
  96. path of how it got to the offending instruction.
  97. By turning this off, you may save a tiny amount of power.
  98. choice
  99. prompt "Omit loop Tracing"
  100. default DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
  101. depends on DEBUG_BFIN_HWTRACE_ON
  102. help
  103. The trace buffer can be configured to omit recording of changes in
  104. program flow that match either the last entry or one of the last
  105. two entries. Omitting one of these entries from the record prevents
  106. the trace buffer from overflowing because of any sort of loop (for, do
  107. while, etc) in the program.
  108. Because zero-overhead Hardware loops are not recorded in the trace buffer,
  109. this feature can be used to prevent trace overflow from loops that
  110. are nested four deep.
  111. config DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
  112. bool "Trace all Loops"
  113. help
  114. The trace buffer records all changes of flow
  115. config DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
  116. bool "Compress single-level loops"
  117. help
  118. The trace buffer does not record single loops - helpful if trace
  119. is spinning on a while or do loop.
  120. config DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
  121. bool "Compress two-level loops"
  122. help
  123. The trace buffer does not record loops two levels deep. Helpful if
  124. the trace is spinning in a nested loop
  125. endchoice
  126. config DEBUG_BFIN_HWTRACE_COMPRESSION
  127. int
  128. depends on DEBUG_BFIN_HWTRACE_ON
  129. default 0 if DEBUG_BFIN_HWTRACE_COMPRESSION_OFF
  130. default 1 if DEBUG_BFIN_HWTRACE_COMPRESSION_ONE
  131. default 2 if DEBUG_BFIN_HWTRACE_COMPRESSION_TWO
  132. config DEBUG_BFIN_HWTRACE_EXPAND
  133. bool "Expand Trace Buffer greater than 16 entries"
  134. depends on DEBUG_BFIN_HWTRACE_ON
  135. default n
  136. help
  137. By selecting this option, every time the 16 hardware entries in
  138. the Blackfin's HW Trace buffer are full, the kernel will move them
  139. into a software buffer, for dumping when there is an issue. This
  140. has a great impact on performance, (an interrupt every 16 change of
  141. flows) and should normally be turned off, except in those nasty
  142. debugging sessions
  143. config DEBUG_BFIN_HWTRACE_EXPAND_LEN
  144. int "Size of Trace buffer (in power of 2k)"
  145. range 0 4
  146. depends on DEBUG_BFIN_HWTRACE_EXPAND
  147. default 1
  148. help
  149. This sets the size of the software buffer that the trace information
  150. is kept in.
  151. 0 for (2^0) 1k, or 256 entries,
  152. 1 for (2^1) 2k, or 512 entries,
  153. 2 for (2^2) 4k, or 1024 entries,
  154. 3 for (2^3) 8k, or 2048 entries,
  155. 4 for (2^4) 16k, or 4096 entries
  156. config DEBUG_BFIN_NO_KERN_HWTRACE
  157. bool "Trace user apps (turn off hwtrace in kernel)"
  158. depends on DEBUG_BFIN_HWTRACE_ON
  159. default n
  160. help
  161. Some pieces of the kernel contain a lot of flow changes which can
  162. quickly fill up the hardware trace buffer. When debugging crashes,
  163. the hardware trace may indicate that the problem lies in kernel
  164. space when in reality an application is buggy.
  165. Say Y here to disable hardware tracing in some known "jumpy" pieces
  166. of code so that the trace buffer will extend further back.
  167. config EARLY_PRINTK
  168. bool "Early printk"
  169. default n
  170. select SERIAL_CORE_CONSOLE
  171. help
  172. This option enables special console drivers which allow the kernel
  173. to print messages very early in the bootup process.
  174. This is useful for kernel debugging when your machine crashes very
  175. early before the console code is initialized. After enabling this
  176. feature, you must add "earlyprintk=serial,uart0,57600" to the
  177. command line (bootargs). It is safe to say Y here in all cases, as
  178. all of this lives in the init section and is thrown away after the
  179. kernel boots completely.
  180. config CPLB_INFO
  181. bool "Display the CPLB information"
  182. help
  183. Display the CPLB information via /proc/cplbinfo.
  184. config ACCESS_CHECK
  185. bool "Check the user pointer address"
  186. default y
  187. help
  188. Usually the pointer transfer from user space is checked to see if its
  189. address is in the kernel space.
  190. Say N here to disable that check to improve the performance.
  191. endmenu