Kconfig 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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 instancess"
  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_UHID
  158. bool "UHID sample"
  159. depends on CC_CAN_LINK && HEADERS_INSTALL
  160. help
  161. Build UHID sample program.
  162. config SAMPLE_VFIO_MDEV_MTTY
  163. tristate "Build VFIO mtty example mediated device sample code"
  164. depends on VFIO
  165. select VFIO_MDEV
  166. help
  167. Build a virtual tty sample driver for use as a VFIO
  168. mediated device
  169. config SAMPLE_VFIO_MDEV_MDPY
  170. tristate "Build VFIO mdpy example mediated device sample code"
  171. depends on VFIO
  172. select VFIO_MDEV
  173. help
  174. Build a virtual display sample driver for use as a VFIO
  175. mediated device. It is a simple framebuffer and supports
  176. the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
  177. config SAMPLE_VFIO_MDEV_MDPY_FB
  178. tristate "Build VFIO mdpy example guest fbdev driver"
  179. depends on FB
  180. select FB_IOMEM_HELPERS
  181. help
  182. Guest fbdev driver for the virtual display sample driver.
  183. config SAMPLE_VFIO_MDEV_MBOCHS
  184. tristate "Build VFIO mbochs example mediated device sample code"
  185. depends on VFIO
  186. select VFIO_MDEV
  187. select DMA_SHARED_BUFFER
  188. help
  189. Build a virtual display sample driver for use as a VFIO
  190. mediated device. It supports the region display interface
  191. (VFIO_GFX_PLANE_TYPE_DMABUF).
  192. Emulate enough of qemu stdvga to make bochs-drm.ko happy.
  193. That is basically the vram memory bar and the bochs dispi
  194. interface vbe registers in the mmio register bar.
  195. Specifically it does *not* include any legacy vga stuff.
  196. Device looks a lot like "qemu -device secondary-vga".
  197. config SAMPLE_ANDROID_BINDERFS
  198. bool "Build Android binderfs example"
  199. depends on CC_CAN_LINK && HEADERS_INSTALL
  200. help
  201. Builds a sample program to illustrate the use of the Android binderfs
  202. filesystem.
  203. config SAMPLE_VFS
  204. bool "Build example programs that use new VFS system calls"
  205. depends on CC_CAN_LINK && HEADERS_INSTALL
  206. help
  207. Build example userspace programs that use new VFS system calls such
  208. as mount API and statx(). Note that this is restricted to the x86
  209. arch whilst it accesses system calls that aren't yet in all arches.
  210. config SAMPLE_INTEL_MEI
  211. bool "Build example program working with intel mei driver"
  212. depends on INTEL_MEI
  213. depends on CC_CAN_LINK && HEADERS_INSTALL
  214. help
  215. Build a sample program to work with mei device.
  216. config SAMPLE_TPS6594_PFSM
  217. bool "Build example program working with TPS6594 PFSM driver"
  218. depends on HEADERS_INSTALL
  219. depends on CC_CAN_LINK
  220. help
  221. Build a sample program to work with PFSM devices.
  222. config SAMPLE_WATCHDOG
  223. bool "watchdog sample"
  224. depends on CC_CAN_LINK
  225. config SAMPLE_WATCH_QUEUE
  226. bool "Build example watch_queue notification API consumer"
  227. depends on CC_CAN_LINK && HEADERS_INSTALL
  228. help
  229. Build example userspace program to use the new mount_notify(),
  230. sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
  231. config SAMPLE_CORESIGHT_SYSCFG
  232. tristate "Build example loadable module for CoreSight config"
  233. depends on CORESIGHT && m
  234. help
  235. Build an example loadable module that adds new CoreSight features
  236. and configuration using the CoreSight system configuration API.
  237. This demonstrates how a user may create their own CoreSight
  238. configurations and easily load them into the system at runtime.
  239. config SAMPLE_KMEMLEAK
  240. tristate "Simple test for the kernel memory leak detector"
  241. depends on DEBUG_KMEMLEAK && m
  242. help
  243. Build a sample program which have explicitly leaks memory to test
  244. kmemleak
  245. config SAMPLE_CGROUP
  246. bool "Build cgroup sample code"
  247. depends on CGROUPS && CC_CAN_LINK && HEADERS_INSTALL
  248. help
  249. Build samples that demonstrate the usage of the cgroup API.
  250. source "samples/rust/Kconfig"
  251. endif # SAMPLES
  252. config HAVE_SAMPLE_FTRACE_DIRECT
  253. bool
  254. config HAVE_SAMPLE_FTRACE_DIRECT_MULTI
  255. bool