Kconfig.debug 7.2 KB

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