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 29c316eb44SHeiko Carstens depends on HAVE_SAMPLE_FTRACE_DIRECT 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) 34503e4510SHeiko Carstensconfig SAMPLE_FTRACE_DIRECT_MULTI 35503e4510SHeiko Carstens tristate "Build register_ftrace_direct_multi() example" 36503e4510SHeiko Carstens depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 37503e4510SHeiko Carstens depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI 38503e4510SHeiko Carstens help 39503e4510SHeiko Carstens This builds an ftrace direct function example 40503e4510SHeiko Carstens that hooks to wake_up_process and schedule, and prints 41503e4510SHeiko Carstens the function addresses. 42503e4510SHeiko Carstens 4389ed4249SDivya Indiconfig SAMPLE_TRACE_ARRAY 4489ed4249SDivya Indi tristate "Build sample module for kernel access to Ftrace instancess" 4589ed4249SDivya Indi depends on EVENT_TRACING && m 4689ed4249SDivya Indi help 4789ed4249SDivya Indi This builds a module that demonstrates the use of various APIs to 4889ed4249SDivya Indi access Ftrace instances from within the kernel. 4989ed4249SDivya Indi 5040efcb05SGreg Kroah-Hartmanconfig SAMPLE_KOBJECT 51e7e34917SMasahiro Yamada tristate "Build kobject examples" 5240efcb05SGreg Kroah-Hartman help 5340efcb05SGreg Kroah-Hartman This config option will allow you to build a number of 5440efcb05SGreg Kroah-Hartman different kobject sample modules showing how to use kobjects, 5540efcb05SGreg Kroah-Hartman ksets, and ktypes properly. 5640efcb05SGreg Kroah-Hartman 5740efcb05SGreg Kroah-Hartman If in doubt, say "N" here. 5840efcb05SGreg Kroah-Hartman 59804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KPROBES 60804defeaSAnanth N Mavinakayanahalli tristate "Build kprobes examples -- loadable modules only" 61804defeaSAnanth N Mavinakayanahalli depends on KPROBES && m 62804defeaSAnanth N Mavinakayanahalli help 63804defeaSAnanth N Mavinakayanahalli This build several kprobes example modules. 64804defeaSAnanth N Mavinakayanahalli 65804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KRETPROBES 66804defeaSAnanth N Mavinakayanahalli tristate "Build kretprobes example -- loadable modules only" 67804defeaSAnanth N Mavinakayanahalli default m 68804defeaSAnanth N Mavinakayanahalli depends on SAMPLE_KPROBES && KRETPROBES 69804defeaSAnanth N Mavinakayanahalli 7043203993SK.Prasadconfig SAMPLE_HW_BREAKPOINT 7143203993SK.Prasad tristate "Build kernel hardware breakpoint examples -- loadable module only" 7243203993SK.Prasad depends on HAVE_HW_BREAKPOINT && m 7343203993SK.Prasad help 7443203993SK.Prasad This builds kernel hardware breakpoint example modules. 7543203993SK.Prasad 76*6ee64cc3SMasami Hiramatsuconfig SAMPLE_FPROBE 77*6ee64cc3SMasami Hiramatsu tristate "Build fprobe examples -- loadable modules only" 78*6ee64cc3SMasami Hiramatsu depends on FPROBE && m 79*6ee64cc3SMasami Hiramatsu help 80*6ee64cc3SMasami Hiramatsu This builds a fprobe example module. This module has an option 'symbol'. 81*6ee64cc3SMasami Hiramatsu You can specify a probed symbol or symbols separated with ','. 82*6ee64cc3SMasami Hiramatsu 835bf2b193SStefani Seiboldconfig SAMPLE_KFIFO 845bf2b193SStefani Seibold tristate "Build kfifo examples -- loadable modules only" 855bf2b193SStefani Seibold depends on m 865bf2b193SStefani Seibold help 875bf2b193SStefani Seibold This config option will allow you to build a number of 885bf2b193SStefani Seibold different kfifo sample modules showing how to use the 895bf2b193SStefani Seibold generic kfifo API. 905bf2b193SStefani Seibold 915bf2b193SStefani Seibold If in doubt, say "N" here. 925bf2b193SStefani Seibold 934aad8f51SJason Wesselconfig SAMPLE_KDB 9425985edcSLucas De Marchi tristate "Build kdb command example -- loadable modules only" 954aad8f51SJason Wessel depends on KGDB_KDB && m 964aad8f51SJason Wessel help 974aad8f51SJason Wessel Build an example of how to dynamically add the hello 984aad8f51SJason Wessel command to the kdb shell. 994aad8f51SJason Wessel 100842891beSBjorn Anderssonconfig SAMPLE_QMI_CLIENT 101842891beSBjorn Andersson tristate "Build qmi client sample -- loadable modules only" 102842891beSBjorn Andersson depends on m 103842891beSBjorn Andersson depends on ARCH_QCOM 104dea4bd19SArnd Bergmann depends on NET 105842891beSBjorn Andersson select QCOM_QMI_HELPERS 106842891beSBjorn Andersson help 107842891beSBjorn Andersson Build an QMI client sample driver, which demonstrates how to 108842891beSBjorn Andersson communicate with a remote QRTR service, using QMI encoded messages. 109842891beSBjorn Andersson 110779b96d2SOhad Ben-Cohenconfig SAMPLE_RPMSG_CLIENT 111779b96d2SOhad Ben-Cohen tristate "Build rpmsg client sample -- loadable modules only" 112779b96d2SOhad Ben-Cohen depends on RPMSG && m 113779b96d2SOhad Ben-Cohen help 114779b96d2SOhad Ben-Cohen Build an rpmsg client sample driver, which demonstrates how 115779b96d2SOhad Ben-Cohen to communicate with an AMP-configured remote processor over 116779b96d2SOhad Ben-Cohen the rpmsg bus. 117779b96d2SOhad Ben-Cohen 11812cf89b5SJosh Poimboeufconfig SAMPLE_LIVEPATCH 119439e7271SJoe Lawrence tristate "Build live patching samples -- loadable modules only" 12012cf89b5SJosh Poimboeuf depends on LIVEPATCH && m 12113d1cf7eSSeth Jennings help 122439e7271SJoe Lawrence Build sample live patch demonstrations. 12313d1cf7eSSeth Jennings 12451798222SChristoph Hellwigconfig SAMPLE_CONFIGFS 12551798222SChristoph Hellwig tristate "Build configfs patching sample -- loadable modules only" 12651798222SChristoph Hellwig depends on CONFIGFS_FS && m 12751798222SChristoph Hellwig help 12851798222SChristoph Hellwig Builds a sample configfs interface. 12951798222SChristoph Hellwig 13014fbff6bSArnd Bergmannconfig SAMPLE_CONNECTOR 13114fbff6bSArnd Bergmann tristate "Build connector sample -- loadable modules only" 132e949f4c2SMasahiro Yamada depends on CONNECTOR && HEADERS_INSTALL && m 13314fbff6bSArnd Bergmann help 13414fbff6bSArnd Bergmann When enabled, this builds both a sample kernel module for 13514fbff6bSArnd Bergmann the connector interface and a user space tool to communicate 13614fbff6bSArnd Bergmann with it. 137baa293e9SMauro Carvalho Chehab See also Documentation/driver-api/connector.rst 13814fbff6bSArnd Bergmann 13954510930SGabriel Krisman Bertaziconfig SAMPLE_FANOTIFY_ERROR 14054510930SGabriel Krisman Bertazi bool "Build fanotify error monitoring sample" 1418fc70b3aSGabriel Krisman Bertazi depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL 14254510930SGabriel Krisman Bertazi help 14354510930SGabriel Krisman Bertazi When enabled, this builds an example code that uses the 14454510930SGabriel Krisman Bertazi FAN_FS_ERROR fanotify mechanism to monitor filesystem 14554510930SGabriel Krisman Bertazi errors. 14654510930SGabriel Krisman Bertazi See also Documentation/admin-guide/filesystem-monitoring.rst. 14754510930SGabriel Krisman Bertazi 148e949f4c2SMasahiro Yamadaconfig SAMPLE_HIDRAW 149e949f4c2SMasahiro Yamada bool "hidraw sample" 15082d00a93SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 151e949f4c2SMasahiro Yamada 152ba84b0bfSMickaël Salaünconfig SAMPLE_LANDLOCK 153ba84b0bfSMickaël Salaün bool "Landlock example" 154ba84b0bfSMickaël Salaün depends on CC_CAN_LINK && HEADERS_INSTALL 155ba84b0bfSMickaël Salaün help 156ba84b0bfSMickaël Salaün Build a simple Landlock sandbox manager able to start a process 157ba84b0bfSMickaël Salaün restricted by a user-defined filesystem access control policy. 158ba84b0bfSMickaël Salaün 159e949f4c2SMasahiro Yamadaconfig SAMPLE_PIDFD 160e949f4c2SMasahiro Yamada bool "pidfd sample" 16160fb0b12SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 162e949f4c2SMasahiro Yamada 163f6041c1dSOlof Johanssonconfig SAMPLE_SECCOMP 1647206c124SMasahiro Yamada bool "Build seccomp sample code" 165f59e7668SMasahiro Yamada depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL 166f6041c1dSOlof Johansson help 167f6041c1dSOlof Johansson Build samples of seccomp filters using various methods of 168f6041c1dSOlof Johansson BPF filter construction. 169f6041c1dSOlof Johansson 170b98ccc71SMasahiro Yamadaconfig SAMPLE_TIMER 171b98ccc71SMasahiro Yamada bool "Timer sample" 172b98ccc71SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 173b98ccc71SMasahiro Yamada 17487ecdf4fSMasahiro Yamadaconfig SAMPLE_UHID 17587ecdf4fSMasahiro Yamada bool "UHID sample" 17687ecdf4fSMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 17787ecdf4fSMasahiro Yamada help 17887ecdf4fSMasahiro Yamada Build UHID sample program. 17987ecdf4fSMasahiro Yamada 18008c1a4efSAlex Williamsonconfig SAMPLE_VFIO_MDEV_MTTY 18108c1a4efSAlex Williamson tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" 182af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 18308c1a4efSAlex Williamson help 18408c1a4efSAlex Williamson Build a virtual tty sample driver for use as a VFIO 18508c1a4efSAlex Williamson mediated device 18608c1a4efSAlex Williamson 187d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY 188d61fc96fSGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 189af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 190d61fc96fSGerd Hoffmann help 191d61fc96fSGerd Hoffmann Build a virtual display sample driver for use as a VFIO 192d61fc96fSGerd Hoffmann mediated device. It is a simple framebuffer and supports 193d61fc96fSGerd Hoffmann the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 194d61fc96fSGerd Hoffmann 195cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB 196cacade19SGerd Hoffmann tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" 197cacade19SGerd Hoffmann depends on FB && m 198cacade19SGerd Hoffmann select FB_CFB_FILLRECT 199cacade19SGerd Hoffmann select FB_CFB_COPYAREA 200cacade19SGerd Hoffmann select FB_CFB_IMAGEBLIT 201cacade19SGerd Hoffmann help 202cacade19SGerd Hoffmann Guest fbdev driver for the virtual display sample driver. 203cacade19SGerd Hoffmann 204a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS 205a5e6e650SGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 206af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 207c1abca96SArnd Bergmann select DMA_SHARED_BUFFER 208a5e6e650SGerd Hoffmann help 209a5e6e650SGerd Hoffmann Build a virtual display sample driver for use as a VFIO 210a5e6e650SGerd Hoffmann mediated device. It supports the region display interface 211a5e6e650SGerd Hoffmann (VFIO_GFX_PLANE_TYPE_DMABUF). 212a5e6e650SGerd Hoffmann Emulate enough of qemu stdvga to make bochs-drm.ko happy. 213a5e6e650SGerd Hoffmann That is basically the vram memory bar and the bochs dispi 214a5e6e650SGerd Hoffmann interface vbe registers in the mmio register bar. 215a5e6e650SGerd Hoffmann Specifically it does *not* include any legacy vga stuff. 216a5e6e650SGerd Hoffmann Device looks a lot like "qemu -device secondary-vga". 217a5e6e650SGerd Hoffmann 2189762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS 2199762dc14SChristian Brauner bool "Build Android binderfs example" 220fca5e949SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2219762dc14SChristian Brauner help 2229762dc14SChristian Brauner Builds a sample program to illustrate the use of the Android binderfs 2239762dc14SChristian Brauner filesystem. 2249762dc14SChristian Brauner 225f1b5618eSDavid Howellsconfig SAMPLE_VFS 226f1b5618eSDavid Howells bool "Build example programs that use new VFS system calls" 22728949b84SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 228a528d35eSDavid Howells help 229f1b5618eSDavid Howells Build example userspace programs that use new VFS system calls such 230f1b5618eSDavid Howells as mount API and statx(). Note that this is restricted to the x86 231f1b5618eSDavid Howells arch whilst it accesses system calls that aren't yet in all arches. 232a528d35eSDavid Howells 2336859eba4STomas Winklerconfig SAMPLE_INTEL_MEI 2346859eba4STomas Winkler bool "Build example program working with intel mei driver" 2356859eba4STomas Winkler depends on INTEL_MEI 236c4c10996SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2376859eba4STomas Winkler help 2386859eba4STomas Winkler Build a sample program to work with mei device. 2396859eba4STomas Winkler 24088a8e278SMasahiro Yamadaconfig SAMPLE_WATCHDOG 24188a8e278SMasahiro Yamada bool "watchdog sample" 24288a8e278SMasahiro Yamada depends on CC_CAN_LINK 2436859eba4STomas Winkler 244f5b5a164SDavid Howellsconfig SAMPLE_WATCH_QUEUE 2458fe62e0cSGabriel Krisman Bertazi bool "Build example watch_queue notification API consumer" 246214377e9SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 247f5b5a164SDavid Howells help 248f5b5a164SDavid Howells Build example userspace program to use the new mount_notify(), 249f5b5a164SDavid Howells sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. 250267c4025SMathieu Desnoyers 251ede5bab8SMike Leachconfig SAMPLE_CORESIGHT_SYSCFG 252ede5bab8SMike Leach tristate "Build example loadable module for CoreSight config" 253ede5bab8SMike Leach depends on CORESIGHT && m 254ede5bab8SMike Leach help 255ede5bab8SMike Leach Build an example loadable module that adds new CoreSight features 256ede5bab8SMike Leach and configuration using the CoreSight system configuration API. 257ede5bab8SMike Leach This demonstrates how a user may create their own CoreSight 258ede5bab8SMike Leach configurations and easily load them into the system at runtime. 259ede5bab8SMike Leach 260267c4025SMathieu Desnoyersendif # SAMPLES 261c316eb44SHeiko Carstens 262c316eb44SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT 263c316eb44SHeiko Carstens bool 2640b707e57SLinus Torvalds 265503e4510SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT_MULTI 2660b707e57SLinus Torvalds bool 267