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 99cfe06f8SSteven Rostedtconfig SAMPLE_TRACE_EVENTS 1096d17980SLi Zefan tristate "Build trace_events examples -- loadable modules only" 1196d17980SLi Zefan depends on EVENT_TRACING && m 129cfe06f8SSteven Rostedt help 139cfe06f8SSteven Rostedt This build trace event example modules. 149cfe06f8SSteven Rostedt 15aad108aaSSteven Rostedt (Red Hat)config SAMPLE_TRACE_PRINTK 16aad108aaSSteven Rostedt (Red Hat) tristate "Build trace_printk module - tests various trace_printk formats" 17aad108aaSSteven Rostedt (Red Hat) depends on EVENT_TRACING && m 18aad108aaSSteven Rostedt (Red Hat) help 19aad108aaSSteven Rostedt (Red Hat) This builds a module that calls trace_printk() and can be used to 20aad108aaSSteven Rostedt (Red Hat) test various trace_printk() calls from a module. 21aad108aaSSteven Rostedt (Red Hat) 22b06457c8SSteven Rostedt (VMware)config SAMPLE_FTRACE_DIRECT 23b06457c8SSteven Rostedt (VMware) tristate "Build register_ftrace_direct() example" 24b06457c8SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 25b06457c8SSteven Rostedt (VMware) depends on X86_64 # has x86_64 inlined asm 26b06457c8SSteven Rostedt (VMware) help 27b06457c8SSteven Rostedt (VMware) This builds an ftrace direct function example 28b06457c8SSteven Rostedt (VMware) that hooks to wake_up_process and prints the parameters. 29b06457c8SSteven Rostedt (VMware) 3040efcb05SGreg Kroah-Hartmanconfig SAMPLE_KOBJECT 31e7e34917SMasahiro Yamada tristate "Build kobject examples" 3240efcb05SGreg Kroah-Hartman help 3340efcb05SGreg Kroah-Hartman This config option will allow you to build a number of 3440efcb05SGreg Kroah-Hartman different kobject sample modules showing how to use kobjects, 3540efcb05SGreg Kroah-Hartman ksets, and ktypes properly. 3640efcb05SGreg Kroah-Hartman 3740efcb05SGreg Kroah-Hartman If in doubt, say "N" here. 3840efcb05SGreg Kroah-Hartman 39804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KPROBES 40804defeaSAnanth N Mavinakayanahalli tristate "Build kprobes examples -- loadable modules only" 41804defeaSAnanth N Mavinakayanahalli depends on KPROBES && m 42804defeaSAnanth N Mavinakayanahalli help 43804defeaSAnanth N Mavinakayanahalli This build several kprobes example modules. 44804defeaSAnanth N Mavinakayanahalli 45804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KRETPROBES 46804defeaSAnanth N Mavinakayanahalli tristate "Build kretprobes example -- loadable modules only" 47804defeaSAnanth N Mavinakayanahalli default m 48804defeaSAnanth N Mavinakayanahalli depends on SAMPLE_KPROBES && KRETPROBES 49804defeaSAnanth N Mavinakayanahalli 5043203993SK.Prasadconfig SAMPLE_HW_BREAKPOINT 5143203993SK.Prasad tristate "Build kernel hardware breakpoint examples -- loadable module only" 5243203993SK.Prasad depends on HAVE_HW_BREAKPOINT && m 5343203993SK.Prasad help 5443203993SK.Prasad This builds kernel hardware breakpoint example modules. 5543203993SK.Prasad 565bf2b193SStefani Seiboldconfig SAMPLE_KFIFO 575bf2b193SStefani Seibold tristate "Build kfifo examples -- loadable modules only" 585bf2b193SStefani Seibold depends on m 595bf2b193SStefani Seibold help 605bf2b193SStefani Seibold This config option will allow you to build a number of 615bf2b193SStefani Seibold different kfifo sample modules showing how to use the 625bf2b193SStefani Seibold generic kfifo API. 635bf2b193SStefani Seibold 645bf2b193SStefani Seibold If in doubt, say "N" here. 655bf2b193SStefani Seibold 664aad8f51SJason Wesselconfig SAMPLE_KDB 6725985edcSLucas De Marchi tristate "Build kdb command example -- loadable modules only" 684aad8f51SJason Wessel depends on KGDB_KDB && m 694aad8f51SJason Wessel help 704aad8f51SJason Wessel Build an example of how to dynamically add the hello 714aad8f51SJason Wessel command to the kdb shell. 724aad8f51SJason Wessel 73842891beSBjorn Anderssonconfig SAMPLE_QMI_CLIENT 74842891beSBjorn Andersson tristate "Build qmi client sample -- loadable modules only" 75842891beSBjorn Andersson depends on m 76842891beSBjorn Andersson depends on ARCH_QCOM 77dea4bd19SArnd Bergmann depends on NET 78842891beSBjorn Andersson select QCOM_QMI_HELPERS 79842891beSBjorn Andersson help 80842891beSBjorn Andersson Build an QMI client sample driver, which demonstrates how to 81842891beSBjorn Andersson communicate with a remote QRTR service, using QMI encoded messages. 82842891beSBjorn Andersson 83779b96d2SOhad Ben-Cohenconfig SAMPLE_RPMSG_CLIENT 84779b96d2SOhad Ben-Cohen tristate "Build rpmsg client sample -- loadable modules only" 85779b96d2SOhad Ben-Cohen depends on RPMSG && m 86779b96d2SOhad Ben-Cohen help 87779b96d2SOhad Ben-Cohen Build an rpmsg client sample driver, which demonstrates how 88779b96d2SOhad Ben-Cohen to communicate with an AMP-configured remote processor over 89779b96d2SOhad Ben-Cohen the rpmsg bus. 90779b96d2SOhad Ben-Cohen 9112cf89b5SJosh Poimboeufconfig SAMPLE_LIVEPATCH 92439e7271SJoe Lawrence tristate "Build live patching samples -- loadable modules only" 9312cf89b5SJosh Poimboeuf depends on LIVEPATCH && m 9413d1cf7eSSeth Jennings help 95439e7271SJoe Lawrence Build sample live patch demonstrations. 9613d1cf7eSSeth Jennings 9751798222SChristoph Hellwigconfig SAMPLE_CONFIGFS 9851798222SChristoph Hellwig tristate "Build configfs patching sample -- loadable modules only" 9951798222SChristoph Hellwig depends on CONFIGFS_FS && m 10051798222SChristoph Hellwig help 10151798222SChristoph Hellwig Builds a sample configfs interface. 10251798222SChristoph Hellwig 10314fbff6bSArnd Bergmannconfig SAMPLE_CONNECTOR 10414fbff6bSArnd Bergmann tristate "Build connector sample -- loadable modules only" 105e949f4c2SMasahiro Yamada depends on CONNECTOR && HEADERS_INSTALL && m 10614fbff6bSArnd Bergmann help 10714fbff6bSArnd Bergmann When enabled, this builds both a sample kernel module for 10814fbff6bSArnd Bergmann the connector interface and a user space tool to communicate 10914fbff6bSArnd Bergmann with it. 110baa293e9SMauro Carvalho Chehab See also Documentation/driver-api/connector.rst 11114fbff6bSArnd Bergmann 112e949f4c2SMasahiro Yamadaconfig SAMPLE_HIDRAW 113e949f4c2SMasahiro Yamada bool "hidraw sample" 114e949f4c2SMasahiro Yamada depends on HEADERS_INSTALL 115e949f4c2SMasahiro Yamada 116e949f4c2SMasahiro Yamadaconfig SAMPLE_PIDFD 117e949f4c2SMasahiro Yamada bool "pidfd sample" 118e949f4c2SMasahiro Yamada depends on HEADERS_INSTALL 119e949f4c2SMasahiro Yamada 120f6041c1dSOlof Johanssonconfig SAMPLE_SECCOMP 1217206c124SMasahiro Yamada bool "Build seccomp sample code" 122e949f4c2SMasahiro Yamada depends on SECCOMP_FILTER && HEADERS_INSTALL 123f6041c1dSOlof Johansson help 124f6041c1dSOlof Johansson Build samples of seccomp filters using various methods of 125f6041c1dSOlof Johansson BPF filter construction. 126f6041c1dSOlof Johansson 12708c1a4efSAlex Williamsonconfig SAMPLE_VFIO_MDEV_MTTY 12808c1a4efSAlex Williamson tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" 12908c1a4efSAlex Williamson depends on VFIO_MDEV_DEVICE && m 13008c1a4efSAlex Williamson help 13108c1a4efSAlex Williamson Build a virtual tty sample driver for use as a VFIO 13208c1a4efSAlex Williamson mediated device 13308c1a4efSAlex Williamson 134d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY 135d61fc96fSGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 136d61fc96fSGerd Hoffmann depends on VFIO_MDEV_DEVICE && m 137d61fc96fSGerd Hoffmann help 138d61fc96fSGerd Hoffmann Build a virtual display sample driver for use as a VFIO 139d61fc96fSGerd Hoffmann mediated device. It is a simple framebuffer and supports 140d61fc96fSGerd Hoffmann the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 141d61fc96fSGerd Hoffmann 142cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB 143cacade19SGerd Hoffmann tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" 144cacade19SGerd Hoffmann depends on FB && m 145cacade19SGerd Hoffmann select FB_CFB_FILLRECT 146cacade19SGerd Hoffmann select FB_CFB_COPYAREA 147cacade19SGerd Hoffmann select FB_CFB_IMAGEBLIT 148cacade19SGerd Hoffmann help 149cacade19SGerd Hoffmann Guest fbdev driver for the virtual display sample driver. 150cacade19SGerd Hoffmann 151a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS 152a5e6e650SGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 153a5e6e650SGerd Hoffmann depends on VFIO_MDEV_DEVICE && m 154c1abca96SArnd Bergmann select DMA_SHARED_BUFFER 155a5e6e650SGerd Hoffmann help 156a5e6e650SGerd Hoffmann Build a virtual display sample driver for use as a VFIO 157a5e6e650SGerd Hoffmann mediated device. It supports the region display interface 158a5e6e650SGerd Hoffmann (VFIO_GFX_PLANE_TYPE_DMABUF). 159a5e6e650SGerd Hoffmann Emulate enough of qemu stdvga to make bochs-drm.ko happy. 160a5e6e650SGerd Hoffmann That is basically the vram memory bar and the bochs dispi 161a5e6e650SGerd Hoffmann interface vbe registers in the mmio register bar. 162a5e6e650SGerd Hoffmann Specifically it does *not* include any legacy vga stuff. 163a5e6e650SGerd Hoffmann Device looks a lot like "qemu -device secondary-vga". 164a5e6e650SGerd Hoffmann 1659762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS 1669762dc14SChristian Brauner bool "Build Android binderfs example" 1679762dc14SChristian Brauner depends on CONFIG_ANDROID_BINDERFS 1689762dc14SChristian Brauner help 1699762dc14SChristian Brauner Builds a sample program to illustrate the use of the Android binderfs 1709762dc14SChristian Brauner filesystem. 1719762dc14SChristian Brauner 172f1b5618eSDavid Howellsconfig SAMPLE_VFS 173f1b5618eSDavid Howells bool "Build example programs that use new VFS system calls" 174e949f4c2SMasahiro Yamada depends on HEADERS_INSTALL 175a528d35eSDavid Howells help 176f1b5618eSDavid Howells Build example userspace programs that use new VFS system calls such 177f1b5618eSDavid Howells as mount API and statx(). Note that this is restricted to the x86 178f1b5618eSDavid Howells arch whilst it accesses system calls that aren't yet in all arches. 179a528d35eSDavid Howells 180267c4025SMathieu Desnoyersendif # SAMPLES 181