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 17953c2f05SSteven Rostedt (Google) This builds the trace event example module. 18953c2f05SSteven Rostedt (Google) 19953c2f05SSteven Rostedt (Google)config SAMPLE_TRACE_CUSTOM_EVENTS 20953c2f05SSteven Rostedt (Google) tristate "Build custom trace event example -- loadable modules only" 21953c2f05SSteven Rostedt (Google) depends on EVENT_TRACING && m 22953c2f05SSteven Rostedt (Google) help 23953c2f05SSteven Rostedt (Google) This builds the custom trace event example module. 249cfe06f8SSteven Rostedt 25aad108aaSSteven Rostedt (Red Hat)config SAMPLE_TRACE_PRINTK 26aad108aaSSteven Rostedt (Red Hat) tristate "Build trace_printk module - tests various trace_printk formats" 27aad108aaSSteven Rostedt (Red Hat) depends on EVENT_TRACING && m 28aad108aaSSteven Rostedt (Red Hat) help 29aad108aaSSteven Rostedt (Red Hat) This builds a module that calls trace_printk() and can be used to 30aad108aaSSteven Rostedt (Red Hat) test various trace_printk() calls from a module. 31aad108aaSSteven Rostedt (Red Hat) 32b06457c8SSteven Rostedt (VMware)config SAMPLE_FTRACE_DIRECT 33b06457c8SSteven Rostedt (VMware) tristate "Build register_ftrace_direct() example" 34b06457c8SSteven Rostedt (VMware) depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 35c316eb44SHeiko Carstens depends on HAVE_SAMPLE_FTRACE_DIRECT 36b06457c8SSteven Rostedt (VMware) help 37b06457c8SSteven Rostedt (VMware) This builds an ftrace direct function example 38b06457c8SSteven Rostedt (VMware) that hooks to wake_up_process and prints the parameters. 39b06457c8SSteven Rostedt (VMware) 40503e4510SHeiko Carstensconfig SAMPLE_FTRACE_DIRECT_MULTI 41503e4510SHeiko Carstens tristate "Build register_ftrace_direct_multi() example" 42503e4510SHeiko Carstens depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 43503e4510SHeiko Carstens depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI 44503e4510SHeiko Carstens help 45503e4510SHeiko Carstens This builds an ftrace direct function example 46503e4510SHeiko Carstens that hooks to wake_up_process and schedule, and prints 47503e4510SHeiko Carstens the function addresses. 48503e4510SHeiko Carstens 4989ed4249SDivya Indiconfig SAMPLE_TRACE_ARRAY 5089ed4249SDivya Indi tristate "Build sample module for kernel access to Ftrace instancess" 5189ed4249SDivya Indi depends on EVENT_TRACING && m 5289ed4249SDivya Indi help 5389ed4249SDivya Indi This builds a module that demonstrates the use of various APIs to 5489ed4249SDivya Indi access Ftrace instances from within the kernel. 5589ed4249SDivya Indi 5640efcb05SGreg Kroah-Hartmanconfig SAMPLE_KOBJECT 57e7e34917SMasahiro Yamada tristate "Build kobject examples" 5840efcb05SGreg Kroah-Hartman help 5940efcb05SGreg Kroah-Hartman This config option will allow you to build a number of 6040efcb05SGreg Kroah-Hartman different kobject sample modules showing how to use kobjects, 6140efcb05SGreg Kroah-Hartman ksets, and ktypes properly. 6240efcb05SGreg Kroah-Hartman 6340efcb05SGreg Kroah-Hartman If in doubt, say "N" here. 6440efcb05SGreg Kroah-Hartman 65804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KPROBES 66804defeaSAnanth N Mavinakayanahalli tristate "Build kprobes examples -- loadable modules only" 67804defeaSAnanth N Mavinakayanahalli depends on KPROBES && m 68804defeaSAnanth N Mavinakayanahalli help 69804defeaSAnanth N Mavinakayanahalli This build several kprobes example modules. 70804defeaSAnanth N Mavinakayanahalli 71804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KRETPROBES 72804defeaSAnanth N Mavinakayanahalli tristate "Build kretprobes example -- loadable modules only" 73804defeaSAnanth N Mavinakayanahalli default m 74804defeaSAnanth N Mavinakayanahalli depends on SAMPLE_KPROBES && KRETPROBES 75804defeaSAnanth N Mavinakayanahalli 7643203993SK.Prasadconfig SAMPLE_HW_BREAKPOINT 7743203993SK.Prasad tristate "Build kernel hardware breakpoint examples -- loadable module only" 7843203993SK.Prasad depends on HAVE_HW_BREAKPOINT && m 7943203993SK.Prasad help 8043203993SK.Prasad This builds kernel hardware breakpoint example modules. 8143203993SK.Prasad 826ee64cc3SMasami Hiramatsuconfig SAMPLE_FPROBE 836ee64cc3SMasami Hiramatsu tristate "Build fprobe examples -- loadable modules only" 846ee64cc3SMasami Hiramatsu depends on FPROBE && m 856ee64cc3SMasami Hiramatsu help 866ee64cc3SMasami Hiramatsu This builds a fprobe example module. This module has an option 'symbol'. 876ee64cc3SMasami Hiramatsu You can specify a probed symbol or symbols separated with ','. 886ee64cc3SMasami Hiramatsu 895bf2b193SStefani Seiboldconfig SAMPLE_KFIFO 905bf2b193SStefani Seibold tristate "Build kfifo examples -- loadable modules only" 915bf2b193SStefani Seibold depends on m 925bf2b193SStefani Seibold help 935bf2b193SStefani Seibold This config option will allow you to build a number of 945bf2b193SStefani Seibold different kfifo sample modules showing how to use the 955bf2b193SStefani Seibold generic kfifo API. 965bf2b193SStefani Seibold 975bf2b193SStefani Seibold If in doubt, say "N" here. 985bf2b193SStefani Seibold 994aad8f51SJason Wesselconfig SAMPLE_KDB 10025985edcSLucas De Marchi tristate "Build kdb command example -- loadable modules only" 1014aad8f51SJason Wessel depends on KGDB_KDB && m 1024aad8f51SJason Wessel help 1034aad8f51SJason Wessel Build an example of how to dynamically add the hello 1044aad8f51SJason Wessel command to the kdb shell. 1054aad8f51SJason Wessel 106842891beSBjorn Anderssonconfig SAMPLE_QMI_CLIENT 107842891beSBjorn Andersson tristate "Build qmi client sample -- loadable modules only" 108842891beSBjorn Andersson depends on m 109842891beSBjorn Andersson depends on ARCH_QCOM 110dea4bd19SArnd Bergmann depends on NET 111842891beSBjorn Andersson select QCOM_QMI_HELPERS 112842891beSBjorn Andersson help 113842891beSBjorn Andersson Build an QMI client sample driver, which demonstrates how to 114842891beSBjorn Andersson communicate with a remote QRTR service, using QMI encoded messages. 115842891beSBjorn Andersson 116779b96d2SOhad Ben-Cohenconfig SAMPLE_RPMSG_CLIENT 117779b96d2SOhad Ben-Cohen tristate "Build rpmsg client sample -- loadable modules only" 118779b96d2SOhad Ben-Cohen depends on RPMSG && m 119779b96d2SOhad Ben-Cohen help 120779b96d2SOhad Ben-Cohen Build an rpmsg client sample driver, which demonstrates how 121779b96d2SOhad Ben-Cohen to communicate with an AMP-configured remote processor over 122779b96d2SOhad Ben-Cohen the rpmsg bus. 123779b96d2SOhad Ben-Cohen 12412cf89b5SJosh Poimboeufconfig SAMPLE_LIVEPATCH 125439e7271SJoe Lawrence tristate "Build live patching samples -- loadable modules only" 12612cf89b5SJosh Poimboeuf depends on LIVEPATCH && m 12713d1cf7eSSeth Jennings help 128439e7271SJoe Lawrence Build sample live patch demonstrations. 12913d1cf7eSSeth Jennings 13051798222SChristoph Hellwigconfig SAMPLE_CONFIGFS 13151798222SChristoph Hellwig tristate "Build configfs patching sample -- loadable modules only" 13251798222SChristoph Hellwig depends on CONFIGFS_FS && m 13351798222SChristoph Hellwig help 13451798222SChristoph Hellwig Builds a sample configfs interface. 13551798222SChristoph Hellwig 13614fbff6bSArnd Bergmannconfig SAMPLE_CONNECTOR 13714fbff6bSArnd Bergmann tristate "Build connector sample -- loadable modules only" 138e949f4c2SMasahiro Yamada depends on CONNECTOR && HEADERS_INSTALL && m 13914fbff6bSArnd Bergmann help 14014fbff6bSArnd Bergmann When enabled, this builds both a sample kernel module for 14114fbff6bSArnd Bergmann the connector interface and a user space tool to communicate 14214fbff6bSArnd Bergmann with it. 143baa293e9SMauro Carvalho Chehab See also Documentation/driver-api/connector.rst 14414fbff6bSArnd Bergmann 14554510930SGabriel Krisman Bertaziconfig SAMPLE_FANOTIFY_ERROR 14654510930SGabriel Krisman Bertazi bool "Build fanotify error monitoring sample" 1478fc70b3aSGabriel Krisman Bertazi depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL 14854510930SGabriel Krisman Bertazi help 14954510930SGabriel Krisman Bertazi When enabled, this builds an example code that uses the 15054510930SGabriel Krisman Bertazi FAN_FS_ERROR fanotify mechanism to monitor filesystem 15154510930SGabriel Krisman Bertazi errors. 15254510930SGabriel Krisman Bertazi See also Documentation/admin-guide/filesystem-monitoring.rst. 15354510930SGabriel Krisman Bertazi 154e949f4c2SMasahiro Yamadaconfig SAMPLE_HIDRAW 155e949f4c2SMasahiro Yamada bool "hidraw sample" 15682d00a93SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 157e949f4c2SMasahiro Yamada 158ba84b0bfSMickaël Salaünconfig SAMPLE_LANDLOCK 159ba84b0bfSMickaël Salaün bool "Landlock example" 160ba84b0bfSMickaël Salaün depends on CC_CAN_LINK && HEADERS_INSTALL 161ba84b0bfSMickaël Salaün help 162ba84b0bfSMickaël Salaün Build a simple Landlock sandbox manager able to start a process 163ba84b0bfSMickaël Salaün restricted by a user-defined filesystem access control policy. 164ba84b0bfSMickaël Salaün 165e949f4c2SMasahiro Yamadaconfig SAMPLE_PIDFD 166e949f4c2SMasahiro Yamada bool "pidfd sample" 16760fb0b12SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 168e949f4c2SMasahiro Yamada 169f6041c1dSOlof Johanssonconfig SAMPLE_SECCOMP 1707206c124SMasahiro Yamada bool "Build seccomp sample code" 171f59e7668SMasahiro Yamada depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL 172f6041c1dSOlof Johansson help 173f6041c1dSOlof Johansson Build samples of seccomp filters using various methods of 174f6041c1dSOlof Johansson BPF filter construction. 175f6041c1dSOlof Johansson 176b98ccc71SMasahiro Yamadaconfig SAMPLE_TIMER 177b98ccc71SMasahiro Yamada bool "Timer sample" 178b98ccc71SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 179b98ccc71SMasahiro Yamada 18087ecdf4fSMasahiro Yamadaconfig SAMPLE_UHID 18187ecdf4fSMasahiro Yamada bool "UHID sample" 18287ecdf4fSMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 18387ecdf4fSMasahiro Yamada help 18487ecdf4fSMasahiro Yamada Build UHID sample program. 18587ecdf4fSMasahiro Yamada 18608c1a4efSAlex Williamsonconfig SAMPLE_VFIO_MDEV_MTTY 18708c1a4efSAlex Williamson tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" 188af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 18908c1a4efSAlex Williamson help 19008c1a4efSAlex Williamson Build a virtual tty sample driver for use as a VFIO 19108c1a4efSAlex Williamson mediated device 19208c1a4efSAlex Williamson 193d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY 194d61fc96fSGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 195af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 196d61fc96fSGerd Hoffmann help 197d61fc96fSGerd Hoffmann Build a virtual display sample driver for use as a VFIO 198d61fc96fSGerd Hoffmann mediated device. It is a simple framebuffer and supports 199d61fc96fSGerd Hoffmann the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 200d61fc96fSGerd Hoffmann 201cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB 202cacade19SGerd Hoffmann tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" 203cacade19SGerd Hoffmann depends on FB && m 204cacade19SGerd Hoffmann select FB_CFB_FILLRECT 205cacade19SGerd Hoffmann select FB_CFB_COPYAREA 206cacade19SGerd Hoffmann select FB_CFB_IMAGEBLIT 207cacade19SGerd Hoffmann help 208cacade19SGerd Hoffmann Guest fbdev driver for the virtual display sample driver. 209cacade19SGerd Hoffmann 210a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS 211a5e6e650SGerd Hoffmann tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 212af3ab3f9SJason Gunthorpe depends on VFIO_MDEV && m 213c1abca96SArnd Bergmann select DMA_SHARED_BUFFER 214a5e6e650SGerd Hoffmann help 215a5e6e650SGerd Hoffmann Build a virtual display sample driver for use as a VFIO 216a5e6e650SGerd Hoffmann mediated device. It supports the region display interface 217a5e6e650SGerd Hoffmann (VFIO_GFX_PLANE_TYPE_DMABUF). 218a5e6e650SGerd Hoffmann Emulate enough of qemu stdvga to make bochs-drm.ko happy. 219a5e6e650SGerd Hoffmann That is basically the vram memory bar and the bochs dispi 220a5e6e650SGerd Hoffmann interface vbe registers in the mmio register bar. 221a5e6e650SGerd Hoffmann Specifically it does *not* include any legacy vga stuff. 222a5e6e650SGerd Hoffmann Device looks a lot like "qemu -device secondary-vga". 223a5e6e650SGerd Hoffmann 2249762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS 2259762dc14SChristian Brauner bool "Build Android binderfs example" 226fca5e949SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2279762dc14SChristian Brauner help 2289762dc14SChristian Brauner Builds a sample program to illustrate the use of the Android binderfs 2299762dc14SChristian Brauner filesystem. 2309762dc14SChristian Brauner 231f1b5618eSDavid Howellsconfig SAMPLE_VFS 232f1b5618eSDavid Howells bool "Build example programs that use new VFS system calls" 23328949b84SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 234a528d35eSDavid Howells help 235f1b5618eSDavid Howells Build example userspace programs that use new VFS system calls such 236f1b5618eSDavid Howells as mount API and statx(). Note that this is restricted to the x86 237f1b5618eSDavid Howells arch whilst it accesses system calls that aren't yet in all arches. 238a528d35eSDavid Howells 2396859eba4STomas Winklerconfig SAMPLE_INTEL_MEI 2406859eba4STomas Winkler bool "Build example program working with intel mei driver" 2416859eba4STomas Winkler depends on INTEL_MEI 242c4c10996SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2436859eba4STomas Winkler help 2446859eba4STomas Winkler Build a sample program to work with mei device. 2456859eba4STomas Winkler 24688a8e278SMasahiro Yamadaconfig SAMPLE_WATCHDOG 24788a8e278SMasahiro Yamada bool "watchdog sample" 24888a8e278SMasahiro Yamada depends on CC_CAN_LINK 2496859eba4STomas Winkler 250f5b5a164SDavid Howellsconfig SAMPLE_WATCH_QUEUE 2518fe62e0cSGabriel Krisman Bertazi bool "Build example watch_queue notification API consumer" 252214377e9SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 253f5b5a164SDavid Howells help 254f5b5a164SDavid Howells Build example userspace program to use the new mount_notify(), 255f5b5a164SDavid Howells sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. 256267c4025SMathieu Desnoyers 257ede5bab8SMike Leachconfig SAMPLE_CORESIGHT_SYSCFG 258ede5bab8SMike Leach tristate "Build example loadable module for CoreSight config" 259ede5bab8SMike Leach depends on CORESIGHT && m 260ede5bab8SMike Leach help 261ede5bab8SMike Leach Build an example loadable module that adds new CoreSight features 262ede5bab8SMike Leach and configuration using the CoreSight system configuration API. 263ede5bab8SMike Leach This demonstrates how a user may create their own CoreSight 264ede5bab8SMike Leach configurations and easily load them into the system at runtime. 265ede5bab8SMike Leach 266*e4fc6580SMiguel Ojedasource "samples/rust/Kconfig" 267*e4fc6580SMiguel Ojeda 268267c4025SMathieu Desnoyersendif # SAMPLES 269c316eb44SHeiko Carstens 270c316eb44SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT 271c316eb44SHeiko Carstens bool 2720b707e57SLinus Torvalds 273503e4510SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT_MULTI 2740b707e57SLinus Torvalds bool 275