Kconfig.debug 117 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. menu "Kernel hacking"
  3. menu "printk and dmesg options"
  4. config PRINTK_TIME
  5. bool "Show timing information on printks"
  6. depends on PRINTK
  7. help
  8. Selecting this option causes time stamps of the printk()
  9. messages to be added to the output of the syslog() system
  10. call and at the console.
  11. The timestamp is always recorded internally, and exported
  12. to /dev/kmsg. This flag just specifies if the timestamp should
  13. be included, not that the timestamp is recorded.
  14. The behavior is also controlled by the kernel command line
  15. parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
  16. config PRINTK_CALLER
  17. bool "Show caller information on printks"
  18. depends on PRINTK
  19. help
  20. Selecting this option causes printk() to add a caller "thread id" (if
  21. in task context) or a caller "processor id" (if not in task context)
  22. to every message.
  23. This option is intended for environments where multiple threads
  24. concurrently call printk() for many times, for it is difficult to
  25. interpret without knowing where these lines (or sometimes individual
  26. line which was divided into multiple lines due to race) came from.
  27. Since toggling after boot makes the code racy, currently there is
  28. no option to enable/disable at the kernel command line parameter or
  29. sysfs interface.
  30. config PRINTK_EXECUTION_CTX
  31. bool
  32. depends on PRINTK
  33. help
  34. This option extends struct printk_info to include extra execution
  35. context in printk, such as task name and CPU number from where the
  36. message originated. This is useful for correlating printk messages
  37. with specific execution contexts.
  38. This is automatically enabled when a console driver that supports
  39. execution context is selected.
  40. config STACKTRACE_BUILD_ID
  41. bool "Show build ID information in stacktraces"
  42. depends on PRINTK
  43. help
  44. Selecting this option adds build ID information for symbols in
  45. stacktraces printed with the printk format '%p[SR]b'.
  46. This option is intended for distros where debuginfo is not easily
  47. accessible but can be downloaded given the build ID of the vmlinux or
  48. kernel module where the function is located.
  49. config CONSOLE_LOGLEVEL_DEFAULT
  50. int "Default console loglevel (1-15)"
  51. range 1 15
  52. default "7"
  53. help
  54. Default loglevel to determine what will be printed on the console.
  55. Setting a default here is equivalent to passing in loglevel=<x> in
  56. the kernel bootargs. loglevel=<x> continues to override whatever
  57. value is specified here as well.
  58. Note: This does not affect the log level of un-prefixed printk()
  59. usage in the kernel. That is controlled by the MESSAGE_LOGLEVEL_DEFAULT
  60. option.
  61. config CONSOLE_LOGLEVEL_QUIET
  62. int "quiet console loglevel (1-15)"
  63. range 1 15
  64. default "4"
  65. help
  66. loglevel to use when "quiet" is passed on the kernel commandline.
  67. When "quiet" is passed on the kernel commandline this loglevel
  68. will be used as the loglevel. IOW passing "quiet" will be the
  69. equivalent of passing "loglevel=<CONSOLE_LOGLEVEL_QUIET>"
  70. config MESSAGE_LOGLEVEL_DEFAULT
  71. int "Default message log level (1-7)"
  72. range 1 7
  73. default "4"
  74. help
  75. Default log level for printk statements with no specified priority.
  76. This was hard-coded to KERN_WARNING since at least 2.6.10 but folks
  77. that are auditing their logs closely may want to set it to a lower
  78. priority.
  79. Note: This does not affect what message level gets printed on the console
  80. by default. To change that, use loglevel=<x> in the kernel bootargs,
  81. or pick a different CONSOLE_LOGLEVEL_DEFAULT configuration value.
  82. config BOOT_PRINTK_DELAY
  83. bool "Delay each boot printk message by N milliseconds"
  84. depends on DEBUG_KERNEL && PRINTK && GENERIC_CALIBRATE_DELAY
  85. help
  86. This build option allows you to read kernel boot messages
  87. by inserting a short delay after each one. The delay is
  88. specified in milliseconds on the kernel command line,
  89. using "boot_delay=N".
  90. It is likely that you would also need to use "lpj=M" to preset
  91. the "loops per jiffy" value.
  92. See a previous boot log for the "lpj" value to use for your
  93. system, and then set "lpj=M" before setting "boot_delay=N".
  94. NOTE: Using this option may adversely affect SMP systems.
  95. I.e., processors other than the first one may not boot up.
  96. BOOT_PRINTK_DELAY also may cause LOCKUP_DETECTOR to detect
  97. what it believes to be lockup conditions.
  98. config DYNAMIC_DEBUG
  99. bool "Enable dynamic printk() support"
  100. default n
  101. depends on PRINTK
  102. depends on (DEBUG_FS || PROC_FS)
  103. select DYNAMIC_DEBUG_CORE
  104. help
  105. Compiles debug level messages into the kernel, which would not
  106. otherwise be available at runtime. These messages can then be
  107. enabled/disabled based on various levels of scope - per source file,
  108. function, module, format string, and line number. This mechanism
  109. implicitly compiles in all pr_debug() and dev_dbg() calls, which
  110. enlarges the kernel text size by about 2%.
  111. If a source file is compiled with DEBUG flag set, any
  112. pr_debug() calls in it are enabled by default, but can be
  113. disabled at runtime as below. Note that DEBUG flag is
  114. turned on by many CONFIG_*DEBUG* options.
  115. Usage:
  116. Dynamic debugging is controlled via the 'dynamic_debug/control' file,
  117. which is contained in the 'debugfs' filesystem or procfs.
  118. Thus, the debugfs or procfs filesystem must first be mounted before
  119. making use of this feature.
  120. We refer the control file as: <debugfs>/dynamic_debug/control. This
  121. file contains a list of the debug statements that can be enabled. The
  122. format for each line of the file is:
  123. filename:lineno [module]function flags format
  124. filename : source file of the debug statement
  125. lineno : line number of the debug statement
  126. module : module that contains the debug statement
  127. function : function that contains the debug statement
  128. flags : '=p' means the line is turned 'on' for printing
  129. format : the format used for the debug statement
  130. From a live system:
  131. nullarbor:~ # cat <debugfs>/dynamic_debug/control
  132. # filename:lineno [module]function flags format
  133. fs/aio.c:222 [aio]__put_ioctx =_ "__put_ioctx:\040freeing\040%p\012"
  134. fs/aio.c:248 [aio]ioctx_alloc =_ "ENOMEM:\040nr_events\040too\040high\012"
  135. fs/aio.c:1770 [aio]sys_io_cancel =_ "calling\040cancel\012"
  136. Example usage:
  137. // enable the message at line 1603 of file svcsock.c
  138. nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
  139. <debugfs>/dynamic_debug/control
  140. // enable all the messages in file svcsock.c
  141. nullarbor:~ # echo -n 'file svcsock.c +p' >
  142. <debugfs>/dynamic_debug/control
  143. // enable all the messages in the NFS server module
  144. nullarbor:~ # echo -n 'module nfsd +p' >
  145. <debugfs>/dynamic_debug/control
  146. // enable all 12 messages in the function svc_process()
  147. nullarbor:~ # echo -n 'func svc_process +p' >
  148. <debugfs>/dynamic_debug/control
  149. // disable all 12 messages in the function svc_process()
  150. nullarbor:~ # echo -n 'func svc_process -p' >
  151. <debugfs>/dynamic_debug/control
  152. See Documentation/admin-guide/dynamic-debug-howto.rst for additional
  153. information.
  154. config DYNAMIC_DEBUG_CORE
  155. bool "Enable core function of dynamic debug support"
  156. depends on PRINTK
  157. depends on (DEBUG_FS || PROC_FS)
  158. help
  159. Enable core functional support of dynamic debug. It is useful
  160. when you want to tie dynamic debug to your kernel modules with
  161. DYNAMIC_DEBUG_MODULE defined for each of them, especially for
  162. the case of embedded system where the kernel image size is
  163. sensitive for people.
  164. config SYMBOLIC_ERRNAME
  165. bool "Support symbolic error names in printf"
  166. default y if PRINTK
  167. help
  168. If you say Y here, the kernel's printf implementation will
  169. be able to print symbolic error names such as ENOSPC instead
  170. of the number 28. It makes the kernel image slightly larger
  171. (about 3KB), but can make the kernel logs easier to read.
  172. config DEBUG_BUGVERBOSE
  173. bool "Verbose BUG() reporting (adds 70K)" if DEBUG_KERNEL && EXPERT
  174. depends on BUG && (GENERIC_BUG || HAVE_DEBUG_BUGVERBOSE)
  175. default y
  176. help
  177. Say Y here to make BUG() panics output the file name and line number
  178. of the BUG call as well as the EIP and oops trace. This aids
  179. debugging but costs about 70-100K of memory.
  180. config DEBUG_BUGVERBOSE_DETAILED
  181. bool "Verbose WARN_ON_ONCE() reporting (adds 100K)" if DEBUG_BUGVERBOSE
  182. help
  183. Say Y here to make WARN_ON_ONCE() output the condition string of the
  184. warning, in addition to the file name and line number.
  185. This helps debugging, but costs about 100K of memory.
  186. Say N if unsure.
  187. endmenu # "printk and dmesg options"
  188. config DEBUG_KERNEL
  189. bool "Kernel debugging"
  190. help
  191. Say Y here if you are developing drivers or trying to debug and
  192. identify kernel problems.
  193. config DEBUG_MISC
  194. bool "Miscellaneous debug code"
  195. default DEBUG_KERNEL
  196. depends on DEBUG_KERNEL
  197. help
  198. Say Y here if you need to enable miscellaneous debug code that should
  199. be under a more specific debug option but isn't.
  200. menu "Compile-time checks and compiler options"
  201. config DEBUG_INFO
  202. bool
  203. help
  204. A kernel debug info option other than "None" has been selected
  205. in the "Debug information" choice below, indicating that debug
  206. information will be generated for build targets.
  207. # Clang generates .uleb128 with label differences for DWARF v5, a feature that
  208. # older binutils ports do not support when utilizing RISC-V style linker
  209. # relaxation: https://sourceware.org/bugzilla/show_bug.cgi?id=27215
  210. config AS_HAS_NON_CONST_ULEB128
  211. def_bool $(as-instr,.uleb128 .Lexpr_end4 - .Lexpr_start3\n.Lexpr_start3:\n.Lexpr_end4:)
  212. choice
  213. prompt "Debug information"
  214. depends on DEBUG_KERNEL
  215. help
  216. Selecting something other than "None" results in a kernel image
  217. that will include debugging info resulting in a larger kernel image.
  218. This adds debug symbols to the kernel and modules (gcc -g), and
  219. is needed if you intend to use kernel crashdump or binary object
  220. tools like crash, kgdb, LKCD, gdb, etc on the kernel.
  221. Choose which version of DWARF debug info to emit. If unsure,
  222. select "Toolchain default".
  223. config DEBUG_INFO_NONE
  224. bool "Disable debug information"
  225. help
  226. Do not build the kernel with debugging information, which will
  227. result in a faster and smaller build.
  228. config DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
  229. bool "Rely on the toolchain's implicit default DWARF version"
  230. select DEBUG_INFO
  231. depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
  232. help
  233. The implicit default version of DWARF debug info produced by a
  234. toolchain changes over time.
  235. This can break consumers of the debug info that haven't upgraded to
  236. support newer revisions, and prevent testing newer versions, but
  237. those should be less common scenarios.
  238. config DEBUG_INFO_DWARF4
  239. bool "Generate DWARF Version 4 debuginfo"
  240. select DEBUG_INFO
  241. depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502)
  242. help
  243. Generate DWARF v4 debug info. This requires gcc 4.5+, binutils 2.35.2
  244. if using clang without clang's integrated assembler, and gdb 7.0+.
  245. If you have consumers of DWARF debug info that are not ready for
  246. newer revisions of DWARF, you may wish to choose this or have your
  247. config select this.
  248. config DEBUG_INFO_DWARF5
  249. bool "Generate DWARF Version 5 debuginfo"
  250. select DEBUG_INFO
  251. depends on !ARCH_HAS_BROKEN_DWARF5
  252. depends on !CC_IS_CLANG || AS_IS_LLVM || (AS_IS_GNU && AS_VERSION >= 23502 && AS_HAS_NON_CONST_ULEB128)
  253. help
  254. Generate DWARF v5 debug info. Requires binutils 2.35.2, gcc 5.0+ (gcc
  255. 5.0+ accepts the -gdwarf-5 flag but only had partial support for some
  256. draft features until 7.0), and gdb 8.0+.
  257. Changes to the structure of debug info in Version 5 allow for around
  258. 15-18% savings in resulting image and debug info section sizes as
  259. compared to DWARF Version 4. DWARF Version 5 standardizes previous
  260. extensions such as accelerators for symbol indexing and the format
  261. for fission (.dwo/.dwp) files. Users may not want to select this
  262. config if they rely on tooling that has not yet been updated to
  263. support DWARF Version 5.
  264. endchoice # "Debug information"
  265. if DEBUG_INFO
  266. config DEBUG_INFO_REDUCED
  267. bool "Reduce debugging information"
  268. help
  269. If you say Y here gcc is instructed to generate less debugging
  270. information for structure types. This means that tools that
  271. need full debugging information (like kgdb or systemtap) won't
  272. be happy. But if you merely need debugging information to
  273. resolve line numbers there is no loss. Advantage is that
  274. build directory object sizes shrink dramatically over a full
  275. DEBUG_INFO build and compile times are reduced too.
  276. Only works with newer gcc versions.
  277. choice
  278. prompt "Compressed Debug information"
  279. help
  280. Compress the resulting debug info. Results in smaller debug info sections,
  281. but requires that consumers are able to decompress the results.
  282. If unsure, choose DEBUG_INFO_COMPRESSED_NONE.
  283. config DEBUG_INFO_COMPRESSED_NONE
  284. bool "Don't compress debug information"
  285. help
  286. Don't compress debug info sections.
  287. config DEBUG_INFO_COMPRESSED_ZLIB
  288. bool "Compress debugging information with zlib"
  289. depends on $(cc-option,-gz=zlib)
  290. depends on $(ld-option,--compress-debug-sections=zlib)
  291. help
  292. Compress the debug information using zlib.
  293. Users of dpkg-deb via debian/rules may find an increase in
  294. size of their debug .deb packages with this config set, due to the
  295. debug info being compressed with zlib, then the object files being
  296. recompressed with a different compression scheme. But this is still
  297. preferable to setting KDEB_COMPRESS or DPKG_DEB_COMPRESSOR_TYPE to
  298. "none" which would be even larger.
  299. config DEBUG_INFO_COMPRESSED_ZSTD
  300. bool "Compress debugging information with zstd"
  301. depends on $(cc-option,-gz=zstd)
  302. depends on $(ld-option,--compress-debug-sections=zstd)
  303. help
  304. Compress the debug information using zstd. This may provide better
  305. compression than zlib, for about the same time costs, but requires newer
  306. toolchain support. Requires GCC 13.0+ or Clang 16.0+, binutils 2.40+, and
  307. zstd.
  308. endchoice # "Compressed Debug information"
  309. config DEBUG_INFO_SPLIT
  310. bool "Produce split debuginfo in .dwo files"
  311. depends on $(cc-option,-gsplit-dwarf)
  312. # RISC-V linker relaxation + -gsplit-dwarf has issues with LLVM and GCC
  313. # prior to 12.x:
  314. # https://github.com/llvm/llvm-project/issues/56642
  315. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
  316. depends on !RISCV || GCC_VERSION >= 120000
  317. help
  318. Generate debug info into separate .dwo files. This significantly
  319. reduces the build directory size for builds with DEBUG_INFO,
  320. because it stores the information only once on disk in .dwo
  321. files instead of multiple times in object files and executables.
  322. In addition the debug information is also compressed.
  323. Requires recent gcc (4.7+) and recent gdb/binutils.
  324. Any tool that packages or reads debug information would need
  325. to know about the .dwo files and include them.
  326. Incompatible with older versions of ccache.
  327. config DEBUG_INFO_BTF
  328. bool "Generate BTF type information"
  329. depends on !DEBUG_INFO_SPLIT && !DEBUG_INFO_REDUCED
  330. depends on !GCC_PLUGIN_RANDSTRUCT || COMPILE_TEST
  331. depends on BPF_SYSCALL
  332. depends on PAHOLE_VERSION >= 122
  333. # pahole uses elfutils, which does not have support for Hexagon relocations
  334. depends on !HEXAGON
  335. help
  336. Generate deduplicated BTF type information from DWARF debug info.
  337. Turning this on requires pahole v1.22 or later, which will convert
  338. DWARF type info into equivalent deduplicated BTF type info.
  339. config PAHOLE_HAS_BTF_TAG
  340. def_bool PAHOLE_VERSION >= 123
  341. depends on CC_IS_CLANG
  342. help
  343. Decide whether pahole emits btf_tag attributes (btf_type_tag and
  344. btf_decl_tag) or not. Currently only clang compiler implements
  345. these attributes, so make the config depend on CC_IS_CLANG.
  346. config PAHOLE_HAS_LANG_EXCLUDE
  347. def_bool PAHOLE_VERSION >= 124
  348. help
  349. Support for the --lang_exclude flag which makes pahole exclude
  350. compilation units from the supplied language. Used in Kbuild to
  351. omit Rust CUs which are not supported in version 1.24 of pahole,
  352. otherwise it would emit malformed kernel and module binaries when
  353. using DEBUG_INFO_BTF_MODULES.
  354. config DEBUG_INFO_BTF_MODULES
  355. bool "Generate BTF type information for kernel modules"
  356. default y
  357. depends on DEBUG_INFO_BTF && MODULES
  358. help
  359. Generate compact split BTF type information for kernel modules.
  360. config MODULE_ALLOW_BTF_MISMATCH
  361. bool "Allow loading modules with non-matching BTF type info"
  362. depends on DEBUG_INFO_BTF_MODULES
  363. help
  364. For modules whose split BTF does not match vmlinux, load without
  365. BTF rather than refusing to load. The default behavior with
  366. module BTF enabled is to reject modules with such mismatches;
  367. this option will still load module BTF where possible but ignore
  368. it when a mismatch is found.
  369. config GDB_SCRIPTS
  370. bool "Provide GDB scripts for kernel debugging"
  371. help
  372. This creates the required links to GDB helper scripts in the
  373. build directory. If you load vmlinux into gdb, the helper
  374. scripts will be automatically imported by gdb as well, and
  375. additional functions are available to analyze a Linux kernel
  376. instance. See Documentation/process/debugging/gdb-kernel-debugging.rst
  377. for further details.
  378. endif # DEBUG_INFO
  379. config FRAME_WARN
  380. int "Warn for stack frames larger than"
  381. range 0 8192
  382. default 0 if KMSAN
  383. default 2048 if GCC_PLUGIN_LATENT_ENTROPY
  384. default 2048 if PARISC
  385. default 1536 if (!64BIT && XTENSA)
  386. default 1280 if !64BIT
  387. default 2048 if 64BIT
  388. help
  389. Tell the compiler to warn at build time for stack frames larger than this.
  390. Setting this too low will cause a lot of warnings.
  391. Setting it to 0 disables the warning.
  392. config STRIP_ASM_SYMS
  393. bool "Strip assembler-generated symbols during link"
  394. default n
  395. help
  396. Strip internal assembler-generated symbols during a link (symbols
  397. that look like '.Lxxx') so they don't pollute the output of
  398. get_wchan() and suchlike.
  399. config READABLE_ASM
  400. bool "Generate readable assembler code"
  401. depends on DEBUG_KERNEL
  402. depends on CC_IS_GCC
  403. help
  404. Disable some compiler optimizations that tend to generate human unreadable
  405. assembler output. This may make the kernel slightly slower, but it helps
  406. to keep kernel developers who have to stare a lot at assembler listings
  407. sane.
  408. config HEADERS_INSTALL
  409. bool "Install uapi headers to usr/include"
  410. help
  411. This option will install uapi headers (headers exported to user-space)
  412. into the usr/include directory for use during the kernel build.
  413. This is unneeded for building the kernel itself, but needed for some
  414. user-space program samples. It is also needed by some features such
  415. as uapi header sanity checks.
  416. config DEBUG_SECTION_MISMATCH
  417. bool "Enable full Section mismatch analysis"
  418. depends on CC_IS_GCC
  419. help
  420. The section mismatch analysis checks if there are illegal references
  421. from one section to another. During linktime or runtime, some
  422. sections are dropped; any use of code/data previously in these
  423. sections would most likely result in an oops.
  424. In the code, functions and variables are annotated with __init,
  425. __initdata, and so on (see the full list in include/linux/init.h).
  426. This directs the toolchain to place code/data in specific sections.
  427. The section mismatch analysis is always performed after a full
  428. kernel build, and enabling this option causes the option
  429. -fno-inline-functions-called-once to be added to gcc commands.
  430. However, when inlining a function annotated with __init in
  431. a non-init function, we would lose the section information and thus
  432. the analysis would not catch the illegal reference. This option
  433. tells gcc to inline less (but it does result in a larger kernel).
  434. config SECTION_MISMATCH_WARN_ONLY
  435. bool "Make section mismatch errors non-fatal"
  436. default y
  437. help
  438. If you say N here, the build process will fail if there are any
  439. section mismatch, instead of just throwing warnings.
  440. If unsure, say Y.
  441. config DEBUG_FORCE_FUNCTION_ALIGN_64B
  442. bool "Force all function address 64B aligned"
  443. depends on EXPERT && (X86_64 || ARM64 || PPC32 || PPC64 || ARC || RISCV || S390)
  444. select FUNCTION_ALIGNMENT_64B
  445. help
  446. There are cases that a commit from one domain changes the function
  447. address alignment of other domains, and cause magic performance
  448. bump (regression or improvement). Enable this option will help to
  449. verify if the bump is caused by function alignment changes, while
  450. it will slightly increase the kernel size and affect icache usage.
  451. It is mainly for debug and performance tuning use.
  452. #
  453. # Select this config option from the architecture Kconfig, if it
  454. # is preferred to always offer frame pointers as a config
  455. # option on the architecture (regardless of KERNEL_DEBUG):
  456. #
  457. config ARCH_WANT_FRAME_POINTERS
  458. bool
  459. config FRAME_POINTER
  460. bool "Compile the kernel with frame pointers"
  461. depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
  462. default y if (DEBUG_INFO && UML) || ARCH_WANT_FRAME_POINTERS
  463. help
  464. If you say Y here the resulting kernel image will be slightly
  465. larger and slower, but it gives very useful debugging information
  466. in case of kernel bugs. (precise oopses/stacktraces/warnings)
  467. config OBJTOOL
  468. bool
  469. config OBJTOOL_WERROR
  470. bool "Upgrade objtool warnings to errors"
  471. depends on OBJTOOL && !COMPILE_TEST
  472. help
  473. Fail the build on objtool warnings.
  474. Objtool warnings can indicate kernel instability, including boot
  475. failures. This option is highly recommended.
  476. If unsure, say Y.
  477. config STACK_VALIDATION
  478. bool "Compile-time stack metadata validation"
  479. depends on HAVE_STACK_VALIDATION && UNWINDER_FRAME_POINTER
  480. select OBJTOOL
  481. default n
  482. help
  483. Validate frame pointer rules at compile-time. This helps ensure that
  484. runtime stack traces are more reliable.
  485. For more information, see
  486. tools/objtool/Documentation/objtool.txt.
  487. config NOINSTR_VALIDATION
  488. bool
  489. depends on HAVE_NOINSTR_VALIDATION && DEBUG_ENTRY
  490. select OBJTOOL
  491. default y
  492. config VMLINUX_MAP
  493. bool "Generate vmlinux.map file when linking"
  494. depends on EXPERT
  495. help
  496. Selecting this option will pass "-Map=vmlinux.map" to ld
  497. when linking vmlinux. That file can be useful for verifying
  498. and debugging magic section games, and for seeing which
  499. pieces of code get eliminated with
  500. CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.
  501. config BUILTIN_MODULE_RANGES
  502. bool "Generate address range information for builtin modules"
  503. depends on !LTO
  504. depends on VMLINUX_MAP
  505. help
  506. When modules are built into the kernel, there will be no module name
  507. associated with its symbols in /proc/kallsyms. Tracers may want to
  508. identify symbols by module name and symbol name regardless of whether
  509. the module is configured as loadable or not.
  510. This option generates modules.builtin.ranges in the build tree with
  511. offset ranges (per ELF section) for the module(s) they belong to.
  512. It also records an anchor symbol to determine the load address of the
  513. section.
  514. config DEBUG_FORCE_WEAK_PER_CPU
  515. bool "Force weak per-cpu definitions"
  516. depends on DEBUG_KERNEL
  517. help
  518. s390 and alpha require percpu variables in modules to be
  519. defined weak to work around addressing range issue which
  520. puts the following two restrictions on percpu variable
  521. definitions.
  522. 1. percpu symbols must be unique whether static or not
  523. 2. percpu variables can't be defined inside a function
  524. To ensure that generic code follows the above rules, this
  525. option forces all percpu variables to be defined as weak.
  526. config WARN_CONTEXT_ANALYSIS
  527. bool "Compiler context-analysis warnings"
  528. depends on CC_IS_CLANG && CLANG_VERSION >= 220100
  529. # Branch profiling re-defines "if", which messes with the compiler's
  530. # ability to analyze __cond_acquires(..), resulting in false positives.
  531. depends on !TRACE_BRANCH_PROFILING
  532. default y
  533. help
  534. Context Analysis is a language extension, which enables statically
  535. checking that required contexts are active (or inactive) by acquiring
  536. and releasing user-definable "context locks".
  537. Clang's name of the feature is "Thread Safety Analysis". Requires
  538. Clang 22.1.0 or later.
  539. Produces warnings by default. Select CONFIG_WERROR if you wish to
  540. turn these warnings into errors.
  541. For more details, see Documentation/dev-tools/context-analysis.rst.
  542. config WARN_CONTEXT_ANALYSIS_ALL
  543. bool "Enable context analysis for all source files"
  544. depends on WARN_CONTEXT_ANALYSIS
  545. depends on EXPERT && !COMPILE_TEST
  546. help
  547. Enable tree-wide context analysis. This is likely to produce a
  548. large number of false positives - enable at your own risk.
  549. If unsure, say N.
  550. endmenu # "Compiler options"
  551. menu "Generic Kernel Debugging Instruments"
  552. config MAGIC_SYSRQ
  553. bool "Magic SysRq key"
  554. depends on !UML
  555. help
  556. If you say Y here, you will have some control over the system even
  557. if the system crashes for example during kernel debugging (e.g., you
  558. will be able to flush the buffer cache to disk, reboot the system
  559. immediately or dump some status information). This is accomplished
  560. by pressing various keys while holding SysRq (Alt+PrintScreen). It
  561. also works on a serial console (on PC hardware at least), if you
  562. send a BREAK and then within 5 seconds a command keypress. The
  563. keys are documented in <file:Documentation/admin-guide/sysrq.rst>.
  564. Don't say Y unless you really know what this hack does.
  565. config MAGIC_SYSRQ_DEFAULT_ENABLE
  566. hex "Enable magic SysRq key functions by default"
  567. depends on MAGIC_SYSRQ
  568. default 0x1
  569. help
  570. Specifies which SysRq key functions are enabled by default.
  571. This may be set to 1 or 0 to enable or disable them all, or
  572. to a bitmask as described in Documentation/admin-guide/sysrq.rst.
  573. config MAGIC_SYSRQ_SERIAL
  574. bool "Enable magic SysRq key over serial"
  575. depends on MAGIC_SYSRQ
  576. default y
  577. help
  578. Many embedded boards have a disconnected TTL level serial which can
  579. generate some garbage that can lead to spurious false sysrq detects.
  580. This option allows you to decide whether you want to enable the
  581. magic SysRq key.
  582. config MAGIC_SYSRQ_SERIAL_SEQUENCE
  583. string "Char sequence that enables magic SysRq over serial"
  584. depends on MAGIC_SYSRQ_SERIAL
  585. default ""
  586. help
  587. Specifies a sequence of characters that can follow BREAK to enable
  588. SysRq on a serial console.
  589. If unsure, leave an empty string and the option will not be enabled.
  590. config DEBUG_FS
  591. bool "Debug Filesystem"
  592. help
  593. debugfs is a virtual file system that kernel developers use to put
  594. debugging files into. Enable this option to be able to read and
  595. write to these files.
  596. For detailed documentation on the debugfs API, see
  597. Documentation/filesystems/.
  598. If unsure, say N.
  599. choice
  600. prompt "Debugfs default access"
  601. depends on DEBUG_FS
  602. default DEBUG_FS_ALLOW_ALL
  603. help
  604. This selects the default access restrictions for debugfs.
  605. It can be overridden with kernel command line option
  606. debugfs=[on,off]. The restrictions apply for API access
  607. and filesystem registration.
  608. config DEBUG_FS_ALLOW_ALL
  609. bool "Access normal"
  610. help
  611. No restrictions apply. Both API and filesystem registration
  612. is on. This is the normal default operation.
  613. config DEBUG_FS_ALLOW_NONE
  614. bool "No access"
  615. help
  616. Access is off. Clients get -PERM when trying to create nodes in
  617. debugfs tree and debugfs is not registered as a filesystem.
  618. Client can then back-off or continue without debugfs access.
  619. endchoice
  620. source "lib/Kconfig.kgdb"
  621. source "lib/Kconfig.ubsan"
  622. source "lib/Kconfig.kcsan"
  623. endmenu
  624. menu "Networking Debugging"
  625. source "net/Kconfig.debug"
  626. endmenu # "Networking Debugging"
  627. menu "Memory Debugging"
  628. source "mm/Kconfig.debug"
  629. config DEBUG_OBJECTS
  630. bool "Debug object operations"
  631. depends on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT
  632. depends on DEBUG_KERNEL
  633. help
  634. If you say Y here, additional code will be inserted into the
  635. kernel to track the life time of various objects and validate
  636. the operations on those objects.
  637. config DEBUG_OBJECTS_SELFTEST
  638. bool "Debug objects selftest"
  639. depends on DEBUG_OBJECTS
  640. help
  641. This enables the selftest of the object debug code.
  642. config DEBUG_OBJECTS_FREE
  643. bool "Debug objects in freed memory"
  644. depends on DEBUG_OBJECTS
  645. help
  646. This enables checks whether a k/v free operation frees an area
  647. which contains an object which has not been deactivated
  648. properly. This can make kmalloc/kfree-intensive workloads
  649. much slower.
  650. config DEBUG_OBJECTS_TIMERS
  651. bool "Debug timer objects"
  652. depends on DEBUG_OBJECTS
  653. help
  654. If you say Y here, additional code will be inserted into the
  655. timer routines to track the life time of timer objects and
  656. validate the timer operations.
  657. config DEBUG_OBJECTS_WORK
  658. bool "Debug work objects"
  659. depends on DEBUG_OBJECTS
  660. help
  661. If you say Y here, additional code will be inserted into the
  662. work queue routines to track the life time of work objects and
  663. validate the work operations.
  664. config DEBUG_OBJECTS_RCU_HEAD
  665. bool "Debug RCU callbacks objects"
  666. depends on DEBUG_OBJECTS
  667. help
  668. Enable this to turn on debugging of RCU list heads (call_rcu() usage).
  669. config DEBUG_OBJECTS_PERCPU_COUNTER
  670. bool "Debug percpu counter objects"
  671. depends on DEBUG_OBJECTS
  672. help
  673. If you say Y here, additional code will be inserted into the
  674. percpu counter routines to track the life time of percpu counter
  675. objects and validate the percpu counter operations.
  676. config DEBUG_OBJECTS_ENABLE_DEFAULT
  677. int "debug_objects bootup default value (0-1)"
  678. range 0 1
  679. default "1"
  680. depends on DEBUG_OBJECTS
  681. help
  682. Debug objects boot parameter default value
  683. config SHRINKER_DEBUG
  684. bool "Enable shrinker debugging support"
  685. depends on DEBUG_FS
  686. help
  687. Say Y to enable the shrinker debugfs interface which provides
  688. visibility into the kernel memory shrinkers subsystem.
  689. Disable it to avoid an extra memory footprint.
  690. config DEBUG_STACK_USAGE
  691. bool "Stack utilization instrumentation"
  692. depends on DEBUG_KERNEL
  693. help
  694. Enables the display of the minimum amount of free stack which each
  695. task has ever had available in the sysrq-T and sysrq-P debug output.
  696. Also emits a message to dmesg when a process exits if that process
  697. used more stack space than previously exiting processes.
  698. This option will slow down process creation somewhat.
  699. config SCHED_STACK_END_CHECK
  700. bool "Detect stack corruption on calls to schedule()"
  701. depends on DEBUG_KERNEL
  702. default n
  703. help
  704. This option checks for a stack overrun on calls to schedule().
  705. If the stack end location is found to be over written always panic as
  706. the content of the corrupted region can no longer be trusted.
  707. This is to ensure no erroneous behaviour occurs which could result in
  708. data corruption or a sporadic crash at a later stage once the region
  709. is examined. The runtime overhead introduced is minimal.
  710. config ARCH_HAS_DEBUG_VM_PGTABLE
  711. bool
  712. help
  713. An architecture should select this when it can successfully
  714. build and run DEBUG_VM_PGTABLE.
  715. config DEBUG_VFS
  716. bool "Debug VFS"
  717. depends on DEBUG_KERNEL
  718. help
  719. Enable this to turn on extended checks in the VFS layer that may impact
  720. performance.
  721. If unsure, say N.
  722. config DEBUG_VM_IRQSOFF
  723. def_bool DEBUG_VM && !PREEMPT_RT
  724. config DEBUG_VM
  725. bool "Debug VM"
  726. depends on DEBUG_KERNEL
  727. help
  728. Enable this to turn on extended checks in the virtual-memory system
  729. that may impact performance.
  730. If unsure, say N.
  731. config DEBUG_VM_SHOOT_LAZIES
  732. bool "Debug MMU_LAZY_TLB_SHOOTDOWN implementation"
  733. depends on DEBUG_VM
  734. depends on MMU_LAZY_TLB_SHOOTDOWN
  735. help
  736. Enable additional IPIs that ensure lazy tlb mm references are removed
  737. before the mm is freed.
  738. If unsure, say N.
  739. config DEBUG_VM_MAPLE_TREE
  740. bool "Debug VM maple trees"
  741. depends on DEBUG_VM
  742. select DEBUG_MAPLE_TREE
  743. help
  744. Enable VM maple tree debugging information and extra validations.
  745. If unsure, say N.
  746. config DEBUG_VM_RB
  747. bool "Debug VM red-black trees"
  748. depends on DEBUG_VM
  749. help
  750. Enable VM red-black tree debugging information and extra validations.
  751. If unsure, say N.
  752. config DEBUG_VM_PGFLAGS
  753. bool "Debug page-flags operations"
  754. depends on DEBUG_VM
  755. help
  756. Enables extra validation on page flags operations.
  757. If unsure, say N.
  758. config DEBUG_VM_PGTABLE
  759. bool "Debug arch page table for semantics compliance"
  760. depends on MMU
  761. depends on ARCH_HAS_DEBUG_VM_PGTABLE
  762. default y if DEBUG_VM
  763. help
  764. This option provides a debug method which can be used to test
  765. architecture page table helper functions on various platforms in
  766. verifying if they comply with expected generic MM semantics. This
  767. will help architecture code in making sure that any changes or
  768. new additions of these helpers still conform to expected
  769. semantics of the generic MM. Platforms will have to opt in for
  770. this through ARCH_HAS_DEBUG_VM_PGTABLE.
  771. If unsure, say N.
  772. config ARCH_HAS_DEBUG_VIRTUAL
  773. bool
  774. config DEBUG_VIRTUAL
  775. bool "Debug VM translations"
  776. depends on DEBUG_KERNEL && ARCH_HAS_DEBUG_VIRTUAL
  777. help
  778. Enable some costly sanity checks in virtual to page code. This can
  779. catch mistakes with virt_to_page() and friends.
  780. If unsure, say N.
  781. config DEBUG_NOMMU_REGIONS
  782. bool "Debug the global anon/private NOMMU mapping region tree"
  783. depends on DEBUG_KERNEL && !MMU
  784. help
  785. This option causes the global tree of anonymous and private mapping
  786. regions to be regularly checked for invalid topology.
  787. config DEBUG_MEMORY_INIT
  788. bool "Debug memory initialisation" if EXPERT
  789. default !EXPERT
  790. help
  791. Enable this for additional checks during memory initialisation.
  792. The sanity checks verify aspects of the VM such as the memory model
  793. and other information provided by the architecture. Verbose
  794. information will be printed at KERN_DEBUG loglevel depending
  795. on the mminit_loglevel= command-line option.
  796. If unsure, say Y
  797. config MEMORY_NOTIFIER_ERROR_INJECT
  798. tristate "Memory hotplug notifier error injection module"
  799. depends on MEMORY_HOTPLUG && NOTIFIER_ERROR_INJECTION
  800. help
  801. This option provides the ability to inject artificial errors to
  802. memory hotplug notifier chain callbacks. It is controlled through
  803. debugfs interface under /sys/kernel/debug/notifier-error-inject/memory
  804. If the notifier call chain should be failed with some events
  805. notified, write the error code to "actions/<notifier event>/error".
  806. Example: Inject memory hotplug offline error (-12 == -ENOMEM)
  807. # cd /sys/kernel/debug/notifier-error-inject/memory
  808. # echo -12 > actions/MEM_GOING_OFFLINE/error
  809. # echo offline > /sys/devices/system/memory/memoryXXX/state
  810. bash: echo: write error: Cannot allocate memory
  811. To compile this code as a module, choose M here: the module will
  812. be called memory-notifier-error-inject.
  813. If unsure, say N.
  814. config DEBUG_PER_CPU_MAPS
  815. bool "Debug access to per_cpu maps"
  816. depends on DEBUG_KERNEL
  817. depends on SMP
  818. help
  819. Say Y to verify that the per_cpu map being accessed has
  820. been set up. This adds a fair amount of code to kernel memory
  821. and decreases performance.
  822. Say N if unsure.
  823. config DEBUG_KMAP_LOCAL
  824. bool "Debug kmap_local temporary mappings"
  825. depends on DEBUG_KERNEL && KMAP_LOCAL
  826. help
  827. This option enables additional error checking for the kmap_local
  828. infrastructure. Disable for production use.
  829. config ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
  830. bool
  831. config DEBUG_KMAP_LOCAL_FORCE_MAP
  832. bool "Enforce kmap_local temporary mappings"
  833. depends on DEBUG_KERNEL && ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
  834. select KMAP_LOCAL
  835. select DEBUG_KMAP_LOCAL
  836. help
  837. This option enforces temporary mappings through the kmap_local
  838. mechanism for non-highmem pages and on non-highmem systems.
  839. Disable this for production systems!
  840. config DEBUG_HIGHMEM
  841. bool "Highmem debugging"
  842. depends on DEBUG_KERNEL && HIGHMEM
  843. select DEBUG_KMAP_LOCAL_FORCE_MAP if ARCH_SUPPORTS_KMAP_LOCAL_FORCE_MAP
  844. select DEBUG_KMAP_LOCAL
  845. help
  846. This option enables additional error checking for high memory
  847. systems. Disable for production systems.
  848. config HAVE_DEBUG_STACKOVERFLOW
  849. bool
  850. config DEBUG_STACKOVERFLOW
  851. bool "Check for stack overflows"
  852. depends on DEBUG_KERNEL && HAVE_DEBUG_STACKOVERFLOW
  853. help
  854. Say Y here if you want to check for overflows of kernel, IRQ
  855. and exception stacks (if your architecture uses them). This
  856. option will show detailed messages if free stack space drops
  857. below a certain limit.
  858. These kinds of bugs usually occur when call-chains in the
  859. kernel get too deep, especially when interrupts are
  860. involved.
  861. Use this in cases where you see apparently random memory
  862. corruption, especially if it appears in 'struct thread_info'
  863. If in doubt, say "N".
  864. config CODE_TAGGING
  865. bool
  866. select KALLSYMS
  867. config MEM_ALLOC_PROFILING
  868. bool "Enable memory allocation profiling"
  869. default n
  870. depends on MMU
  871. depends on PROC_FS
  872. depends on !DEBUG_FORCE_WEAK_PER_CPU
  873. select CODE_TAGGING
  874. select PAGE_EXTENSION
  875. select SLAB_OBJ_EXT
  876. help
  877. Track allocation source code and record total allocation size
  878. initiated at that code location. The mechanism can be used to track
  879. memory leaks with a low performance and memory impact.
  880. config MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT
  881. bool "Enable memory allocation profiling by default"
  882. default y
  883. depends on MEM_ALLOC_PROFILING
  884. config MEM_ALLOC_PROFILING_DEBUG
  885. bool "Memory allocation profiler debugging"
  886. default n
  887. depends on MEM_ALLOC_PROFILING
  888. select MEM_ALLOC_PROFILING_ENABLED_BY_DEFAULT
  889. help
  890. Adds warnings with helpful error messages for memory allocation
  891. profiling.
  892. source "lib/Kconfig.kasan"
  893. source "lib/Kconfig.kfence"
  894. source "lib/Kconfig.kmsan"
  895. endmenu # "Memory Debugging"
  896. config DEBUG_SHIRQ
  897. bool "Debug shared IRQ handlers"
  898. depends on DEBUG_KERNEL
  899. help
  900. Enable this to generate a spurious interrupt just before a shared
  901. interrupt handler is deregistered (generating one when registering
  902. is currently disabled). Drivers need to handle this correctly. Some
  903. don't and need to be caught.
  904. menu "Debug Oops, Lockups and Hangs"
  905. config PANIC_ON_OOPS
  906. bool "Panic on Oops"
  907. help
  908. Say Y here to enable the kernel to panic when it oopses. This
  909. has the same effect as setting oops=panic on the kernel command
  910. line.
  911. This feature is useful to ensure that the kernel does not do
  912. anything erroneous after an oops which could result in data
  913. corruption or other issues.
  914. Say N if unsure.
  915. config PANIC_TIMEOUT
  916. int "panic timeout"
  917. default 0
  918. help
  919. Set the timeout value (in seconds) until a reboot occurs when
  920. the kernel panics. If n = 0, then we wait forever. A timeout
  921. value n > 0 will wait n seconds before rebooting, while a timeout
  922. value n < 0 will reboot immediately. This setting can be overridden
  923. with the kernel command line option panic=, and from userspace via
  924. /proc/sys/kernel/panic.
  925. config LOCKUP_DETECTOR
  926. bool
  927. config SOFTLOCKUP_DETECTOR
  928. bool "Detect Soft Lockups"
  929. depends on DEBUG_KERNEL && !S390
  930. select LOCKUP_DETECTOR
  931. help
  932. Say Y here to enable the kernel to act as a watchdog to detect
  933. soft lockups.
  934. Softlockups are bugs that cause the kernel to loop in kernel
  935. mode for more than 20 seconds, without giving other tasks a
  936. chance to run. The current stack trace is displayed upon
  937. detection and the system will stay locked up.
  938. config SOFTLOCKUP_DETECTOR_INTR_STORM
  939. bool "Detect Interrupt Storm in Soft Lockups"
  940. depends on SOFTLOCKUP_DETECTOR && IRQ_TIME_ACCOUNTING
  941. select GENERIC_IRQ_STAT_SNAPSHOT
  942. default y if NR_CPUS <= 128
  943. help
  944. Say Y here to enable the kernel to detect interrupt storm
  945. during "soft lockups".
  946. "soft lockups" can be caused by a variety of reasons. If one is
  947. caused by an interrupt storm, then the storming interrupts will not
  948. be on the callstack. To detect this case, it is necessary to report
  949. the CPU stats and the interrupt counts during the "soft lockups".
  950. config BOOTPARAM_SOFTLOCKUP_PANIC
  951. int "Panic (Reboot) On Soft Lockups"
  952. depends on SOFTLOCKUP_DETECTOR
  953. default 0
  954. help
  955. Set to a non-zero value N to enable the kernel to panic on "soft
  956. lockups", which are bugs that cause the kernel to loop in kernel
  957. mode for more than (N * 20 seconds) (configurable using the
  958. watchdog_thresh sysctl), without giving other tasks a chance to run.
  959. The panic can be used in combination with panic_timeout,
  960. to cause the system to reboot automatically after a
  961. lockup has been detected. This feature is useful for
  962. high-availability systems that have uptime guarantees and
  963. where a lockup must be resolved ASAP.
  964. Say 0 if unsure.
  965. config HAVE_HARDLOCKUP_DETECTOR_BUDDY
  966. bool
  967. depends on SMP
  968. default y
  969. #
  970. # Global switch whether to build a hardlockup detector at all. It is available
  971. # only when the architecture supports at least one implementation. There are
  972. # two exceptions. The hardlockup detector is never enabled on:
  973. #
  974. # s390: it reported many false positives there
  975. #
  976. # sparc64: has a custom implementation which is not using the common
  977. # hardlockup command line options and sysctl interface.
  978. #
  979. config HARDLOCKUP_DETECTOR
  980. bool "Detect Hard Lockups"
  981. depends on DEBUG_KERNEL && !S390 && !HARDLOCKUP_DETECTOR_SPARC64
  982. depends on HAVE_HARDLOCKUP_DETECTOR_PERF || HAVE_HARDLOCKUP_DETECTOR_BUDDY || HAVE_HARDLOCKUP_DETECTOR_ARCH
  983. imply HARDLOCKUP_DETECTOR_PERF
  984. imply HARDLOCKUP_DETECTOR_BUDDY
  985. imply HARDLOCKUP_DETECTOR_ARCH
  986. select LOCKUP_DETECTOR
  987. help
  988. Say Y here to enable the kernel to act as a watchdog to detect
  989. hard lockups.
  990. Hardlockups are bugs that cause the CPU to loop in kernel mode
  991. for more than 10 seconds, without letting other interrupts have a
  992. chance to run. The current stack trace is displayed upon detection
  993. and the system will stay locked up.
  994. #
  995. # Note that arch-specific variants are always preferred.
  996. #
  997. config HARDLOCKUP_DETECTOR_PREFER_BUDDY
  998. bool "Prefer the buddy CPU hardlockup detector"
  999. depends on HARDLOCKUP_DETECTOR
  1000. depends on HAVE_HARDLOCKUP_DETECTOR_PERF && HAVE_HARDLOCKUP_DETECTOR_BUDDY
  1001. depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
  1002. help
  1003. Say Y here to prefer the buddy hardlockup detector over the perf one.
  1004. With the buddy detector, each CPU uses its softlockup hrtimer
  1005. to check that the next CPU is processing hrtimer interrupts by
  1006. verifying that a counter is increasing.
  1007. This hardlockup detector is useful on systems that don't have
  1008. an arch-specific hardlockup detector or if resources needed
  1009. for the hardlockup detector are better used for other things.
  1010. config HARDLOCKUP_DETECTOR_PERF
  1011. bool
  1012. depends on HARDLOCKUP_DETECTOR
  1013. depends on HAVE_HARDLOCKUP_DETECTOR_PERF && !HARDLOCKUP_DETECTOR_PREFER_BUDDY
  1014. depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
  1015. select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
  1016. config HARDLOCKUP_DETECTOR_BUDDY
  1017. bool
  1018. depends on HARDLOCKUP_DETECTOR
  1019. depends on HAVE_HARDLOCKUP_DETECTOR_BUDDY
  1020. depends on !HAVE_HARDLOCKUP_DETECTOR_PERF || HARDLOCKUP_DETECTOR_PREFER_BUDDY
  1021. depends on !HAVE_HARDLOCKUP_DETECTOR_ARCH
  1022. select HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
  1023. config HARDLOCKUP_DETECTOR_ARCH
  1024. bool
  1025. depends on HARDLOCKUP_DETECTOR
  1026. depends on HAVE_HARDLOCKUP_DETECTOR_ARCH
  1027. help
  1028. The arch-specific implementation of the hardlockup detector will
  1029. be used.
  1030. #
  1031. # Both the "perf" and "buddy" hardlockup detectors count hrtimer
  1032. # interrupts. This config enables functions managing this common code.
  1033. #
  1034. config HARDLOCKUP_DETECTOR_COUNTS_HRTIMER
  1035. bool
  1036. select SOFTLOCKUP_DETECTOR
  1037. #
  1038. # Enables a timestamp based low pass filter to compensate for perf based
  1039. # hard lockup detection which runs too fast due to turbo modes.
  1040. #
  1041. config HARDLOCKUP_CHECK_TIMESTAMP
  1042. bool
  1043. config BOOTPARAM_HARDLOCKUP_PANIC
  1044. bool "Panic (Reboot) On Hard Lockups"
  1045. depends on HARDLOCKUP_DETECTOR
  1046. help
  1047. Say Y here to enable the kernel to panic on "hard lockups",
  1048. which are bugs that cause the kernel to loop in kernel
  1049. mode with interrupts disabled for more than 10 seconds (configurable
  1050. using the watchdog_thresh sysctl).
  1051. Say N if unsure.
  1052. config DETECT_HUNG_TASK
  1053. bool "Detect Hung Tasks"
  1054. depends on DEBUG_KERNEL
  1055. default SOFTLOCKUP_DETECTOR
  1056. help
  1057. Say Y here to enable the kernel to detect "hung tasks",
  1058. which are bugs that cause the task to be stuck in
  1059. uninterruptible "D" state indefinitely.
  1060. When a hung task is detected, the kernel will print the
  1061. current stack trace (which you should report), but the
  1062. task will stay in uninterruptible state. If lockdep is
  1063. enabled then all held locks will also be reported. This
  1064. feature has negligible overhead.
  1065. config DEFAULT_HUNG_TASK_TIMEOUT
  1066. int "Default timeout for hung task detection (in seconds)"
  1067. depends on DETECT_HUNG_TASK
  1068. default 120
  1069. help
  1070. This option controls the default timeout (in seconds) used
  1071. to determine when a task has become non-responsive and should
  1072. be considered hung.
  1073. It can be adjusted at runtime via the kernel.hung_task_timeout_secs
  1074. sysctl or by writing a value to
  1075. /proc/sys/kernel/hung_task_timeout_secs.
  1076. A timeout of 0 disables the check. The default is two minutes.
  1077. Keeping the default should be fine in most cases.
  1078. config BOOTPARAM_HUNG_TASK_PANIC
  1079. int "Number of hung tasks to trigger kernel panic"
  1080. depends on DETECT_HUNG_TASK
  1081. default 0
  1082. help
  1083. When set to a non-zero value, a kernel panic will be triggered
  1084. if the number of hung tasks found during a single scan reaches
  1085. this value.
  1086. The panic can be used in combination with panic_timeout,
  1087. to cause the system to reboot automatically after a
  1088. hung task has been detected. This feature is useful for
  1089. high-availability systems that have uptime guarantees and
  1090. where a hung tasks must be resolved ASAP.
  1091. Say 0 if unsure.
  1092. config DETECT_HUNG_TASK_BLOCKER
  1093. bool "Dump Hung Tasks Blocker"
  1094. depends on DETECT_HUNG_TASK
  1095. depends on !PREEMPT_RT
  1096. default y
  1097. help
  1098. Say Y here to show the blocker task's stacktrace who acquires
  1099. the mutex lock which "hung tasks" are waiting.
  1100. This will add overhead a bit but shows suspicious tasks and
  1101. call trace if it comes from waiting a mutex.
  1102. config WQ_WATCHDOG
  1103. bool "Detect Workqueue Stalls"
  1104. depends on DEBUG_KERNEL
  1105. help
  1106. Say Y here to enable stall detection on workqueues. If a
  1107. worker pool doesn't make forward progress on a pending work
  1108. item for over a given amount of time, 30s by default, a
  1109. warning message is printed along with dump of workqueue
  1110. state. This can be configured through kernel parameter
  1111. "workqueue.watchdog_thresh" and its sysfs counterpart.
  1112. config BOOTPARAM_WQ_STALL_PANIC
  1113. int "Panic on Nth workqueue stall"
  1114. default 0
  1115. range 0 100
  1116. depends on WQ_WATCHDOG
  1117. help
  1118. Set the number of workqueue stalls to trigger a kernel panic.
  1119. A workqueue stall occurs when a worker pool doesn't make forward
  1120. progress on a pending work item for over 30 seconds (configurable
  1121. using the workqueue.watchdog_thresh parameter).
  1122. If n = 0, the kernel will not panic on stall. If n > 0, the kernel
  1123. will panic after n stall warnings.
  1124. The panic can be used in combination with panic_timeout,
  1125. to cause the system to reboot automatically after a
  1126. stall has been detected. This feature is useful for
  1127. high-availability systems that have uptime guarantees and
  1128. where a stall must be resolved ASAP.
  1129. This setting can be overridden at runtime via the
  1130. workqueue.panic_on_stall kernel parameter.
  1131. config WQ_CPU_INTENSIVE_REPORT
  1132. bool "Report per-cpu work items which hog CPU for too long"
  1133. depends on DEBUG_KERNEL
  1134. help
  1135. Say Y here to enable reporting of concurrency-managed per-cpu work
  1136. items that hog CPUs for longer than
  1137. workqueue.cpu_intensive_thresh_us. Workqueue automatically
  1138. detects and excludes them from concurrency management to prevent
  1139. them from stalling other per-cpu work items. Occassional
  1140. triggering may not necessarily indicate a problem. Repeated
  1141. triggering likely indicates that the work item should be switched
  1142. to use an unbound workqueue.
  1143. config TEST_LOCKUP
  1144. tristate "Test module to generate lockups"
  1145. depends on m
  1146. help
  1147. This builds the "test_lockup" module that helps to make sure
  1148. that watchdogs and lockup detectors are working properly.
  1149. Depending on module parameters it could emulate soft or hard
  1150. lockup, "hung task", or locking arbitrary lock for a long time.
  1151. Also it could generate series of lockups with cooling-down periods.
  1152. If unsure, say N.
  1153. endmenu # "Debug lockups and hangs"
  1154. menu "Scheduler Debugging"
  1155. config SCHED_INFO
  1156. bool
  1157. default n
  1158. config SCHEDSTATS
  1159. bool "Collect scheduler statistics"
  1160. depends on PROC_FS
  1161. select SCHED_INFO
  1162. help
  1163. If you say Y here, additional code will be inserted into the
  1164. scheduler and related routines to collect statistics about
  1165. scheduler behavior and provide them in /proc/schedstat. These
  1166. stats may be useful for both tuning and debugging the scheduler
  1167. If you aren't debugging the scheduler or trying to tune a specific
  1168. application, you can say N to avoid the very slight overhead
  1169. this adds.
  1170. endmenu
  1171. config DEBUG_PREEMPT
  1172. bool "Debug preemptible kernel"
  1173. depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT
  1174. help
  1175. If you say Y here then the kernel will use a debug variant of the
  1176. commonly used smp_processor_id() function and will print warnings
  1177. if kernel code uses it in a preemption-unsafe way. Also, the kernel
  1178. will detect preemption count underflows.
  1179. This option has potential to introduce high runtime overhead,
  1180. depending on workload as it triggers debugging routines for each
  1181. this_cpu operation. It should only be used for debugging purposes.
  1182. config DEBUG_ATOMIC
  1183. bool "Debug atomic variables"
  1184. depends on DEBUG_KERNEL
  1185. help
  1186. If you say Y here then the kernel will add a runtime alignment check
  1187. to atomic accesses. Useful for architectures that do not have trap on
  1188. mis-aligned access.
  1189. This option has potentially significant overhead.
  1190. config DEBUG_ATOMIC_LARGEST_ALIGN
  1191. bool "Check alignment only up to __aligned_largest"
  1192. depends on DEBUG_ATOMIC
  1193. help
  1194. If you say Y here then the check for natural alignment of
  1195. atomic accesses will be constrained to the compiler's largest
  1196. alignment for scalar types.
  1197. menu "Lock Debugging (spinlocks, mutexes, etc...)"
  1198. config LOCK_DEBUGGING_SUPPORT
  1199. bool
  1200. depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
  1201. default y
  1202. config PROVE_LOCKING
  1203. bool "Lock debugging: prove locking correctness"
  1204. depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
  1205. select LOCKDEP
  1206. select DEBUG_SPINLOCK
  1207. select DEBUG_MUTEXES if !PREEMPT_RT
  1208. select DEBUG_RT_MUTEXES if RT_MUTEXES
  1209. select DEBUG_RWSEMS if !PREEMPT_RT
  1210. select DEBUG_WW_MUTEX_SLOWPATH
  1211. select DEBUG_LOCK_ALLOC
  1212. select PREEMPT_COUNT if !ARCH_NO_PREEMPT
  1213. select TRACE_IRQFLAGS
  1214. default n
  1215. help
  1216. This feature enables the kernel to prove that all locking
  1217. that occurs in the kernel runtime is mathematically
  1218. correct: that under no circumstance could an arbitrary (and
  1219. not yet triggered) combination of observed locking
  1220. sequences (on an arbitrary number of CPUs, running an
  1221. arbitrary number of tasks and interrupt contexts) cause a
  1222. deadlock.
  1223. In short, this feature enables the kernel to report locking
  1224. related deadlocks before they actually occur.
  1225. The proof does not depend on how hard and complex a
  1226. deadlock scenario would be to trigger: how many
  1227. participant CPUs, tasks and irq-contexts would be needed
  1228. for it to trigger. The proof also does not depend on
  1229. timing: if a race and a resulting deadlock is possible
  1230. theoretically (no matter how unlikely the race scenario
  1231. is), it will be proven so and will immediately be
  1232. reported by the kernel (once the event is observed that
  1233. makes the deadlock theoretically possible).
  1234. If a deadlock is impossible (i.e. the locking rules, as
  1235. observed by the kernel, are mathematically correct), the
  1236. kernel reports nothing.
  1237. NOTE: this feature can also be enabled for rwlocks, mutexes
  1238. and rwsems - in which case all dependencies between these
  1239. different locking variants are observed and mapped too, and
  1240. the proof of observed correctness is also maintained for an
  1241. arbitrary combination of these separate locking variants.
  1242. For more details, see Documentation/locking/lockdep-design.rst.
  1243. config PROVE_RAW_LOCK_NESTING
  1244. bool "Enable raw_spinlock - spinlock nesting checks" if !ARCH_SUPPORTS_RT
  1245. depends on PROVE_LOCKING
  1246. default y if ARCH_SUPPORTS_RT
  1247. help
  1248. Enable the raw_spinlock vs. spinlock nesting checks which ensure
  1249. that the lock nesting rules for PREEMPT_RT enabled kernels are
  1250. not violated.
  1251. config LOCK_STAT
  1252. bool "Lock usage statistics"
  1253. depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
  1254. select LOCKDEP
  1255. select DEBUG_SPINLOCK
  1256. select DEBUG_MUTEXES if !PREEMPT_RT
  1257. select DEBUG_RT_MUTEXES if RT_MUTEXES
  1258. select DEBUG_LOCK_ALLOC
  1259. default n
  1260. help
  1261. This feature enables tracking lock contention points
  1262. For more details, see Documentation/locking/lockstat.rst
  1263. This also enables lock events required by "perf lock",
  1264. subcommand of perf.
  1265. If you want to use "perf lock", you also need to turn on
  1266. CONFIG_EVENT_TRACING.
  1267. CONFIG_LOCK_STAT defines "contended" and "acquired" lock events.
  1268. (CONFIG_LOCKDEP defines "acquire" and "release" events.)
  1269. config DEBUG_RT_MUTEXES
  1270. bool "RT Mutex debugging, deadlock detection"
  1271. depends on DEBUG_KERNEL && RT_MUTEXES
  1272. help
  1273. This allows rt mutex semantics violations and rt mutex related
  1274. deadlocks (lockups) to be detected and reported automatically.
  1275. config DEBUG_SPINLOCK
  1276. bool "Spinlock and rw-lock debugging: basic checks"
  1277. depends on DEBUG_KERNEL
  1278. select UNINLINE_SPIN_UNLOCK
  1279. help
  1280. Say Y here and build SMP to catch missing spinlock initialization
  1281. and certain other kinds of spinlock errors commonly made. This is
  1282. best used in conjunction with the NMI watchdog so that spinlock
  1283. deadlocks are also debuggable.
  1284. config DEBUG_MUTEXES
  1285. bool "Mutex debugging: basic checks"
  1286. depends on DEBUG_KERNEL && !PREEMPT_RT
  1287. help
  1288. This feature allows mutex semantics violations to be detected and
  1289. reported.
  1290. config DEBUG_WW_MUTEX_SLOWPATH
  1291. bool "Wait/wound mutex debugging: Slowpath testing"
  1292. depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
  1293. select DEBUG_LOCK_ALLOC
  1294. select DEBUG_SPINLOCK
  1295. select DEBUG_MUTEXES if !PREEMPT_RT
  1296. select DEBUG_RT_MUTEXES if PREEMPT_RT
  1297. help
  1298. This feature enables slowpath testing for w/w mutex users by
  1299. injecting additional -EDEADLK wound/backoff cases. Together with
  1300. the full mutex checks enabled with (CONFIG_PROVE_LOCKING) this
  1301. will test all possible w/w mutex interface abuse with the
  1302. exception of simply not acquiring all the required locks.
  1303. Note that this feature can introduce significant overhead, so
  1304. it really should not be enabled in a production or distro kernel,
  1305. even a debug kernel. If you are a driver writer, enable it. If
  1306. you are a distro, do not.
  1307. config DEBUG_RWSEMS
  1308. bool "RW Semaphore debugging: basic checks"
  1309. depends on DEBUG_KERNEL && !PREEMPT_RT
  1310. help
  1311. This debugging feature allows mismatched rw semaphore locks
  1312. and unlocks to be detected and reported.
  1313. config DEBUG_LOCK_ALLOC
  1314. bool "Lock debugging: detect incorrect freeing of live locks"
  1315. depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
  1316. select DEBUG_SPINLOCK
  1317. select DEBUG_MUTEXES if !PREEMPT_RT
  1318. select DEBUG_RT_MUTEXES if RT_MUTEXES
  1319. select LOCKDEP
  1320. help
  1321. This feature will check whether any held lock (spinlock, rwlock,
  1322. mutex or rwsem) is incorrectly freed by the kernel, via any of the
  1323. memory-freeing routines (kfree(), kmem_cache_free(), free_pages(),
  1324. vfree(), etc.), whether a live lock is incorrectly reinitialized via
  1325. spin_lock_init()/mutex_init()/etc., or whether there is any lock
  1326. held during task exit.
  1327. config LOCKDEP
  1328. bool
  1329. depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
  1330. select STACKTRACE
  1331. select KALLSYMS
  1332. select KALLSYMS_ALL
  1333. config LOCKDEP_SMALL
  1334. bool
  1335. config LOCKDEP_BITS
  1336. int "Size for MAX_LOCKDEP_ENTRIES (as Nth power of 2)"
  1337. depends on LOCKDEP && !LOCKDEP_SMALL
  1338. range 10 24
  1339. default 15
  1340. help
  1341. Try increasing this value if you hit "BUG: MAX_LOCKDEP_ENTRIES too low!" message.
  1342. config LOCKDEP_CHAINS_BITS
  1343. int "Size for MAX_LOCKDEP_CHAINS (as Nth power of 2)"
  1344. depends on LOCKDEP && !LOCKDEP_SMALL
  1345. range 10 21
  1346. default 16
  1347. help
  1348. Try increasing this value if you hit "BUG: MAX_LOCKDEP_CHAINS too low!" message.
  1349. config LOCKDEP_STACK_TRACE_BITS
  1350. int "Size for MAX_STACK_TRACE_ENTRIES (as Nth power of 2)"
  1351. depends on LOCKDEP && !LOCKDEP_SMALL
  1352. range 10 26
  1353. default 19
  1354. help
  1355. Try increasing this value if you hit "BUG: MAX_STACK_TRACE_ENTRIES too low!" message.
  1356. config LOCKDEP_STACK_TRACE_HASH_BITS
  1357. int "Size for STACK_TRACE_HASH_SIZE (as Nth power of 2)"
  1358. depends on LOCKDEP && !LOCKDEP_SMALL
  1359. range 10 26
  1360. default 14
  1361. help
  1362. Try increasing this value if you need large STACK_TRACE_HASH_SIZE.
  1363. config LOCKDEP_CIRCULAR_QUEUE_BITS
  1364. int "Size for elements in circular_queue struct (as Nth power of 2)"
  1365. depends on LOCKDEP
  1366. range 10 26
  1367. default 12
  1368. help
  1369. Try increasing this value if you hit "lockdep bfs error:-1" warning due to __cq_enqueue() failure.
  1370. config DEBUG_LOCKDEP
  1371. bool "Lock dependency engine debugging"
  1372. depends on DEBUG_KERNEL && LOCKDEP
  1373. select DEBUG_IRQFLAGS
  1374. help
  1375. If you say Y here, the lock dependency engine will do
  1376. additional runtime checks to debug itself, at the price
  1377. of more runtime overhead.
  1378. config DEBUG_ATOMIC_SLEEP
  1379. bool "Sleep inside atomic section checking"
  1380. select PREEMPT_COUNT
  1381. depends on DEBUG_KERNEL
  1382. depends on !ARCH_NO_PREEMPT
  1383. help
  1384. If you say Y here, various routines which may sleep will become very
  1385. noisy if they are called inside atomic sections: when a spinlock is
  1386. held, inside an rcu read side critical section, inside preempt disabled
  1387. sections, inside an interrupt, etc...
  1388. config DEBUG_LOCKING_API_SELFTESTS
  1389. bool "Locking API boot-time self-tests"
  1390. depends on DEBUG_KERNEL
  1391. help
  1392. Say Y here if you want the kernel to run a short self-test during
  1393. bootup. The self-test checks whether common types of locking bugs
  1394. are detected by debugging mechanisms or not. (if you disable
  1395. lock debugging then those bugs won't be detected of course.)
  1396. The following locking APIs are covered: spinlocks, rwlocks,
  1397. mutexes and rwsems.
  1398. config LOCK_TORTURE_TEST
  1399. tristate "torture tests for locking"
  1400. depends on DEBUG_KERNEL
  1401. select TORTURE_TEST
  1402. help
  1403. This option provides a kernel module that runs torture tests
  1404. on kernel locking primitives. The kernel module may be built
  1405. after the fact on the running kernel to be tested, if desired.
  1406. Say Y here if you want kernel locking-primitive torture tests
  1407. to be built into the kernel.
  1408. Say M if you want these torture tests to build as a module.
  1409. Say N if you are unsure.
  1410. config WW_MUTEX_SELFTEST
  1411. tristate "Wait/wound mutex selftests"
  1412. help
  1413. This option provides a kernel module that runs tests on the
  1414. on the struct ww_mutex locking API.
  1415. It is recommended to enable DEBUG_WW_MUTEX_SLOWPATH in conjunction
  1416. with this test harness.
  1417. Say M if you want these self tests to build as a module.
  1418. Say N if you are unsure.
  1419. config SCF_TORTURE_TEST
  1420. tristate "torture tests for smp_call_function*()"
  1421. depends on DEBUG_KERNEL
  1422. select TORTURE_TEST
  1423. help
  1424. This option provides a kernel module that runs torture tests
  1425. on the smp_call_function() family of primitives. The kernel
  1426. module may be built after the fact on the running kernel to
  1427. be tested, if desired.
  1428. config CSD_LOCK_WAIT_DEBUG
  1429. bool "Debugging for csd_lock_wait(), called from smp_call_function*()"
  1430. depends on DEBUG_KERNEL
  1431. depends on SMP
  1432. depends on 64BIT
  1433. default n
  1434. help
  1435. This option enables debug prints when CPUs are slow to respond
  1436. to the smp_call_function*() IPI wrappers. These debug prints
  1437. include the IPI handler function currently executing (if any)
  1438. and relevant stack traces.
  1439. config CSD_LOCK_WAIT_DEBUG_DEFAULT
  1440. bool "Default csd_lock_wait() debugging on at boot time"
  1441. depends on CSD_LOCK_WAIT_DEBUG
  1442. depends on 64BIT
  1443. default n
  1444. help
  1445. This option causes the csdlock_debug= kernel boot parameter to
  1446. default to 1 (basic debugging) instead of 0 (no debugging).
  1447. endmenu # lock debugging
  1448. config TRACE_IRQFLAGS
  1449. depends on TRACE_IRQFLAGS_SUPPORT
  1450. bool
  1451. help
  1452. Enables hooks to interrupt enabling and disabling for
  1453. either tracing or lock debugging.
  1454. config TRACE_IRQFLAGS_NMI
  1455. def_bool y
  1456. depends on TRACE_IRQFLAGS
  1457. depends on TRACE_IRQFLAGS_NMI_SUPPORT
  1458. config NMI_CHECK_CPU
  1459. bool "Debugging for CPUs failing to respond to backtrace requests"
  1460. depends on DEBUG_KERNEL
  1461. depends on X86
  1462. default n
  1463. help
  1464. Enables debug prints when a CPU fails to respond to a given
  1465. backtrace NMI. These prints provide some reasons why a CPU
  1466. might legitimately be failing to respond, for example, if it
  1467. is offline of if ignore_nmis is set.
  1468. config DEBUG_IRQFLAGS
  1469. bool "Debug IRQ flag manipulation"
  1470. help
  1471. Enables checks for potentially unsafe enabling or disabling of
  1472. interrupts, such as calling raw_local_irq_restore() when interrupts
  1473. are enabled.
  1474. config STACKTRACE
  1475. bool "Stack backtrace support"
  1476. depends on STACKTRACE_SUPPORT
  1477. help
  1478. This option causes the kernel to create a /proc/pid/stack for
  1479. every process, showing its current stack trace.
  1480. It is also used by various kernel debugging features that require
  1481. stack trace generation.
  1482. config DEBUG_KOBJECT
  1483. bool "kobject debugging"
  1484. depends on DEBUG_KERNEL
  1485. help
  1486. If you say Y here, some extra kobject debugging messages will be sent
  1487. to the syslog.
  1488. config DEBUG_KOBJECT_RELEASE
  1489. bool "kobject release debugging"
  1490. depends on DEBUG_OBJECTS_TIMERS
  1491. help
  1492. kobjects are reference counted objects. This means that their
  1493. last reference count put is not predictable, and the kobject can
  1494. live on past the point at which a driver decides to drop its
  1495. initial reference to the kobject gained on allocation. An
  1496. example of this would be a struct device which has just been
  1497. unregistered.
  1498. However, some buggy drivers assume that after such an operation,
  1499. the memory backing the kobject can be immediately freed. This
  1500. goes completely against the principles of a refcounted object.
  1501. If you say Y here, the kernel will delay the release of kobjects
  1502. on the last reference count to improve the visibility of this
  1503. kind of kobject release bug.
  1504. config HAVE_DEBUG_BUGVERBOSE
  1505. bool
  1506. menu "Debug kernel data structures"
  1507. config DEBUG_LIST
  1508. bool "Debug linked list manipulation"
  1509. depends on DEBUG_KERNEL
  1510. select LIST_HARDENED
  1511. help
  1512. Enable this to turn on extended checks in the linked-list walking
  1513. routines.
  1514. This option trades better quality error reports for performance, and
  1515. is more suitable for kernel debugging. If you care about performance,
  1516. you should only enable CONFIG_LIST_HARDENED instead.
  1517. If unsure, say N.
  1518. config DEBUG_PLIST
  1519. bool "Debug priority linked list manipulation"
  1520. depends on DEBUG_KERNEL
  1521. help
  1522. Enable this to turn on extended checks in the priority-ordered
  1523. linked-list (plist) walking routines. This checks the entire
  1524. list multiple times during each manipulation.
  1525. If unsure, say N.
  1526. config DEBUG_SG
  1527. bool "Debug SG table operations"
  1528. depends on DEBUG_KERNEL
  1529. help
  1530. Enable this to turn on checks on scatter-gather tables. This can
  1531. help find problems with drivers that do not properly initialize
  1532. their sg tables.
  1533. If unsure, say N.
  1534. config DEBUG_NOTIFIERS
  1535. bool "Debug notifier call chains"
  1536. depends on DEBUG_KERNEL
  1537. help
  1538. Enable this to turn on sanity checking for notifier call chains.
  1539. This is most useful for kernel developers to make sure that
  1540. modules properly unregister themselves from notifier chains.
  1541. This is a relatively cheap check but if you care about maximum
  1542. performance, say N.
  1543. config DEBUG_CLOSURES
  1544. bool "Debug closures (bcache async widgits)"
  1545. depends on CLOSURES
  1546. select DEBUG_FS
  1547. help
  1548. Keeps all active closures in a linked list and provides a debugfs
  1549. interface to list them, which makes it possible to see asynchronous
  1550. operations that get stuck.
  1551. config DEBUG_MAPLE_TREE
  1552. bool "Debug maple trees"
  1553. depends on DEBUG_KERNEL
  1554. help
  1555. Enable maple tree debugging information and extra validations.
  1556. If unsure, say N.
  1557. endmenu
  1558. source "kernel/rcu/Kconfig.debug"
  1559. config DEBUG_WQ_FORCE_RR_CPU
  1560. bool "Force round-robin CPU selection for unbound work items"
  1561. depends on DEBUG_KERNEL
  1562. default n
  1563. help
  1564. Workqueue used to implicitly guarantee that work items queued
  1565. without explicit CPU specified are put on the local CPU. This
  1566. guarantee is no longer true and while local CPU is still
  1567. preferred work items may be put on foreign CPUs. Kernel
  1568. parameter "workqueue.debug_force_rr_cpu" is added to force
  1569. round-robin CPU selection to flush out usages which depend on the
  1570. now broken guarantee. This config option enables the debug
  1571. feature by default. When enabled, memory and cache locality will
  1572. be impacted.
  1573. config CPU_HOTPLUG_STATE_CONTROL
  1574. bool "Enable CPU hotplug state control"
  1575. depends on DEBUG_KERNEL
  1576. depends on HOTPLUG_CPU
  1577. default n
  1578. help
  1579. Allows to write steps between "offline" and "online" to the CPUs
  1580. sysfs target file so states can be stepped granular. This is a debug
  1581. option for now as the hotplug machinery cannot be stopped and
  1582. restarted at arbitrary points yet.
  1583. Say N if your are unsure.
  1584. config LATENCYTOP
  1585. bool "Latency measuring infrastructure"
  1586. depends on DEBUG_KERNEL
  1587. depends on STACKTRACE_SUPPORT
  1588. depends on PROC_FS
  1589. depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
  1590. select KALLSYMS
  1591. select KALLSYMS_ALL
  1592. select STACKTRACE
  1593. select SCHEDSTATS
  1594. help
  1595. Enable this option if you want to use the LatencyTOP tool
  1596. to find out which userspace is blocking on what kernel operations.
  1597. config DEBUG_CGROUP_REF
  1598. bool "Disable inlining of cgroup css reference count functions"
  1599. depends on DEBUG_KERNEL
  1600. depends on CGROUPS
  1601. depends on KPROBES
  1602. default n
  1603. help
  1604. Force cgroup css reference count functions to not be inlined so
  1605. that they can be kprobed for debugging.
  1606. source "kernel/trace/Kconfig"
  1607. config PROVIDE_OHCI1394_DMA_INIT
  1608. bool "Remote debugging over FireWire early on boot"
  1609. depends on PCI && X86
  1610. help
  1611. If you want to debug problems which hang or crash the kernel early
  1612. on boot and the crashing machine has a FireWire port, you can use
  1613. this feature to remotely access the memory of the crashed machine
  1614. over FireWire. This employs remote DMA as part of the OHCI1394
  1615. specification which is now the standard for FireWire controllers.
  1616. With remote DMA, you can monitor the printk buffer remotely using
  1617. firescope and access all memory below 4GB using fireproxy from gdb.
  1618. Even controlling a kernel debugger is possible using remote DMA.
  1619. Usage:
  1620. If ohci1394_dma=early is used as boot parameter, it will initialize
  1621. all OHCI1394 controllers which are found in the PCI config space.
  1622. As all changes to the FireWire bus such as enabling and disabling
  1623. devices cause a bus reset and thereby disable remote DMA for all
  1624. devices, be sure to have the cable plugged and FireWire enabled on
  1625. the debugging host before booting the debug target for debugging.
  1626. This code (~1k) is freed after boot. By then, the firewire stack
  1627. in charge of the OHCI-1394 controllers should be used instead.
  1628. See Documentation/core-api/debugging-via-ohci1394.rst for more information.
  1629. source "samples/Kconfig"
  1630. config ARCH_HAS_DEVMEM_IS_ALLOWED
  1631. bool
  1632. config STRICT_DEVMEM
  1633. bool "Filter access to /dev/mem"
  1634. depends on MMU && DEVMEM
  1635. depends on ARCH_HAS_DEVMEM_IS_ALLOWED || GENERIC_LIB_DEVMEM_IS_ALLOWED
  1636. default y if PPC || X86 || ARM64 || S390
  1637. help
  1638. If this option is disabled, you allow userspace (root) access to all
  1639. of memory, including kernel and userspace memory. Accidental
  1640. access to this is obviously disastrous, but specific access can
  1641. be used by people debugging the kernel. Note that with PAT support
  1642. enabled, even in this case there are restrictions on /dev/mem
  1643. use due to the cache aliasing requirements.
  1644. If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
  1645. file only allows userspace access to PCI space and the BIOS code and
  1646. data regions. This is sufficient for dosemu and X and all common
  1647. users of /dev/mem.
  1648. If in doubt, say Y.
  1649. config IO_STRICT_DEVMEM
  1650. bool "Filter I/O access to /dev/mem"
  1651. depends on STRICT_DEVMEM
  1652. help
  1653. If this option is disabled, you allow userspace (root) access to all
  1654. io-memory regardless of whether a driver is actively using that
  1655. range. Accidental access to this is obviously disastrous, but
  1656. specific access can be used by people debugging kernel drivers.
  1657. If this option is switched on, the /dev/mem file only allows
  1658. userspace access to *idle* io-memory ranges (see /proc/iomem) This
  1659. may break traditional users of /dev/mem (dosemu, legacy X, etc...)
  1660. if the driver using a given range cannot be disabled.
  1661. If in doubt, say Y.
  1662. menu "$(SRCARCH) Debugging"
  1663. source "arch/$(SRCARCH)/Kconfig.debug"
  1664. endmenu
  1665. menu "Kernel Testing and Coverage"
  1666. source "lib/kunit/Kconfig"
  1667. config NOTIFIER_ERROR_INJECTION
  1668. tristate "Notifier error injection"
  1669. depends on DEBUG_KERNEL
  1670. select DEBUG_FS
  1671. help
  1672. This option provides the ability to inject artificial errors to
  1673. specified notifier chain callbacks. It is useful to test the error
  1674. handling of notifier call chain failures.
  1675. Say N if unsure.
  1676. config PM_NOTIFIER_ERROR_INJECT
  1677. tristate "PM notifier error injection module"
  1678. depends on PM && NOTIFIER_ERROR_INJECTION
  1679. default m if PM_DEBUG
  1680. help
  1681. This option provides the ability to inject artificial errors to
  1682. PM notifier chain callbacks. It is controlled through debugfs
  1683. interface /sys/kernel/debug/notifier-error-inject/pm
  1684. If the notifier call chain should be failed with some events
  1685. notified, write the error code to "actions/<notifier event>/error".
  1686. Example: Inject PM suspend error (-12 = -ENOMEM)
  1687. # cd /sys/kernel/debug/notifier-error-inject/pm/
  1688. # echo -12 > actions/PM_SUSPEND_PREPARE/error
  1689. # echo mem > /sys/power/state
  1690. bash: echo: write error: Cannot allocate memory
  1691. To compile this code as a module, choose M here: the module will
  1692. be called pm-notifier-error-inject.
  1693. If unsure, say N.
  1694. config OF_RECONFIG_NOTIFIER_ERROR_INJECT
  1695. tristate "OF reconfig notifier error injection module"
  1696. depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION
  1697. help
  1698. This option provides the ability to inject artificial errors to
  1699. OF reconfig notifier chain callbacks. It is controlled
  1700. through debugfs interface under
  1701. /sys/kernel/debug/notifier-error-inject/OF-reconfig/
  1702. If the notifier call chain should be failed with some events
  1703. notified, write the error code to "actions/<notifier event>/error".
  1704. To compile this code as a module, choose M here: the module will
  1705. be called of-reconfig-notifier-error-inject.
  1706. If unsure, say N.
  1707. config NETDEV_NOTIFIER_ERROR_INJECT
  1708. tristate "Netdev notifier error injection module"
  1709. depends on NET && NOTIFIER_ERROR_INJECTION
  1710. help
  1711. This option provides the ability to inject artificial errors to
  1712. netdevice notifier chain callbacks. It is controlled through debugfs
  1713. interface /sys/kernel/debug/notifier-error-inject/netdev
  1714. If the notifier call chain should be failed with some events
  1715. notified, write the error code to "actions/<notifier event>/error".
  1716. Example: Inject netdevice mtu change error (-22 = -EINVAL)
  1717. # cd /sys/kernel/debug/notifier-error-inject/netdev
  1718. # echo -22 > actions/NETDEV_CHANGEMTU/error
  1719. # ip link set eth0 mtu 1024
  1720. RTNETLINK answers: Invalid argument
  1721. To compile this code as a module, choose M here: the module will
  1722. be called netdev-notifier-error-inject.
  1723. If unsure, say N.
  1724. config FUNCTION_ERROR_INJECTION
  1725. bool "Fault-injections of functions"
  1726. depends on HAVE_FUNCTION_ERROR_INJECTION && KPROBES
  1727. help
  1728. Add fault injections into various functions that are annotated with
  1729. ALLOW_ERROR_INJECTION() in the kernel. BPF may also modify the return
  1730. value of these functions. This is useful to test error paths of code.
  1731. If unsure, say N
  1732. config FAULT_INJECTION
  1733. bool "Fault-injection framework"
  1734. depends on DEBUG_KERNEL
  1735. help
  1736. Provide fault-injection framework.
  1737. For more details, see Documentation/fault-injection/.
  1738. config FAILSLAB
  1739. bool "Fault-injection capability for kmalloc"
  1740. depends on FAULT_INJECTION
  1741. help
  1742. Provide fault-injection capability for kmalloc.
  1743. config FAIL_PAGE_ALLOC
  1744. bool "Fault-injection capability for alloc_pages()"
  1745. depends on FAULT_INJECTION
  1746. help
  1747. Provide fault-injection capability for alloc_pages().
  1748. config FAULT_INJECTION_USERCOPY
  1749. bool "Fault injection capability for usercopy functions"
  1750. depends on FAULT_INJECTION
  1751. help
  1752. Provides fault-injection capability to inject failures
  1753. in usercopy functions (copy_from_user(), get_user(), ...).
  1754. config FAIL_MAKE_REQUEST
  1755. bool "Fault-injection capability for disk IO"
  1756. depends on FAULT_INJECTION && BLOCK
  1757. help
  1758. Provide fault-injection capability for disk IO.
  1759. config FAIL_IO_TIMEOUT
  1760. bool "Fault-injection capability for faking disk interrupts"
  1761. depends on FAULT_INJECTION && BLOCK
  1762. help
  1763. Provide fault-injection capability on end IO handling. This
  1764. will make the block layer "forget" an interrupt as configured,
  1765. thus exercising the error handling.
  1766. Only works with drivers that use the generic timeout handling,
  1767. for others it won't do anything.
  1768. config FAIL_FUTEX
  1769. bool "Fault-injection capability for futexes"
  1770. select DEBUG_FS
  1771. depends on FAULT_INJECTION && FUTEX
  1772. help
  1773. Provide fault-injection capability for futexes.
  1774. config FAULT_INJECTION_DEBUG_FS
  1775. bool "Debugfs entries for fault-injection capabilities"
  1776. depends on FAULT_INJECTION && SYSFS && DEBUG_FS
  1777. help
  1778. Enable configuration of fault-injection capabilities via debugfs.
  1779. config FAIL_FUNCTION
  1780. bool "Fault-injection capability for functions"
  1781. depends on FAULT_INJECTION_DEBUG_FS && FUNCTION_ERROR_INJECTION
  1782. help
  1783. Provide function-based fault-injection capability.
  1784. This will allow you to override a specific function with a return
  1785. with given return value. As a result, function caller will see
  1786. an error value and have to handle it. This is useful to test the
  1787. error handling in various subsystems.
  1788. config FAIL_MMC_REQUEST
  1789. bool "Fault-injection capability for MMC IO"
  1790. depends on FAULT_INJECTION_DEBUG_FS && MMC
  1791. help
  1792. Provide fault-injection capability for MMC IO.
  1793. This will make the mmc core return data errors. This is
  1794. useful to test the error handling in the mmc block device
  1795. and to test how the mmc host driver handles retries from
  1796. the block device.
  1797. config FAIL_SUNRPC
  1798. bool "Fault-injection capability for SunRPC"
  1799. depends on FAULT_INJECTION_DEBUG_FS && SUNRPC_DEBUG
  1800. help
  1801. Provide fault-injection capability for SunRPC and
  1802. its consumers.
  1803. config FAIL_SKB_REALLOC
  1804. bool "Fault-injection capability forcing skb to reallocate"
  1805. depends on FAULT_INJECTION_DEBUG_FS
  1806. help
  1807. Provide fault-injection capability that forces the skb to be
  1808. reallocated, catching possible invalid pointers to the skb.
  1809. For more information, check
  1810. Documentation/fault-injection/fault-injection.rst
  1811. config FAULT_INJECTION_CONFIGFS
  1812. bool "Configfs interface for fault-injection capabilities"
  1813. depends on FAULT_INJECTION
  1814. select CONFIGFS_FS
  1815. help
  1816. This option allows configfs-based drivers to dynamically configure
  1817. fault-injection via configfs. Each parameter for driver-specific
  1818. fault-injection can be made visible as a configfs attribute in a
  1819. configfs group.
  1820. config FAULT_INJECTION_STACKTRACE_FILTER
  1821. bool "stacktrace filter for fault-injection capabilities"
  1822. depends on FAULT_INJECTION
  1823. depends on (FAULT_INJECTION_DEBUG_FS || FAULT_INJECTION_CONFIGFS) && STACKTRACE_SUPPORT
  1824. select STACKTRACE
  1825. depends on FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86
  1826. help
  1827. Provide stacktrace filter for fault-injection capabilities
  1828. config ARCH_HAS_KCOV
  1829. bool
  1830. help
  1831. An architecture should select this when it can successfully
  1832. build and run with CONFIG_KCOV. This typically requires
  1833. disabling instrumentation for some early boot code.
  1834. config KCOV
  1835. bool "Code coverage for fuzzing"
  1836. depends on ARCH_HAS_KCOV
  1837. depends on !ARCH_WANTS_NO_INSTR || HAVE_NOINSTR_HACK || \
  1838. GCC_VERSION >= 120000 || CC_IS_CLANG
  1839. select DEBUG_FS
  1840. select OBJTOOL if HAVE_NOINSTR_HACK
  1841. help
  1842. KCOV exposes kernel code coverage information in a form suitable
  1843. for coverage-guided fuzzing (randomized testing).
  1844. For more details, see Documentation/dev-tools/kcov.rst.
  1845. config KCOV_ENABLE_COMPARISONS
  1846. bool "Enable comparison operands collection by KCOV"
  1847. depends on KCOV
  1848. depends on $(cc-option,-fsanitize-coverage=trace-cmp)
  1849. help
  1850. KCOV also exposes operands of every comparison in the instrumented
  1851. code along with operand sizes and PCs of the comparison instructions.
  1852. These operands can be used by fuzzing engines to improve the quality
  1853. of fuzzing coverage.
  1854. config KCOV_INSTRUMENT_ALL
  1855. bool "Instrument all code by default"
  1856. depends on KCOV
  1857. default y
  1858. help
  1859. If you are doing generic system call fuzzing (like e.g. syzkaller),
  1860. then you will want to instrument the whole kernel and you should
  1861. say y here. If you are doing more targeted fuzzing (like e.g.
  1862. filesystem fuzzing with AFL) then you will want to enable coverage
  1863. for more specific subsets of files, and should say n here.
  1864. config KCOV_IRQ_AREA_SIZE
  1865. hex "Size of interrupt coverage collection area in words"
  1866. depends on KCOV
  1867. default 0x40000
  1868. help
  1869. KCOV uses preallocated per-cpu areas to collect coverage from
  1870. soft interrupts. This specifies the size of those areas in the
  1871. number of unsigned long words.
  1872. config KCOV_SELFTEST
  1873. bool "Perform short selftests on boot"
  1874. depends on KCOV
  1875. help
  1876. Run short KCOV coverage collection selftests on boot.
  1877. On test failure, causes the kernel to panic. Recommended to be
  1878. enabled, ensuring critical functionality works as intended.
  1879. menuconfig RUNTIME_TESTING_MENU
  1880. bool "Runtime Testing"
  1881. default y
  1882. if RUNTIME_TESTING_MENU
  1883. config TEST_DHRY
  1884. tristate "Dhrystone benchmark test"
  1885. help
  1886. Enable this to include the Dhrystone 2.1 benchmark. This test
  1887. calculates the number of Dhrystones per second, and the number of
  1888. DMIPS (Dhrystone MIPS) obtained when the Dhrystone score is divided
  1889. by 1757 (the number of Dhrystones per second obtained on the VAX
  1890. 11/780, nominally a 1 MIPS machine).
  1891. To run the benchmark, it needs to be enabled explicitly, either from
  1892. the kernel command line (when built-in), or from userspace (when
  1893. built-in or modular).
  1894. Run once during kernel boot:
  1895. test_dhry.run
  1896. Set number of iterations from kernel command line:
  1897. test_dhry.iterations=<n>
  1898. Set number of iterations from userspace:
  1899. echo <n> > /sys/module/test_dhry/parameters/iterations
  1900. Trigger manual run from userspace:
  1901. echo y > /sys/module/test_dhry/parameters/run
  1902. If the number of iterations is <= 0, the test will devise a suitable
  1903. number of iterations (test runs for at least 2s) automatically.
  1904. This process takes ca. 4s.
  1905. If unsure, say N.
  1906. config LKDTM
  1907. tristate "Linux Kernel Dump Test Tool Module"
  1908. depends on DEBUG_FS
  1909. help
  1910. This module enables testing of the different dumping mechanisms by
  1911. inducing system failures at predefined crash points.
  1912. If you don't need it: say N
  1913. Choose M here to compile this code as a module. The module will be
  1914. called lkdtm.
  1915. Documentation on how to use the module can be found in
  1916. Documentation/fault-injection/provoke-crashes.rst
  1917. config CPUMASK_KUNIT_TEST
  1918. tristate "KUnit test for cpumask" if !KUNIT_ALL_TESTS
  1919. depends on KUNIT
  1920. default KUNIT_ALL_TESTS
  1921. help
  1922. Enable to turn on cpumask tests, running at boot or module load time.
  1923. For more information on KUnit and unit tests in general, please refer
  1924. to the KUnit documentation in Documentation/dev-tools/kunit/.
  1925. If unsure, say N.
  1926. config TEST_LIST_SORT
  1927. tristate "Linked list sorting test" if !KUNIT_ALL_TESTS
  1928. depends on KUNIT
  1929. default KUNIT_ALL_TESTS
  1930. help
  1931. Enable this to turn on 'list_sort()' function test. This test is
  1932. executed only once during system boot (so affects only boot time),
  1933. or at module load time.
  1934. If unsure, say N.
  1935. config TEST_SORT
  1936. tristate "Array-based sort test" if !KUNIT_ALL_TESTS
  1937. depends on KUNIT
  1938. default KUNIT_ALL_TESTS
  1939. help
  1940. This option enables the self-test function of 'sort()' at boot,
  1941. or at module load time.
  1942. If unsure, say N.
  1943. config TEST_DIV64
  1944. tristate "64bit/32bit division and modulo test"
  1945. depends on DEBUG_KERNEL || m
  1946. help
  1947. Enable this to turn on 'do_div()' function test. This test is
  1948. executed only once during system boot (so affects only boot time),
  1949. or at module load time.
  1950. If unsure, say N.
  1951. config TEST_MULDIV64
  1952. tristate "mul_u64_u64_div_u64() test"
  1953. depends on DEBUG_KERNEL || m
  1954. help
  1955. Enable this to turn on 'mul_u64_u64_div_u64()' function test.
  1956. This test is executed only once during system boot (so affects
  1957. only boot time), or at module load time.
  1958. If unsure, say N.
  1959. config TEST_IOV_ITER
  1960. tristate "Test iov_iter operation" if !KUNIT_ALL_TESTS
  1961. depends on KUNIT
  1962. depends on MMU
  1963. default KUNIT_ALL_TESTS
  1964. help
  1965. Enable this to turn on testing of the operation of the I/O iterator
  1966. (iov_iter). This test is executed only once during system boot (so
  1967. affects only boot time), or at module load time.
  1968. If unsure, say N.
  1969. config KPROBES_SANITY_TEST
  1970. tristate "Kprobes sanity tests" if !KUNIT_ALL_TESTS
  1971. depends on DEBUG_KERNEL
  1972. depends on KPROBES
  1973. depends on KUNIT
  1974. select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
  1975. default KUNIT_ALL_TESTS
  1976. help
  1977. This option provides for testing basic kprobes functionality on
  1978. boot. Samples of kprobe and kretprobe are inserted and
  1979. verified for functionality.
  1980. Say N if you are unsure.
  1981. config FPROBE_SANITY_TEST
  1982. bool "Self test for fprobe"
  1983. depends on DEBUG_KERNEL
  1984. depends on FPROBE
  1985. depends on KUNIT=y
  1986. help
  1987. This option will enable testing the fprobe when the system boot.
  1988. A series of tests are made to verify that the fprobe is functioning
  1989. properly.
  1990. Say N if you are unsure.
  1991. config BACKTRACE_SELF_TEST
  1992. tristate "Self test for the backtrace code"
  1993. depends on DEBUG_KERNEL
  1994. help
  1995. This option provides a kernel module that can be used to test
  1996. the kernel stack backtrace code. This option is not useful
  1997. for distributions or general kernels, but only for kernel
  1998. developers working on architecture code.
  1999. Note that if you want to also test saved backtraces, you will
  2000. have to enable STACKTRACE as well.
  2001. Say N if you are unsure.
  2002. config TEST_REF_TRACKER
  2003. tristate "Self test for reference tracker"
  2004. depends on DEBUG_KERNEL && STACKTRACE_SUPPORT
  2005. select REF_TRACKER
  2006. help
  2007. This option provides a kernel module performing tests
  2008. using reference tracker infrastructure.
  2009. Say N if you are unsure.
  2010. config RBTREE_TEST
  2011. tristate "Red-Black tree test"
  2012. depends on DEBUG_KERNEL
  2013. help
  2014. A benchmark measuring the performance of the rbtree library.
  2015. Also includes rbtree invariant checks.
  2016. config REED_SOLOMON_TEST
  2017. tristate "Reed-Solomon library test"
  2018. depends on DEBUG_KERNEL || m
  2019. select REED_SOLOMON
  2020. select REED_SOLOMON_ENC16
  2021. select REED_SOLOMON_DEC16
  2022. help
  2023. This option enables the self-test function of rslib at boot,
  2024. or at module load time.
  2025. If unsure, say N.
  2026. config INTERVAL_TREE_TEST
  2027. tristate "Interval tree test"
  2028. depends on DEBUG_KERNEL
  2029. select INTERVAL_TREE
  2030. help
  2031. A benchmark measuring the performance of the interval tree library
  2032. config PERCPU_TEST
  2033. tristate "Per cpu operations test"
  2034. depends on m && DEBUG_KERNEL
  2035. help
  2036. Enable this option to build test module which validates per-cpu
  2037. operations.
  2038. If unsure, say N.
  2039. config ATOMIC64_SELFTEST
  2040. tristate "Perform an atomic64_t self-test"
  2041. help
  2042. Enable this option to test the atomic64_t functions at boot or
  2043. at module load time.
  2044. If unsure, say N.
  2045. config ASYNC_RAID6_TEST
  2046. tristate "Self test for hardware accelerated raid6 recovery"
  2047. depends on ASYNC_RAID6_RECOV
  2048. select ASYNC_MEMCPY
  2049. help
  2050. This is a one-shot self test that permutes through the
  2051. recovery of all the possible two disk failure scenarios for a
  2052. N-disk array. Recovery is performed with the asynchronous
  2053. raid6 recovery routines, and will optionally use an offload
  2054. engine if one is available.
  2055. If unsure, say N.
  2056. config TEST_HEXDUMP
  2057. tristate "Test functions located in the hexdump module at runtime"
  2058. config PRINTF_KUNIT_TEST
  2059. tristate "KUnit test printf() family of functions at runtime" if !KUNIT_ALL_TESTS
  2060. depends on KUNIT
  2061. default KUNIT_ALL_TESTS
  2062. help
  2063. Enable this option to test the printf functions at runtime.
  2064. If unsure, say N.
  2065. config SCANF_KUNIT_TEST
  2066. tristate "KUnit test scanf() family of functions at runtime" if !KUNIT_ALL_TESTS
  2067. depends on KUNIT
  2068. default KUNIT_ALL_TESTS
  2069. help
  2070. Enable this option to test the scanf functions at runtime.
  2071. If unsure, say N.
  2072. config SEQ_BUF_KUNIT_TEST
  2073. tristate "KUnit test for seq_buf" if !KUNIT_ALL_TESTS
  2074. depends on KUNIT
  2075. default KUNIT_ALL_TESTS
  2076. help
  2077. This builds unit tests for the seq_buf library.
  2078. If unsure, say N.
  2079. config STRING_KUNIT_TEST
  2080. tristate "KUnit test string functions at runtime" if !KUNIT_ALL_TESTS
  2081. depends on KUNIT
  2082. default KUNIT_ALL_TESTS
  2083. config STRING_HELPERS_KUNIT_TEST
  2084. tristate "KUnit test string helpers at runtime" if !KUNIT_ALL_TESTS
  2085. depends on KUNIT
  2086. default KUNIT_ALL_TESTS
  2087. config FFS_KUNIT_TEST
  2088. tristate "KUnit test ffs-family functions at runtime" if !KUNIT_ALL_TESTS
  2089. depends on KUNIT
  2090. default KUNIT_ALL_TESTS
  2091. help
  2092. This builds KUnit tests for ffs-family bit manipulation functions
  2093. including ffs(), __ffs(), fls(), __fls(), fls64(), and __ffs64().
  2094. These tests validate mathematical correctness, edge case handling,
  2095. and cross-architecture consistency of bit scanning functions.
  2096. For more information on KUnit and unit tests in general,
  2097. please refer to Documentation/dev-tools/kunit/.
  2098. config TEST_KSTRTOX
  2099. tristate "Test kstrto*() family of functions at runtime"
  2100. config TEST_BITMAP
  2101. tristate "Test bitmap_*() family of functions at runtime"
  2102. help
  2103. Enable this option to test the bitmap functions at boot.
  2104. If unsure, say N.
  2105. config TEST_XARRAY
  2106. tristate "Test the XArray code at runtime"
  2107. config TEST_MAPLE_TREE
  2108. tristate "Test the Maple Tree code at runtime or module load"
  2109. help
  2110. Enable this option to test the maple tree code functions at boot, or
  2111. when the module is loaded. Enable "Debug Maple Trees" will enable
  2112. more verbose output on failures.
  2113. If unsure, say N.
  2114. config TEST_RHASHTABLE
  2115. tristate "Perform selftest on resizable hash table"
  2116. help
  2117. Enable this option to test the rhashtable functions at boot.
  2118. If unsure, say N.
  2119. config TEST_IDA
  2120. tristate "Perform selftest on IDA functions"
  2121. config TEST_MISC_MINOR
  2122. bool "miscdevice KUnit test" if !KUNIT_ALL_TESTS
  2123. depends on KUNIT=y
  2124. default KUNIT_ALL_TESTS
  2125. help
  2126. Kunit test for miscdevice API, specially its behavior in respect to
  2127. static and dynamic minor numbers.
  2128. KUnit tests run during boot and output the results to the debug log
  2129. in TAP format (https://testanything.org/). Only useful for kernel devs
  2130. running the KUnit test harness, and not intended for inclusion into a
  2131. production build.
  2132. For more information on KUnit and unit tests in general please refer
  2133. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2134. If unsure, say N.
  2135. config TEST_PARMAN
  2136. tristate "Perform selftest on priority array manager"
  2137. depends on PARMAN
  2138. help
  2139. Enable this option to test priority array manager on boot
  2140. (or module load).
  2141. If unsure, say N.
  2142. config TEST_LKM
  2143. tristate "Test module loading with 'hello world' module"
  2144. depends on m
  2145. help
  2146. This builds the "test_module" module that emits "Hello, world"
  2147. on printk when loaded. It is designed to be used for basic
  2148. evaluation of the module loading subsystem (for example when
  2149. validating module verification). It lacks any extra dependencies,
  2150. and will not normally be loaded by the system unless explicitly
  2151. requested by name.
  2152. If unsure, say N.
  2153. config TEST_BITOPS
  2154. tristate "Test module for compilation of bitops operations"
  2155. help
  2156. This builds the "test_bitops" module that is much like the
  2157. TEST_LKM module except that it does a basic exercise of the
  2158. set/clear_bit macros and get_count_order/long to make sure there are
  2159. no compiler warnings from C=1 sparse checker or -Wextra
  2160. compilations. It has no dependencies and doesn't run or load unless
  2161. explicitly requested by name. for example: modprobe test_bitops.
  2162. If unsure, say N.
  2163. config TEST_VMALLOC
  2164. tristate "Test module for stress/performance analysis of vmalloc allocator"
  2165. default n
  2166. depends on MMU
  2167. help
  2168. This builds the "test_vmalloc" module that should be used for
  2169. stress and performance analysis. So, any new change for vmalloc
  2170. subsystem can be evaluated from performance and stability point
  2171. of view.
  2172. If unsure, say N.
  2173. config TEST_BPF
  2174. tristate "Test BPF filter functionality"
  2175. depends on m && NET
  2176. help
  2177. This builds the "test_bpf" module that runs various test vectors
  2178. against the BPF interpreter or BPF JIT compiler depending on the
  2179. current setting. This is in particular useful for BPF JIT compiler
  2180. development, but also to run regression tests against changes in
  2181. the interpreter code. It also enables test stubs for eBPF maps and
  2182. verifier used by user space verifier testsuite.
  2183. If unsure, say N.
  2184. config FIND_BIT_BENCHMARK
  2185. tristate "Test find_bit functions"
  2186. help
  2187. This builds the "test_find_bit" module that measure find_*_bit()
  2188. functions performance.
  2189. If unsure, say N.
  2190. config FIND_BIT_BENCHMARK_RUST
  2191. tristate "Test find_bit functions in Rust"
  2192. depends on RUST
  2193. help
  2194. This builds the "find_bit_benchmark_rust" module. It is a micro
  2195. benchmark that measures the performance of Rust functions that
  2196. correspond to the find_*_bit() operations in C. It follows the
  2197. FIND_BIT_BENCHMARK closely but will in general not yield same
  2198. numbers due to extra bounds checks and overhead of foreign
  2199. function calls.
  2200. If unsure, say N.
  2201. config TEST_FIRMWARE
  2202. tristate "Test firmware loading via userspace interface"
  2203. depends on FW_LOADER
  2204. help
  2205. This builds the "test_firmware" module that creates a userspace
  2206. interface for testing firmware loading. This can be used to
  2207. control the triggering of firmware loading without needing an
  2208. actual firmware-using device. The contents can be rechecked by
  2209. userspace.
  2210. If unsure, say N.
  2211. config TEST_SYSCTL
  2212. tristate "sysctl test driver"
  2213. depends on PROC_SYSCTL
  2214. help
  2215. This builds the "test_sysctl" module. This driver enables to test the
  2216. proc sysctl interfaces available to drivers safely without affecting
  2217. production knobs which might alter system functionality.
  2218. If unsure, say N.
  2219. config BITOPS_KUNIT
  2220. tristate "KUnit test for bitops" if !KUNIT_ALL_TESTS
  2221. depends on KUNIT
  2222. default KUNIT_ALL_TESTS
  2223. help
  2224. This option enables the KUnit test for the bitops library
  2225. which provides functions for bit operations.
  2226. Note that this is derived from the original test_bitops module.
  2227. For micro-benchmarks and compiler warning checks, enable TEST_BITOPS.
  2228. If unsure, say N.
  2229. config BITFIELD_KUNIT
  2230. tristate "KUnit test bitfield functions at runtime" if !KUNIT_ALL_TESTS
  2231. depends on KUNIT
  2232. default KUNIT_ALL_TESTS
  2233. help
  2234. Enable this option to test the bitfield functions at boot.
  2235. KUnit tests run during boot and output the results to the debug log
  2236. in TAP format (http://testanything.org/). Only useful for kernel devs
  2237. running the KUnit test harness, and not intended for inclusion into a
  2238. production build.
  2239. For more information on KUnit and unit tests in general please refer
  2240. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2241. If unsure, say N.
  2242. config CHECKSUM_KUNIT
  2243. tristate "KUnit test checksum functions at runtime" if !KUNIT_ALL_TESTS
  2244. depends on KUNIT
  2245. default KUNIT_ALL_TESTS
  2246. help
  2247. Enable this option to test the checksum functions at boot.
  2248. KUnit tests run during boot and output the results to the debug log
  2249. in TAP format (http://testanything.org/). Only useful for kernel devs
  2250. running the KUnit test harness, and not intended for inclusion into a
  2251. production build.
  2252. For more information on KUnit and unit tests in general please refer
  2253. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2254. If unsure, say N.
  2255. config UTIL_MACROS_KUNIT
  2256. tristate "KUnit test util_macros.h functions at runtime" if !KUNIT_ALL_TESTS
  2257. depends on KUNIT
  2258. default KUNIT_ALL_TESTS
  2259. help
  2260. Enable this option to test the util_macros.h function at boot.
  2261. KUnit tests run during boot and output the results to the debug log
  2262. in TAP format (http://testanything.org/). Only useful for kernel devs
  2263. running the KUnit test harness, and not intended for inclusion into a
  2264. production build.
  2265. For more information on KUnit and unit tests in general please refer
  2266. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2267. If unsure, say N.
  2268. config HASH_KUNIT_TEST
  2269. tristate "KUnit Test for integer hash functions" if !KUNIT_ALL_TESTS
  2270. depends on KUNIT
  2271. default KUNIT_ALL_TESTS
  2272. help
  2273. Enable this option to test the kernel's string (<linux/stringhash.h>), and
  2274. integer (<linux/hash.h>) hash functions on boot.
  2275. KUnit tests run during boot and output the results to the debug log
  2276. in TAP format (https://testanything.org/). Only useful for kernel devs
  2277. running the KUnit test harness, and not intended for inclusion into a
  2278. production build.
  2279. For more information on KUnit and unit tests in general please refer
  2280. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2281. This is intended to help people writing architecture-specific
  2282. optimized versions. If unsure, say N.
  2283. config RESOURCE_KUNIT_TEST
  2284. tristate "KUnit test for resource API" if !KUNIT_ALL_TESTS
  2285. depends on KUNIT
  2286. default KUNIT_ALL_TESTS
  2287. select GET_FREE_REGION
  2288. help
  2289. This builds the resource API unit test.
  2290. Tests the logic of API provided by resource.c and ioport.h.
  2291. For more information on KUnit and unit tests in general please refer
  2292. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2293. If unsure, say N.
  2294. config SYSCTL_KUNIT_TEST
  2295. tristate "KUnit test for sysctl" if !KUNIT_ALL_TESTS
  2296. depends on KUNIT
  2297. default KUNIT_ALL_TESTS
  2298. help
  2299. This builds the proc sysctl unit test, which runs on boot.
  2300. Tests the API contract and implementation correctness of sysctl.
  2301. For more information on KUnit and unit tests in general please refer
  2302. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2303. If unsure, say N.
  2304. config KFIFO_KUNIT_TEST
  2305. tristate "KUnit Test for the generic kernel FIFO implementation" if !KUNIT_ALL_TESTS
  2306. depends on KUNIT
  2307. default KUNIT_ALL_TESTS
  2308. help
  2309. This builds the generic FIFO implementation KUnit test suite.
  2310. It tests that the API and basic functionality of the kfifo type
  2311. and associated macros.
  2312. For more information on KUnit and unit tests in general please refer
  2313. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2314. If unsure, say N.
  2315. config LIST_KUNIT_TEST
  2316. tristate "KUnit Test for Kernel Linked-list structures" if !KUNIT_ALL_TESTS
  2317. depends on KUNIT
  2318. default KUNIT_ALL_TESTS
  2319. help
  2320. This builds the linked list KUnit test suite.
  2321. It tests that the API and basic functionality of the list_head type
  2322. and associated macros.
  2323. KUnit tests run during boot and output the results to the debug log
  2324. in TAP format (https://testanything.org/). Only useful for kernel devs
  2325. running the KUnit test harness, and not intended for inclusion into a
  2326. production build.
  2327. For more information on KUnit and unit tests in general please refer
  2328. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2329. If unsure, say N.
  2330. config LIST_PRIVATE_KUNIT_TEST
  2331. tristate "KUnit Test for Kernel Private Linked-list structures" if !KUNIT_ALL_TESTS
  2332. depends on KUNIT
  2333. default KUNIT_ALL_TESTS
  2334. help
  2335. This builds the KUnit test for the private linked-list primitives
  2336. defined in include/linux/list_private.h.
  2337. These primitives allow manipulation of list_head members that are
  2338. marked as private and require special accessors (ACCESS_PRIVATE)
  2339. to strip qualifiers or handle encapsulation.
  2340. If unsure, say N.
  2341. config HASHTABLE_KUNIT_TEST
  2342. tristate "KUnit Test for Kernel Hashtable structures" if !KUNIT_ALL_TESTS
  2343. depends on KUNIT
  2344. default KUNIT_ALL_TESTS
  2345. help
  2346. This builds the hashtable KUnit test suite.
  2347. It tests the basic functionality of the API defined in
  2348. include/linux/hashtable.h. For more information on KUnit and
  2349. unit tests in general please refer to the KUnit documentation
  2350. in Documentation/dev-tools/kunit/.
  2351. If unsure, say N.
  2352. config LINEAR_RANGES_TEST
  2353. tristate "KUnit test for linear_ranges"
  2354. depends on KUNIT
  2355. select LINEAR_RANGES
  2356. help
  2357. This builds the linear_ranges unit test, which runs on boot.
  2358. Tests the linear_ranges logic correctness.
  2359. For more information on KUnit and unit tests in general please refer
  2360. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2361. If unsure, say N.
  2362. config CONTEXT_ANALYSIS_TEST
  2363. bool "Compiler context-analysis warnings test"
  2364. depends on EXPERT
  2365. help
  2366. This builds the test for compiler-based context analysis. The test
  2367. does not add executable code to the kernel, but is meant to test that
  2368. common patterns supported by the analysis do not result in false
  2369. positive warnings.
  2370. When adding support for new context locks, it is strongly recommended
  2371. to add supported patterns to this test.
  2372. If unsure, say N.
  2373. config LIVEUPDATE_TEST
  2374. bool "Live Update Kernel Test"
  2375. default n
  2376. depends on LIVEUPDATE
  2377. help
  2378. Enable a built-in kernel test module for the Live Update
  2379. Orchestrator.
  2380. This module validates the File-Lifecycle-Bound subsystem by
  2381. registering a set of mock FLB objects with any real file handlers
  2382. that support live update (such as the memfd handler).
  2383. When live update operations are performed, this test module will
  2384. output messages to the kernel log (dmesg), confirming that its
  2385. registration and various callback functions (preserve, retrieve,
  2386. finish, etc.) are being invoked correctly.
  2387. This is a debugging and regression testing tool for developers
  2388. working on the Live Update subsystem. It should not be enabled in
  2389. production kernels.
  2390. If unsure, say N
  2391. config CMDLINE_KUNIT_TEST
  2392. tristate "KUnit test for cmdline API" if !KUNIT_ALL_TESTS
  2393. depends on KUNIT
  2394. default KUNIT_ALL_TESTS
  2395. help
  2396. This builds the cmdline API unit test.
  2397. Tests the logic of API provided by cmdline.c.
  2398. For more information on KUnit and unit tests in general please refer
  2399. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2400. If unsure, say N.
  2401. config BASE64_KUNIT
  2402. tristate "KUnit test for base64 decoding and encoding" if !KUNIT_ALL_TESTS
  2403. depends on KUNIT
  2404. default KUNIT_ALL_TESTS
  2405. help
  2406. This builds the base64 unit tests.
  2407. The tests cover the encoding and decoding logic of Base64 functions
  2408. in the kernel.
  2409. In addition to correctness checks, simple performance benchmarks
  2410. for both encoding and decoding are also included.
  2411. For more information on KUnit and unit tests in general please refer
  2412. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2413. If unsure, say N.
  2414. config BITS_TEST
  2415. tristate "KUnit test for bit functions and macros" if !KUNIT_ALL_TESTS
  2416. depends on KUNIT
  2417. default KUNIT_ALL_TESTS
  2418. help
  2419. This builds the bits unit test.
  2420. Tests the logic of macros defined in bits.h.
  2421. For more information on KUnit and unit tests in general please refer
  2422. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2423. If unsure, say N.
  2424. config SLUB_KUNIT_TEST
  2425. tristate "KUnit test for SLUB cache error detection" if !KUNIT_ALL_TESTS
  2426. depends on SLUB_DEBUG && KUNIT
  2427. default KUNIT_ALL_TESTS
  2428. help
  2429. This builds SLUB allocator unit test.
  2430. Tests SLUB cache debugging functionality.
  2431. For more information on KUnit and unit tests in general please refer
  2432. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2433. If unsure, say N.
  2434. config RATIONAL_KUNIT_TEST
  2435. tristate "KUnit test for rational.c" if !KUNIT_ALL_TESTS
  2436. depends on KUNIT && RATIONAL
  2437. default KUNIT_ALL_TESTS
  2438. help
  2439. This builds the rational math unit test.
  2440. For more information on KUnit and unit tests in general please refer
  2441. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2442. If unsure, say N.
  2443. config MEMCPY_KUNIT_TEST
  2444. tristate "Test memcpy(), memmove(), and memset() functions at runtime" if !KUNIT_ALL_TESTS
  2445. depends on KUNIT
  2446. default KUNIT_ALL_TESTS
  2447. help
  2448. Builds unit tests for memcpy(), memmove(), and memset() functions.
  2449. For more information on KUnit and unit tests in general please refer
  2450. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2451. If unsure, say N.
  2452. config MIN_HEAP_KUNIT_TEST
  2453. tristate "Min heap test" if !KUNIT_ALL_TESTS
  2454. depends on KUNIT
  2455. default KUNIT_ALL_TESTS
  2456. help
  2457. This option enables the KUnit test suite for the min heap library
  2458. which provides functions for creating and managing min heaps.
  2459. The test suite checks the functionality of the min heap library.
  2460. If unsure, say N
  2461. config IS_SIGNED_TYPE_KUNIT_TEST
  2462. tristate "Test is_signed_type() macro" if !KUNIT_ALL_TESTS
  2463. depends on KUNIT
  2464. default KUNIT_ALL_TESTS
  2465. help
  2466. Builds unit tests for the is_signed_type() macro.
  2467. For more information on KUnit and unit tests in general please refer
  2468. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2469. If unsure, say N.
  2470. config OVERFLOW_KUNIT_TEST
  2471. tristate "Test check_*_overflow() functions at runtime" if !KUNIT_ALL_TESTS
  2472. depends on KUNIT
  2473. default KUNIT_ALL_TESTS
  2474. help
  2475. Builds unit tests for the check_*_overflow(), size_*(), allocation, and
  2476. related functions.
  2477. For more information on KUnit and unit tests in general please refer
  2478. to the KUnit documentation in Documentation/dev-tools/kunit/.
  2479. If unsure, say N.
  2480. config RANDSTRUCT_KUNIT_TEST
  2481. tristate "Test randstruct structure layout randomization at runtime" if !KUNIT_ALL_TESTS
  2482. depends on KUNIT
  2483. default KUNIT_ALL_TESTS
  2484. help
  2485. Builds unit tests for the checking CONFIG_RANDSTRUCT=y, which
  2486. randomizes structure layouts.
  2487. config STACKINIT_KUNIT_TEST
  2488. tristate "Test level of stack variable initialization" if !KUNIT_ALL_TESTS
  2489. depends on KUNIT
  2490. default KUNIT_ALL_TESTS
  2491. help
  2492. Test if the kernel is zero-initializing stack variables and
  2493. padding. Coverage is controlled by compiler flags,
  2494. CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_ALL_ZERO.
  2495. config FORTIFY_KUNIT_TEST
  2496. tristate "Test fortified str*() and mem*() function internals at runtime" if !KUNIT_ALL_TESTS
  2497. depends on KUNIT
  2498. default KUNIT_ALL_TESTS
  2499. help
  2500. Builds unit tests for checking internals of FORTIFY_SOURCE as used
  2501. by the str*() and mem*() family of functions. For testing runtime
  2502. traps of FORTIFY_SOURCE, see LKDTM's "FORTIFY_*" tests.
  2503. config LONGEST_SYM_KUNIT_TEST
  2504. tristate "Test the longest symbol possible" if !KUNIT_ALL_TESTS
  2505. depends on KUNIT && KPROBES
  2506. depends on !PREFIX_SYMBOLS && !CFI && !GCOV_KERNEL
  2507. default KUNIT_ALL_TESTS
  2508. help
  2509. Tests the longest symbol possible
  2510. If unsure, say N.
  2511. config HW_BREAKPOINT_KUNIT_TEST
  2512. bool "Test hw_breakpoint constraints accounting" if !KUNIT_ALL_TESTS
  2513. depends on HAVE_HW_BREAKPOINT
  2514. depends on KUNIT=y
  2515. default KUNIT_ALL_TESTS
  2516. help
  2517. Tests for hw_breakpoint constraints accounting.
  2518. If unsure, say N.
  2519. config SIPHASH_KUNIT_TEST
  2520. tristate "Perform selftest on siphash functions" if !KUNIT_ALL_TESTS
  2521. depends on KUNIT
  2522. default KUNIT_ALL_TESTS
  2523. help
  2524. Enable this option to test the kernel's siphash (<linux/siphash.h>) hash
  2525. functions on boot (or module load).
  2526. This is intended to help people writing architecture-specific
  2527. optimized versions. If unsure, say N.
  2528. config USERCOPY_KUNIT_TEST
  2529. tristate "KUnit Test for user/kernel boundary protections"
  2530. depends on KUNIT
  2531. default KUNIT_ALL_TESTS
  2532. help
  2533. This builds the "usercopy_kunit" module that runs sanity checks
  2534. on the copy_to/from_user infrastructure, making sure basic
  2535. user/kernel boundary testing is working.
  2536. config BLACKHOLE_DEV_KUNIT_TEST
  2537. tristate "Test blackhole netdev functionality" if !KUNIT_ALL_TESTS
  2538. depends on NET
  2539. depends on KUNIT
  2540. default KUNIT_ALL_TESTS
  2541. help
  2542. This builds the "blackhole_dev_kunit" module that validates the
  2543. data path through this blackhole netdev.
  2544. If unsure, say N.
  2545. config TEST_UDELAY
  2546. tristate "udelay test driver"
  2547. help
  2548. This builds the "udelay_test" module that helps to make sure
  2549. that udelay() is working properly.
  2550. If unsure, say N.
  2551. config TEST_STATIC_KEYS
  2552. tristate "Test static keys"
  2553. depends on m
  2554. help
  2555. Test the static key interfaces.
  2556. If unsure, say N.
  2557. config TEST_DYNAMIC_DEBUG
  2558. tristate "Test DYNAMIC_DEBUG"
  2559. depends on DYNAMIC_DEBUG
  2560. help
  2561. This module registers a tracer callback to count enabled
  2562. pr_debugs in a 'do_debugging' function, then alters their
  2563. enablements, calls the function, and compares counts.
  2564. If unsure, say N.
  2565. config TEST_KMOD
  2566. tristate "kmod stress tester"
  2567. depends on m
  2568. select TEST_LKM
  2569. help
  2570. Test the kernel's module loading mechanism: kmod. kmod implements
  2571. support to load modules using the Linux kernel's usermode helper.
  2572. This test provides a series of tests against kmod.
  2573. Although technically you can either build test_kmod as a module or
  2574. into the kernel we disallow building it into the kernel since
  2575. it stress tests request_module() and this will very likely cause
  2576. some issues by taking over precious threads available from other
  2577. module load requests, ultimately this could be fatal.
  2578. To run tests run:
  2579. tools/testing/selftests/kmod/kmod.sh --help
  2580. If unsure, say N.
  2581. config TEST_RUNTIME
  2582. bool
  2583. config TEST_RUNTIME_MODULE
  2584. bool
  2585. config TEST_KALLSYMS
  2586. tristate "module kallsyms find_symbol() test"
  2587. depends on m
  2588. select TEST_RUNTIME
  2589. select TEST_RUNTIME_MODULE
  2590. select TEST_KALLSYMS_A
  2591. select TEST_KALLSYMS_B
  2592. select TEST_KALLSYMS_C
  2593. select TEST_KALLSYMS_D
  2594. help
  2595. This allows us to stress test find_symbol() through the kallsyms
  2596. used to place symbols on the kernel ELF kallsyms and modules kallsyms
  2597. where we place kernel symbols such as exported symbols.
  2598. We have four test modules:
  2599. A: has KALLSYSMS_NUMSYMS exported symbols
  2600. B: uses one of A's symbols
  2601. C: adds KALLSYMS_SCALE_FACTOR * KALLSYSMS_NUMSYMS exported
  2602. D: adds 2 * the symbols than C
  2603. We stress test find_symbol() through two means:
  2604. 1) Upon load of B it will trigger simplify_symbols() to look for the
  2605. one symbol it uses from the module A with tons of symbols. This is an
  2606. indirect way for us to have B call resolve_symbol_wait() upon module
  2607. load. This will eventually call find_symbol() which will eventually
  2608. try to find the symbols used with find_exported_symbol_in_section().
  2609. find_exported_symbol_in_section() uses bsearch() so a binary search
  2610. for each symbol. Binary search will at worst be O(log(n)) so the
  2611. larger TEST_MODULE_KALLSYSMS the worse the search.
  2612. 2) The selftests should load C first, before B. Upon B's load towards
  2613. the end right before we call module B's init routine we get
  2614. complete_formation() called on the module. That will first check
  2615. for duplicate symbols with the call to verify_exported_symbols().
  2616. That is when we'll force iteration on module C's insane symbol list.
  2617. Since it has 10 * KALLSYMS_NUMSYMS it means we can first test
  2618. just loading B without C. The amount of time it takes to load C Vs
  2619. B can give us an idea of the impact growth of the symbol space and
  2620. give us projection. Module A only uses one symbol from B so to allow
  2621. this scaling in module C to be proportional, if it used more symbols
  2622. then the first test would be doing more and increasing just the
  2623. search space would be slightly different. The last module, module D
  2624. will just increase the search space by twice the number of symbols in
  2625. C so to allow for full projects.
  2626. tools/testing/selftests/module/find_symbol.sh
  2627. The current defaults will incur a build delay of about 7 minutes
  2628. on an x86_64 with only 8 cores. Enable this only if you want to
  2629. stress test find_symbol() with thousands of symbols. At the same
  2630. time this is also useful to test building modules with thousands of
  2631. symbols, and if BTF is enabled this also stress tests adding BTF
  2632. information for each module. Currently enabling many more symbols
  2633. will segfault the build system.
  2634. If unsure, say N.
  2635. if TEST_KALLSYMS
  2636. config TEST_KALLSYMS_A
  2637. tristate
  2638. depends on m
  2639. config TEST_KALLSYMS_B
  2640. tristate
  2641. depends on m
  2642. config TEST_KALLSYMS_C
  2643. tristate
  2644. depends on m
  2645. config TEST_KALLSYMS_D
  2646. tristate
  2647. depends on m
  2648. choice
  2649. prompt "Kallsym test range"
  2650. default TEST_KALLSYMS_LARGE
  2651. help
  2652. Selecting something other than "Fast" will enable tests which slow
  2653. down the build and may crash your build.
  2654. config TEST_KALLSYMS_FAST
  2655. bool "Fast builds"
  2656. help
  2657. You won't really be testing kallsysms, so this just helps fast builds
  2658. when allmodconfig is used..
  2659. config TEST_KALLSYMS_LARGE
  2660. bool "Enable testing kallsyms with large exports"
  2661. help
  2662. This will enable larger number of symbols. This will slow down
  2663. your build considerably.
  2664. config TEST_KALLSYMS_MAX
  2665. bool "Known kallsysms limits"
  2666. help
  2667. This will enable exports to the point we know we'll start crashing
  2668. builds.
  2669. endchoice
  2670. config TEST_KALLSYMS_NUMSYMS
  2671. int "test kallsyms number of symbols"
  2672. range 2 10000
  2673. default 2 if TEST_KALLSYMS_FAST
  2674. default 100 if TEST_KALLSYMS_LARGE
  2675. default 10000 if TEST_KALLSYMS_MAX
  2676. help
  2677. The number of symbols to create on TEST_KALLSYMS_A, only one of which
  2678. module TEST_KALLSYMS_B will use. This also will be used
  2679. for how many symbols TEST_KALLSYMS_C will have, scaled up by
  2680. TEST_KALLSYMS_SCALE_FACTOR. Note that setting this to 10,000 will
  2681. trigger a segfault today, don't use anything close to it unless
  2682. you are aware that this should not be used for automated build tests.
  2683. config TEST_KALLSYMS_SCALE_FACTOR
  2684. int "test kallsyms scale factor"
  2685. default 8
  2686. help
  2687. How many more unusued symbols will TEST_KALLSYSMS_C have than
  2688. TEST_KALLSYMS_A. If 8, then module C will have 8 * syms
  2689. than module A. Then TEST_KALLSYMS_D will have double the amount
  2690. of symbols than C so to allow projections.
  2691. endif # TEST_KALLSYMS
  2692. config TEST_DEBUG_VIRTUAL
  2693. tristate "Test CONFIG_DEBUG_VIRTUAL feature"
  2694. depends on DEBUG_VIRTUAL
  2695. help
  2696. Test the kernel's ability to detect incorrect calls to
  2697. virt_to_phys() done against the non-linear part of the
  2698. kernel's virtual address map.
  2699. If unsure, say N.
  2700. config TEST_MEMCAT_P
  2701. tristate "Test memcat_p() helper function"
  2702. help
  2703. Test the memcat_p() helper for correctly merging two
  2704. pointer arrays together.
  2705. If unsure, say N.
  2706. config TEST_OBJAGG
  2707. tristate "Perform selftest on object aggreration manager"
  2708. default n
  2709. depends on OBJAGG
  2710. help
  2711. Enable this option to test object aggregation manager on boot
  2712. (or module load).
  2713. config TEST_MEMINIT
  2714. tristate "Test heap/page initialization"
  2715. help
  2716. Test if the kernel is zero-initializing heap and page allocations.
  2717. This can be useful to test init_on_alloc and init_on_free features.
  2718. If unsure, say N.
  2719. config TEST_HMM
  2720. tristate "Test HMM (Heterogeneous Memory Management)"
  2721. depends on TRANSPARENT_HUGEPAGE
  2722. depends on DEVICE_PRIVATE
  2723. select HMM_MIRROR
  2724. select MMU_NOTIFIER
  2725. help
  2726. This is a pseudo device driver solely for testing HMM.
  2727. Say M here if you want to build the HMM test module.
  2728. Doing so will allow you to run tools/testing/selftest/vm/hmm-tests.
  2729. If unsure, say N.
  2730. config TEST_FREE_PAGES
  2731. tristate "Test freeing pages"
  2732. help
  2733. Test that a memory leak does not occur due to a race between
  2734. freeing a block of pages and a speculative page reference.
  2735. Loading this module is safe if your kernel has the bug fixed.
  2736. If the bug is not fixed, it will leak gigabytes of memory and
  2737. probably OOM your system.
  2738. config TEST_FPU
  2739. tristate "Test floating point operations in kernel space"
  2740. depends on ARCH_HAS_KERNEL_FPU_SUPPORT && !KCOV_INSTRUMENT_ALL
  2741. help
  2742. Enable this option to add /sys/kernel/debug/selftest_helpers/test_fpu
  2743. which will trigger a sequence of floating point operations. This is used
  2744. for self-testing floating point control register setting in
  2745. kernel_fpu_begin().
  2746. If unsure, say N.
  2747. config TEST_CLOCKSOURCE_WATCHDOG
  2748. tristate "Test clocksource watchdog in kernel space"
  2749. depends on CLOCKSOURCE_WATCHDOG
  2750. help
  2751. Enable this option to create a kernel module that will trigger
  2752. a test of the clocksource watchdog. This module may be loaded
  2753. via modprobe or insmod in which case it will run upon being
  2754. loaded, or it may be built in, in which case it will run
  2755. shortly after boot.
  2756. If unsure, say N.
  2757. config TEST_OBJPOOL
  2758. tristate "Test module for correctness and stress of objpool"
  2759. default n
  2760. depends on m && DEBUG_KERNEL
  2761. help
  2762. This builds the "test_objpool" module that should be used for
  2763. correctness verification and concurrent testings of objects
  2764. allocation and reclamation.
  2765. If unsure, say N.
  2766. config TEST_KEXEC_HANDOVER
  2767. bool "Test for Kexec HandOver"
  2768. default n
  2769. depends on KEXEC_HANDOVER
  2770. help
  2771. This option enables test for Kexec HandOver (KHO).
  2772. The test consists of two parts: saving kernel data before kexec and
  2773. restoring the data after kexec and verifying that it was properly
  2774. handed over. This test module creates and saves data on the boot of
  2775. the first kernel and restores and verifies the data on the boot of
  2776. kexec'ed kernel.
  2777. For detailed documentation about KHO, see Documentation/core-api/kho.
  2778. To run the test run:
  2779. tools/testing/selftests/kho/vmtest.sh -h
  2780. If unsure, say N.
  2781. config RATELIMIT_KUNIT_TEST
  2782. tristate "KUnit Test for correctness and stress of ratelimit" if !KUNIT_ALL_TESTS
  2783. depends on KUNIT
  2784. default KUNIT_ALL_TESTS
  2785. help
  2786. This builds the "test_ratelimit" module that should be used
  2787. for correctness verification and concurrent testings of rate
  2788. limiting.
  2789. If unsure, say N.
  2790. config UUID_KUNIT_TEST
  2791. tristate "KUnit test for UUID" if !KUNIT_ALL_TESTS
  2792. depends on KUNIT
  2793. default KUNIT_ALL_TESTS
  2794. help
  2795. This option enables the KUnit test suite for the uuid library,
  2796. which provides functions for generating and parsing UUID and GUID.
  2797. The test suite checks parsing of UUID and GUID strings.
  2798. If unsure, say N.
  2799. config INT_POW_KUNIT_TEST
  2800. tristate "Integer exponentiation (int_pow) test" if !KUNIT_ALL_TESTS
  2801. depends on KUNIT
  2802. default KUNIT_ALL_TESTS
  2803. help
  2804. This option enables the KUnit test suite for the int_pow function,
  2805. which performs integer exponentiation. The test suite is designed to
  2806. verify that the implementation of int_pow correctly computes the power
  2807. of a given base raised to a given exponent.
  2808. Enabling this option will include tests that check various scenarios
  2809. and edge cases to ensure the accuracy and reliability of the exponentiation
  2810. function.
  2811. If unsure, say N
  2812. config INT_SQRT_KUNIT_TEST
  2813. tristate "Integer square root test" if !KUNIT_ALL_TESTS
  2814. depends on KUNIT
  2815. default KUNIT_ALL_TESTS
  2816. help
  2817. This option enables the KUnit test suite for the int_sqrt() function,
  2818. which performs square root calculation. The test suite checks
  2819. various scenarios, including edge cases, to ensure correctness.
  2820. Enabling this option will include tests that check various scenarios
  2821. and edge cases to ensure the accuracy and reliability of the square root
  2822. function.
  2823. If unsure, say N
  2824. config INT_LOG_KUNIT_TEST
  2825. tristate "Integer log (int_log) test" if !KUNIT_ALL_TESTS
  2826. depends on KUNIT
  2827. default KUNIT_ALL_TESTS
  2828. help
  2829. This option enables the KUnit test suite for the int_log library, which
  2830. provides two functions to compute the integer logarithm in base 2 and
  2831. base 10, called respectively as intlog2 and intlog10.
  2832. If unsure, say N
  2833. config GCD_KUNIT_TEST
  2834. tristate "Greatest common divisor test" if !KUNIT_ALL_TESTS
  2835. depends on KUNIT
  2836. default KUNIT_ALL_TESTS
  2837. help
  2838. This option enables the KUnit test suite for the gcd() function,
  2839. which computes the greatest common divisor of two numbers.
  2840. This test suite verifies the correctness of gcd() across various
  2841. scenarios, including edge cases.
  2842. If unsure, say N
  2843. config PRIME_NUMBERS_KUNIT_TEST
  2844. tristate "Prime number generator test" if !KUNIT_ALL_TESTS
  2845. depends on KUNIT
  2846. depends on PRIME_NUMBERS
  2847. default KUNIT_ALL_TESTS
  2848. help
  2849. This option enables the KUnit test suite for the {is,next}_prime_number
  2850. functions.
  2851. Enabling this option will include tests that compare the prime number
  2852. generator functions against a brute force implementation.
  2853. If unsure, say N
  2854. config GLOB_KUNIT_TEST
  2855. tristate "Glob matching test" if !KUNIT_ALL_TESTS
  2856. depends on GLOB
  2857. depends on KUNIT
  2858. default KUNIT_ALL_TESTS
  2859. help
  2860. Enable this option to test the glob functions at runtime.
  2861. This test suite verifies the correctness of glob_match() across various
  2862. scenarios, including edge cases.
  2863. If unsure, say N
  2864. endif # RUNTIME_TESTING_MENU
  2865. config ARCH_USE_MEMTEST
  2866. bool
  2867. help
  2868. An architecture should select this when it uses early_memtest()
  2869. during boot process.
  2870. config MEMTEST
  2871. bool "Memtest"
  2872. depends on ARCH_USE_MEMTEST
  2873. help
  2874. This option adds a kernel parameter 'memtest', which allows memtest
  2875. to be set and executed.
  2876. memtest=0, mean disabled; -- default
  2877. memtest=1, mean do 1 test pattern;
  2878. ...
  2879. memtest=17, mean do 17 test patterns.
  2880. If you are unsure how to answer this question, answer N.
  2881. config HYPERV_TESTING
  2882. bool "Microsoft Hyper-V driver testing"
  2883. default n
  2884. depends on HYPERV && DEBUG_FS
  2885. help
  2886. Select this option to enable Hyper-V vmbus testing.
  2887. endmenu # "Kernel Testing and Coverage"
  2888. menu "Rust hacking"
  2889. config RUST_DEBUG_ASSERTIONS
  2890. bool "Debug assertions"
  2891. depends on RUST
  2892. help
  2893. Enables rustc's `-Cdebug-assertions` codegen option.
  2894. This flag lets you turn `cfg(debug_assertions)` conditional
  2895. compilation on or off. This can be used to enable extra debugging
  2896. code in development but not in production. For example, it controls
  2897. the behavior of the standard library's `debug_assert!` macro.
  2898. Note that this will apply to all Rust code, including `core`.
  2899. If unsure, say N.
  2900. config RUST_OVERFLOW_CHECKS
  2901. bool "Overflow checks"
  2902. default y
  2903. depends on RUST
  2904. help
  2905. Enables rustc's `-Coverflow-checks` codegen option.
  2906. This flag allows you to control the behavior of runtime integer
  2907. overflow. When overflow-checks are enabled, a Rust panic will occur
  2908. on overflow.
  2909. Note that this will apply to all Rust code, including `core`.
  2910. If unsure, say Y.
  2911. config RUST_BUILD_ASSERT_ALLOW
  2912. bool "Allow unoptimized build-time assertions"
  2913. depends on RUST
  2914. help
  2915. Controls how `build_error!` and `build_assert!` are handled during the build.
  2916. If calls to them exist in the binary, it may indicate a violated invariant
  2917. or that the optimizer failed to verify the invariant during compilation.
  2918. This should not happen, thus by default the build is aborted. However,
  2919. as an escape hatch, you can choose Y here to ignore them during build
  2920. and let the check be carried at runtime (with `panic!` being called if
  2921. the check fails).
  2922. If unsure, say N.
  2923. config RUST_KERNEL_DOCTESTS
  2924. bool "Doctests for the `kernel` crate" if !KUNIT_ALL_TESTS
  2925. depends on RUST && KUNIT=y
  2926. default KUNIT_ALL_TESTS
  2927. help
  2928. This builds the documentation tests of the `kernel` crate
  2929. as KUnit tests.
  2930. For more information on KUnit and unit tests in general,
  2931. please refer to the KUnit documentation in Documentation/dev-tools/kunit/.
  2932. If unsure, say N.
  2933. endmenu # "Rust"
  2934. endmenu # Kernel hacking