1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 2267c4025SMathieu Desnoyersmenuconfig SAMPLES 3267c4025SMathieu Desnoyers bool "Sample kernel code" 4267c4025SMathieu Desnoyers help 5267c4025SMathieu Desnoyers You can build and test sample kernel code here. 6267c4025SMathieu Desnoyers 7267c4025SMathieu Desnoyersif SAMPLES 8267c4025SMathieu Desnoyers 987ffbba9SMasahiro Yamadaconfig SAMPLE_AUXDISPLAY 1087ffbba9SMasahiro Yamada bool "auxdisplay sample" 1187ffbba9SMasahiro Yamada depends on CC_CAN_LINK 1287ffbba9SMasahiro Yamada 139cfe06f8SSteven Rostedtconfig SAMPLE_TRACE_EVENTS 1496d17980SLi Zefan tristate "Build trace_events examples -- loadable modules only" 1596d17980SLi Zefan depends on EVENT_TRACING && m 169cfe06f8SSteven Rostedt help 179cfe06f8SSteven Rostedt This build trace event example modules. 189cfe06f8SSteven Rostedt 19aad108aaSSteven Rostedt (Red Hat)config SAMPLE_TRACE_PRINTK 20aad108aaSSteven Rostedt (Red Hat) tristate "Build trace_printk module - tests various trace_printk formats" 21aad108aaSSteven Rostedt (Red Hat) depends on EVENT_TRACING && m 22aad108aaSSteven Rostedt (Red Hat) help 23aad108aaSSteven Rostedt (Red Hat) This builds a module that calls trace_printk() and can be used to 24aad108aaSSteven Rostedt (Red Hat) test various trace_printk() calls from a module. 25aad108aaSSteven Rostedt (Red Hat) 26b06457c8SSteven Rostedt (VMware)config SAMPLE_FTRACE_DIRECT 27b06457c8SSteven Rostedt (VMware) tristate "Build register_ftrace_direct() example" 28b06457c8SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 29b06457c8SSteven Rostedt (VMware) depends on X86_64 # has x86_64 inlined asm 30b06457c8SSteven Rostedt (VMware) help 31b06457c8SSteven Rostedt (VMware) This builds an ftrace direct function example 32b06457c8SSteven Rostedt (VMware) that hooks to wake_up_process and prints the parameters. 33b06457c8SSteven Rostedt (VMware) 3489ed4249SDivya Indiconfig SAMPLE_TRACE_ARRAY 3589ed4249SDivya Indi tristate "Build sample module for kernel access to Ftrace instancess" 3689ed4249SDivya Indi depends on EVENT_TRACING && m 3789ed4249SDivya Indi help 3889ed4249SDivya Indi This builds a module that demonstrates the use of various APIs to 3989ed4249SDivya Indi access Ftrace instances from within the kernel. 4089ed4249SDivya Indi 4140efcb05SGreg Kroah-Hartmanconfig SAMPLE_KOBJECT 42e7e34917SMasahiro Yamada tristate "Build kobject examples" 4340efcb05SGreg Kroah-Hartman help 4440efcb05SGreg Kroah-Hartman This config option will allow you to build a number of 4540efcb05SGreg Kroah-Hartman different kobject sample modules showing how to use kobjects, 4640efcb05SGreg Kroah-Hartman ksets, and ktypes properly. 4740efcb05SGreg Kroah-Hartman 4840efcb05SGreg Kroah-Hartman If in doubt, say "N" here. 4940efcb05SGreg Kroah-Hartman 50804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KPROBES 51804defeaSAnanth N Mavinakayanahalli tristate "Build kprobes examples -- loadable modules only" 52804defeaSAnanth N Mavinakayanahalli depends on KPROBES && m 53804defeaSAnanth N Mavinakayanahalli help 54804defeaSAnanth N Mavinakayanahalli This build several kprobes example modules. 55804defeaSAnanth N Mavinakayanahalli 56804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KRETPROBES 57804defeaSAnanth N Mavinakayanahalli tristate "Build kretprobes example -- loadable modules only" 58804defeaSAnanth N Mavinakayanahalli default m 59804defeaSAnanth N Mavinakayanahalli depends on SAMPLE_KPROBES && KRETPROBES 60804defeaSAnanth N Mavinakayanahalli 6143203993SK.Prasadconfig SAMPLE_HW_BREAKPOINT 6243203993SK.Prasad tristate "Build kernel hardware breakpoint examples -- loadable module only" 6343203993SK.Prasad depends on HAVE_HW_BREAKPOINT && m 6443203993SK.Prasad help 6543203993SK.Prasad This builds kernel hardware breakpoint example modules. 6643203993SK.Prasad 675bf2b193SStefani Seiboldconfig SAMPLE_KFIFO 685bf2b193SStefani Seibold tristate "Build kfifo examples -- loadable modules only" 695bf2b193SStefani Seibold depends on m 705bf2b193SStefani Seibold help 715bf2b193SStefani Seibold This config option will allow you to build a number of 725bf2b193SStefani Seibold different kfifo sample modules showing how to use the 735bf2b193SStefani Seibold generic kfifo API. 745bf2b193SStefani Seibold 755bf2b193SStefani Seibold If in doubt, say "N" here. 765bf2b193SStefani Seibold 774aad8f51SJason Wesselconfig SAMPLE_KDB 7825985edcSLucas De Marchi tristate "Build kdb command example -- loadable modules only" 794aad8f51SJason Wessel depends on KGDB_KDB && m 804aad8f51SJason Wessel help 814aad8f51SJason Wessel Build an example of how to dynamically add the hello 824aad8f51SJason Wessel command to the kdb shell. 834aad8f51SJason Wessel 84842891beSBjorn Anderssonconfig SAMPLE_QMI_CLIENT 85842891beSBjorn Andersson tristate "Build qmi client sample -- loadable modules only" 86842891beSBjorn Andersson depends on m 87842891beSBjorn Andersson depends on ARCH_QCOM 88dea4bd19SArnd Bergmann depends on NET 89842891beSBjorn Andersson select QCOM_QMI_HELPERS 90842891beSBjorn Andersson help 91842891beSBjorn Andersson Build an QMI client sample driver, which demonstrates how to 92842891beSBjorn Andersson communicate with a remote QRTR service, using QMI encoded messages. 93842891beSBjorn Andersson 94779b96d2SOhad Ben-Cohenconfig SAMPLE_RPMSG_CLIENT 95779b96d2SOhad Ben-Cohen tristate "Build rpmsg client sample -- loadable modules only" 96779b96d2SOhad Ben-Cohen depends on RPMSG && m 97779b96d2SOhad Ben-Cohen help 98779b96d2SOhad Ben-Cohen Build an rpmsg client sample driver, which demonstrates how 99779b96d2SOhad Ben-Cohen to communicate with an AMP-configured remote processor over 100779b96d2SOhad Ben-Cohen the rpmsg bus. 101779b96d2SOhad Ben-Cohen 10212cf89b5SJosh Poimboeufconfig SAMPLE_LIVEPATCH 103439e7271SJoe Lawrence tristate "Build live patching samples -- loadable modules only" 10412cf89b5SJosh Poimboeuf depends on LIVEPATCH && m 10513d1cf7eSSeth Jennings help 106439e7271SJoe Lawrence Build sample live patch demonstrations. 10713d1cf7eSSeth Jennings 10851798222SChristoph Hellwigconfig SAMPLE_CONFIGFS 10951798222SChristoph Hellwig tristate "Build configfs patching sample -- loadable modules only" 11051798222SChristoph Hellwig depends on CONFIGFS_FS && m 11151798222SChristoph Hellwig help 11251798222SChristoph Hellwig Builds a sample configfs interface. 11351798222SChristoph Hellwig 11414fbff6bSArnd Bergmannconfig SAMPLE_CONNECTOR 11514fbff6bSArnd Bergmann tristate "Build connector sample -- loadable modules only" 116e949f4c2SMasahiro Yamada depends on CONNECTOR && HEADERS_INSTALL && m 11714fbff6bSArnd Bergmann help 11814fbff6bSArnd Bergmann When enabled, this builds both a sample kernel module for 11914fbff6bSArnd Bergmann the connector interface and a user space tool to communicate 12014fbff6bSArnd Bergmann with it. 121baa293e9SMauro Carvalho Chehab See also Documentation/driver-api/connector.rst 12214fbff6bSArnd Bergmann 123e949f4c2SMasahiro Yamadaconfig SAMPLE_HIDRAW 124e949f4c2SMasahiro Yamada bool "hidraw sample" 12582d00a93SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 126e949f4c2SMasahiro Yamada 127ba84b0bfSMickaël Salaünconfig SAMPLE_LANDLOCK 128ba84b0bfSMickaël Salaün bool "Landlock example" 129ba84b0bfSMickaël Salaün depends on CC_CAN_LINK && HEADERS_INSTALL 130ba84b0bfSMickaël Salaün help 131ba84b0bfSMickaël Salaün Build a simple Landlock sandbox manager able to start a process 132ba84b0bfSMickaël Salaün restricted by a user-defined filesystem access control policy. 133ba84b0bfSMickaël Salaün 134e949f4c2SMasahiro Yamadaconfig SAMPLE_PIDFD 135e949f4c2SMasahiro Yamada bool "pidfd sample" 13660fb0b12SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 137e949f4c2SMasahiro Yamada 138f6041c1dSOlof Johanssonconfig SAMPLE_SECCOMP 1397206c124SMasahiro Yamada bool "Build seccomp sample code" 140f59e7668SMasahiro Yamada depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL 141f6041c1dSOlof Johansson help 142f6041c1dSOlof Johansson Build samples of seccomp filters using various methods of 143f6041c1dSOlof Johansson BPF filter construction. 144f6041c1dSOlof Johansson 145b98ccc71SMasahiro Yamadaconfig SAMPLE_TIMER 146b98ccc71SMasahiro Yamada bool "Timer sample" 147b98ccc71SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 148b98ccc71SMasahiro Yamada 14987ecdf4fSMasahiro Yamadaconfig SAMPLE_UHID 15087ecdf4fSMasahiro Yamada bool "UHID sample" 15187ecdf4fSMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 15287ecdf4fSMasahiro Yamada help 15387ecdf4fSMasahiro Yamada Build UHID sample program. 15487ecdf4fSMasahiro Yamada 15508c1a4efSAlex Williamsonconfig SAMPLE_VFIO_MDEV_MTTY 15608c1a4efSAlex Williamson tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" 157*af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 15808c1a4efSAlex Williamson help 15908c1a4efSAlex Williamson Build a virtual tty sample driver for use as a VFIO 16008c1a4efSAlex Williamson mediated device 16108c1a4efSAlex Williamson 162d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY 163d61fc96fSGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 164*af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 165d61fc96fSGerd Hoffmann help 166d61fc96fSGerd Hoffmann Build a virtual display sample driver for use as a VFIO 167d61fc96fSGerd Hoffmann mediated device. It is a simple framebuffer and supports 168d61fc96fSGerd Hoffmann the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 169d61fc96fSGerd Hoffmann 170cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB 171cacade19SGerd Hoffmann tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" 172cacade19SGerd Hoffmann depends on FB && m 173cacade19SGerd Hoffmann select FB_CFB_FILLRECT 174cacade19SGerd Hoffmann select FB_CFB_COPYAREA 175cacade19SGerd Hoffmann select FB_CFB_IMAGEBLIT 176cacade19SGerd Hoffmann help 177cacade19SGerd Hoffmann Guest fbdev driver for the virtual display sample driver. 178cacade19SGerd Hoffmann 179a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS 180a5e6e650SGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 181*af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 182c1abca96SArnd Bergmann select DMA_SHARED_BUFFER 183a5e6e650SGerd Hoffmann help 184a5e6e650SGerd Hoffmann Build a virtual display sample driver for use as a VFIO 185a5e6e650SGerd Hoffmann mediated device. It supports the region display interface 186a5e6e650SGerd Hoffmann (VFIO_GFX_PLANE_TYPE_DMABUF). 187a5e6e650SGerd Hoffmann Emulate enough of qemu stdvga to make bochs-drm.ko happy. 188a5e6e650SGerd Hoffmann That is basically the vram memory bar and the bochs dispi 189a5e6e650SGerd Hoffmann interface vbe registers in the mmio register bar. 190a5e6e650SGerd Hoffmann Specifically it does *not* include any legacy vga stuff. 191a5e6e650SGerd Hoffmann Device looks a lot like "qemu -device secondary-vga". 192a5e6e650SGerd Hoffmann 1939762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS 1949762dc14SChristian Brauner bool "Build Android binderfs example" 195fca5e949SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 1969762dc14SChristian Brauner help 1979762dc14SChristian Brauner Builds a sample program to illustrate the use of the Android binderfs 1989762dc14SChristian Brauner filesystem. 1999762dc14SChristian Brauner 200f1b5618eSDavid Howellsconfig SAMPLE_VFS 201f1b5618eSDavid Howells bool "Build example programs that use new VFS system calls" 20228949b84SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 203a528d35eSDavid Howells help 204f1b5618eSDavid Howells Build example userspace programs that use new VFS system calls such 205f1b5618eSDavid Howells as mount API and statx(). Note that this is restricted to the x86 206f1b5618eSDavid Howells arch whilst it accesses system calls that aren't yet in all arches. 207a528d35eSDavid Howells 2086859eba4STomas Winklerconfig SAMPLE_INTEL_MEI 2096859eba4STomas Winkler bool "Build example program working with intel mei driver" 2106859eba4STomas Winkler depends on INTEL_MEI 211c4c10996SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2126859eba4STomas Winkler help 2136859eba4STomas Winkler Build a sample program to work with mei device. 2146859eba4STomas Winkler 21588a8e278SMasahiro Yamadaconfig SAMPLE_WATCHDOG 21688a8e278SMasahiro Yamada bool "watchdog sample" 21788a8e278SMasahiro Yamada depends on CC_CAN_LINK 2186859eba4STomas Winkler 219f5b5a164SDavid Howellsconfig SAMPLE_WATCH_QUEUE 2208fe62e0cSGabriel Krisman Bertazi bool "Build example watch_queue notification API consumer" 221214377e9SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 222f5b5a164SDavid Howells help 223f5b5a164SDavid Howells Build example userspace program to use the new mount_notify(), 224f5b5a164SDavid Howells sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. 225267c4025SMathieu Desnoyers 226267c4025SMathieu Desnoyersendif # SAMPLES 227