Kconfig 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. menuconfig SAMPLES
  3. bool "Sample kernel code"
  4. help
  5. You can build and test sample kernel code here.
  6. if SAMPLES
  7. config SAMPLE_AUXDISPLAY
  8. bool "auxdisplay sample"
  9. depends on CC_CAN_LINK
  10. config SAMPLE_TRACE_EVENTS
  11. tristate "Build trace_events examples -- loadable modules only"
  12. depends on EVENT_TRACING && m
  13. help
  14. This builds the trace event example module.
  15. config SAMPLE_TRACE_CUSTOM_EVENTS
  16. tristate "Build custom trace event example -- loadable modules only"
  17. depends on EVENT_TRACING && m
  18. help
  19. This builds the custom trace event example module.
  20. config SAMPLE_TRACE_PRINTK
  21. tristate "Build trace_printk module - tests various trace_printk formats"
  22. depends on EVENT_TRACING && m
  23. help
  24. This builds a module that calls trace_printk() and can be used to
  25. test various trace_printk() calls from a module.
  26. config SAMPLE_FTRACE_DIRECT
  27. tristate "Build register_ftrace_direct() example"
  28. depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
  29. depends on HAVE_SAMPLE_FTRACE_DIRECT
  30. help
  31. This builds an ftrace direct function example
  32. that hooks to wake_up_process and prints the parameters.
  33. config SAMPLE_FTRACE_DIRECT_MULTI
  34. tristate "Build register_ftrace_direct() on multiple ips example"
  35. depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
  36. depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI
  37. help
  38. This builds an ftrace direct function example
  39. that hooks to wake_up_process and schedule, and prints
  40. the function addresses.
  41. config SAMPLE_FTRACE_OPS
  42. tristate "Build custom ftrace ops example"
  43. depends on FUNCTION_TRACER
  44. help
  45. This builds an ftrace ops example that hooks two functions and
  46. measures the time taken to invoke one function a number of times.
  47. config SAMPLE_TRACE_ARRAY
  48. tristate "Build sample module for kernel access to Ftrace instances"
  49. depends on EVENT_TRACING && m
  50. help
  51. This builds a module that demonstrates the use of various APIs to
  52. access Ftrace instances from within the kernel.
  53. config SAMPLE_KOBJECT
  54. tristate "Build kobject examples"
  55. help
  56. This config option will allow you to build a number of
  57. different kobject sample modules showing how to use kobjects,
  58. ksets, and ktypes properly.
  59. If in doubt, say "N" here.
  60. config SAMPLE_KPROBES
  61. tristate "Build kprobes examples -- loadable modules only"
  62. depends on KPROBES && m
  63. help
  64. This build several kprobes example modules.
  65. config SAMPLE_KRETPROBES
  66. tristate "Build kretprobes example -- loadable modules only"
  67. default m
  68. depends on SAMPLE_KPROBES && KRETPROBES
  69. config SAMPLE_HW_BREAKPOINT
  70. tristate "Build kernel hardware breakpoint examples -- loadable module only"
  71. depends on HAVE_HW_BREAKPOINT && m
  72. help
  73. This builds kernel hardware breakpoint example modules.
  74. config SAMPLE_FPROBE
  75. tristate "Build fprobe examples -- loadable modules only"
  76. depends on FPROBE && m
  77. help
  78. This builds a fprobe example module. This module has an option 'symbol'.
  79. You can specify a probed symbol or symbols separated with ','.
  80. config SAMPLE_KFIFO
  81. tristate "Build kfifo examples -- loadable modules only"
  82. depends on m
  83. help
  84. This config option will allow you to build a number of
  85. different kfifo sample modules showing how to use the
  86. generic kfifo API.
  87. If in doubt, say "N" here.
  88. config SAMPLE_KDB
  89. tristate "Build kdb command example -- loadable modules only"
  90. depends on KGDB_KDB && m
  91. help
  92. Build an example of how to dynamically add the hello
  93. command to the kdb shell.
  94. config SAMPLE_QMI_CLIENT
  95. tristate "Build qmi client sample -- loadable modules only"
  96. depends on m
  97. depends on ARCH_QCOM
  98. depends on NET
  99. select QCOM_QMI_HELPERS
  100. help
  101. Build an QMI client sample driver, which demonstrates how to
  102. communicate with a remote QRTR service, using QMI encoded messages.
  103. config SAMPLE_RPMSG_CLIENT
  104. tristate "Build rpmsg client sample -- loadable modules only"
  105. depends on RPMSG && m
  106. help
  107. Build an rpmsg client sample driver, which demonstrates how
  108. to communicate with an AMP-configured remote processor over
  109. the rpmsg bus.
  110. config SAMPLE_LIVEPATCH
  111. tristate "Build live patching samples -- loadable modules only"
  112. depends on LIVEPATCH && m
  113. help
  114. Build sample live patch demonstrations.
  115. config SAMPLE_CONFIGFS
  116. tristate "Build configfs patching sample -- loadable modules only"
  117. depends on CONFIGFS_FS && m
  118. help
  119. Builds a sample configfs interface.
  120. config SAMPLE_CONNECTOR
  121. tristate "Build connector sample -- loadable modules only"
  122. depends on CONNECTOR && HEADERS_INSTALL && m
  123. help
  124. When enabled, this builds both a sample kernel module for
  125. the connector interface and a user space tool to communicate
  126. with it.
  127. See also Documentation/driver-api/connector.rst
  128. config SAMPLE_FANOTIFY_ERROR
  129. bool "Build fanotify error monitoring sample"
  130. depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
  131. help
  132. When enabled, this builds an example code that uses the
  133. FAN_FS_ERROR fanotify mechanism to monitor filesystem
  134. errors.
  135. See also Documentation/admin-guide/filesystem-monitoring.rst.
  136. config SAMPLE_HIDRAW
  137. bool "hidraw sample"
  138. depends on CC_CAN_LINK && HEADERS_INSTALL
  139. config SAMPLE_LANDLOCK
  140. bool "Landlock example"
  141. depends on CC_CAN_LINK && HEADERS_INSTALL
  142. help
  143. Build a simple Landlock sandbox manager able to start a process
  144. restricted by a user-defined filesystem access control policy.
  145. config SAMPLE_PIDFD
  146. bool "pidfd sample"
  147. depends on CC_CAN_LINK && HEADERS_INSTALL
  148. config SAMPLE_SECCOMP
  149. bool "Build seccomp sample code"
  150. depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL
  151. help
  152. Build samples of seccomp filters using various methods of
  153. BPF filter construction.
  154. config SAMPLE_TIMER
  155. bool "Timer sample"
  156. depends on CC_CAN_LINK && HEADERS_INSTALL
  157. config SAMPLE_TSM_MR
  158. tristate "TSM measurement sample"
  159. select TSM_MEASUREMENTS
  160. select VIRT_DRIVERS
  161. help
  162. Build a sample module that emulates MRs (Measurement Registers) and
  163. exposes them to user mode applications through the TSM sysfs
  164. interface (/sys/class/misc/tsm_mr_sample/emulated_mr/).
  165. The module name will be tsm-mr-sample when built as a module.
  166. config SAMPLE_UHID
  167. bool "UHID sample"
  168. depends on CC_CAN_LINK && HEADERS_INSTALL
  169. help
  170. Build UHID sample program.
  171. config SAMPLE_VFIO_MDEV_MTTY
  172. tristate "Build VFIO mtty example mediated device sample code"
  173. depends on VFIO
  174. select VFIO_MDEV
  175. help
  176. Build a virtual tty sample driver for use as a VFIO
  177. mediated device
  178. config SAMPLE_VFIO_MDEV_MDPY
  179. tristate "Build VFIO mdpy example mediated device sample code"
  180. depends on VFIO
  181. select VFIO_MDEV
  182. help
  183. Build a virtual display sample driver for use as a VFIO
  184. mediated device. It is a simple framebuffer and supports
  185. the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
  186. config SAMPLE_VFIO_MDEV_MDPY_FB
  187. tristate "Build VFIO mdpy example guest fbdev driver"
  188. depends on FB
  189. select FB_IOMEM_HELPERS
  190. help
  191. Guest fbdev driver for the virtual display sample driver.
  192. config SAMPLE_VFIO_MDEV_MBOCHS
  193. tristate "Build VFIO mbochs example mediated device sample code"
  194. depends on VFIO
  195. select VFIO_MDEV
  196. select DMA_SHARED_BUFFER
  197. help
  198. Build a virtual display sample driver for use as a VFIO
  199. mediated device. It supports the region display interface
  200. (VFIO_GFX_PLANE_TYPE_DMABUF).
  201. Emulate enough of qemu stdvga to make bochs-drm.ko happy.
  202. That is basically the vram memory bar and the bochs dispi
  203. interface vbe registers in the mmio register bar.
  204. Specifically it does *not* include any legacy vga stuff.
  205. Device looks a lot like "qemu -device secondary-vga".
  206. config SAMPLE_ANDROID_BINDERFS
  207. bool "Build Android binderfs example"
  208. depends on CC_CAN_LINK && HEADERS_INSTALL
  209. help
  210. Builds a sample program to illustrate the use of the Android binderfs
  211. filesystem.
  212. config SAMPLE_VFS
  213. bool "Build example programs that use new VFS system calls"
  214. depends on CC_CAN_LINK && HEADERS_INSTALL
  215. help
  216. Build example userspace programs that use new VFS system calls such
  217. as mount API and statx(). Note that this is restricted to the x86
  218. arch whilst it accesses system calls that aren't yet in all arches.
  219. config SAMPLE_INTEL_MEI
  220. bool "Build example program working with intel mei driver"
  221. depends on INTEL_MEI
  222. depends on CC_CAN_LINK && HEADERS_INSTALL
  223. help
  224. Build a sample program to work with mei device.
  225. config SAMPLE_TPS6594_PFSM
  226. bool "Build example program working with TPS6594 PFSM driver"
  227. depends on HEADERS_INSTALL
  228. depends on CC_CAN_LINK
  229. help
  230. Build a sample program to work with PFSM devices.
  231. config SAMPLE_WATCHDOG
  232. bool "watchdog sample"
  233. depends on CC_CAN_LINK
  234. config SAMPLE_WATCH_QUEUE
  235. bool "Build example watch_queue notification API consumer"
  236. depends on CC_CAN_LINK && HEADERS_INSTALL
  237. help
  238. Build example userspace program to use the new mount_notify(),
  239. sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
  240. config SAMPLE_CORESIGHT_SYSCFG
  241. tristate "Build example loadable module for CoreSight config"
  242. depends on CORESIGHT && m
  243. help
  244. Build an example loadable module that adds new CoreSight features
  245. and configuration using the CoreSight system configuration API.
  246. This demonstrates how a user may create their own CoreSight
  247. configurations and easily load them into the system at runtime.
  248. config SAMPLE_KMEMLEAK
  249. tristate "Simple test for the kernel memory leak detector"
  250. depends on DEBUG_KMEMLEAK && m
  251. help
  252. Build a sample program which have explicitly leaks memory to test
  253. kmemleak.
  254. config SAMPLE_CGROUP
  255. bool "Build cgroup sample code"
  256. depends on CGROUPS && CC_CAN_LINK && HEADERS_INSTALL
  257. help
  258. Build samples that demonstrate the usage of the cgroup API.
  259. config SAMPLE_CHECK_EXEC
  260. bool "Exec secure bits examples"
  261. depends on CC_CAN_LINK && HEADERS_INSTALL
  262. help
  263. Build a tool to easily configure SECBIT_EXEC_RESTRICT_FILE and
  264. SECBIT_EXEC_DENY_INTERACTIVE, and a simple script interpreter to
  265. demonstrate how they should be used with execveat(2) +
  266. AT_EXECVE_CHECK.
  267. config SAMPLE_HUNG_TASK
  268. tristate "Hung task detector test code"
  269. depends on DETECT_HUNG_TASK && DEBUG_FS
  270. help
  271. Build a module that provides debugfs files (e.g., mutex, semaphore,
  272. rw_semaphore_read, rw_semaphore_write) under <debugfs>/hung_task.
  273. Reading these files with multiple processes triggers hung task
  274. detection by holding locks for a long time (256 seconds).
  275. source "samples/rust/Kconfig"
  276. source "samples/damon/Kconfig"
  277. endif # SAMPLES
  278. config HAVE_SAMPLE_FTRACE_DIRECT
  279. bool
  280. config HAVE_SAMPLE_FTRACE_DIRECT_MULTI
  281. bool