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 1876b182403SChristoph Hellwig tristate "Build VFIO mtty example mediated device sample code" 188*de858a05SArnd Bergmann depends on VFIO 1898bf8c5eeSChristoph Hellwig select VFIO_MDEV 19008c1a4efSAlex Williamson help 19108c1a4efSAlex Williamson Build a virtual tty sample driver for use as a VFIO 19208c1a4efSAlex Williamson mediated device 19308c1a4efSAlex Williamson 194d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY 1956b182403SChristoph Hellwig tristate "Build VFIO mdpy example mediated device sample code" 196*de858a05SArnd Bergmann depends on VFIO 1978bf8c5eeSChristoph Hellwig select VFIO_MDEV 198d61fc96fSGerd Hoffmann help 199d61fc96fSGerd Hoffmann Build a virtual display sample driver for use as a VFIO 200d61fc96fSGerd Hoffmann mediated device. It is a simple framebuffer and supports 201d61fc96fSGerd Hoffmann the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 202d61fc96fSGerd Hoffmann 203cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB 2046b182403SChristoph Hellwig tristate "Build VFIO mdpy example guest fbdev driver" 2056b182403SChristoph Hellwig depends on FB 206cacade19SGerd Hoffmann select FB_CFB_FILLRECT 207cacade19SGerd Hoffmann select FB_CFB_COPYAREA 208cacade19SGerd Hoffmann select FB_CFB_IMAGEBLIT 209cacade19SGerd Hoffmann help 210cacade19SGerd Hoffmann Guest fbdev driver for the virtual display sample driver. 211cacade19SGerd Hoffmann 212a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS 2136b182403SChristoph Hellwig tristate "Build VFIO mdpy example mediated device sample code" 214*de858a05SArnd Bergmann depends on VFIO 2158bf8c5eeSChristoph Hellwig select VFIO_MDEV 216c1abca96SArnd Bergmann select DMA_SHARED_BUFFER 217a5e6e650SGerd Hoffmann help 218a5e6e650SGerd Hoffmann Build a virtual display sample driver for use as a VFIO 219a5e6e650SGerd Hoffmann mediated device. It supports the region display interface 220a5e6e650SGerd Hoffmann (VFIO_GFX_PLANE_TYPE_DMABUF). 221a5e6e650SGerd Hoffmann Emulate enough of qemu stdvga to make bochs-drm.ko happy. 222a5e6e650SGerd Hoffmann That is basically the vram memory bar and the bochs dispi 223a5e6e650SGerd Hoffmann interface vbe registers in the mmio register bar. 224a5e6e650SGerd Hoffmann Specifically it does *not* include any legacy vga stuff. 225a5e6e650SGerd Hoffmann Device looks a lot like "qemu -device secondary-vga". 226a5e6e650SGerd Hoffmann 2279762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS 2289762dc14SChristian Brauner bool "Build Android binderfs example" 229fca5e949SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2309762dc14SChristian Brauner help 2319762dc14SChristian Brauner Builds a sample program to illustrate the use of the Android binderfs 2329762dc14SChristian Brauner filesystem. 2339762dc14SChristian Brauner 234f1b5618eSDavid Howellsconfig SAMPLE_VFS 235f1b5618eSDavid Howells bool "Build example programs that use new VFS system calls" 23628949b84SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 237a528d35eSDavid Howells help 238f1b5618eSDavid Howells Build example userspace programs that use new VFS system calls such 239f1b5618eSDavid Howells as mount API and statx(). Note that this is restricted to the x86 240f1b5618eSDavid Howells arch whilst it accesses system calls that aren't yet in all arches. 241a528d35eSDavid Howells 2426859eba4STomas Winklerconfig SAMPLE_INTEL_MEI 2436859eba4STomas Winkler bool "Build example program working with intel mei driver" 2446859eba4STomas Winkler depends on INTEL_MEI 245c4c10996SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 2466859eba4STomas Winkler help 2476859eba4STomas Winkler Build a sample program to work with mei device. 2486859eba4STomas Winkler 24988a8e278SMasahiro Yamadaconfig SAMPLE_WATCHDOG 25088a8e278SMasahiro Yamada bool "watchdog sample" 25188a8e278SMasahiro Yamada depends on CC_CAN_LINK 2526859eba4STomas Winkler 253f5b5a164SDavid Howellsconfig SAMPLE_WATCH_QUEUE 2548fe62e0cSGabriel Krisman Bertazi bool "Build example watch_queue notification API consumer" 255214377e9SMasahiro Yamada depends on CC_CAN_LINK && HEADERS_INSTALL 256f5b5a164SDavid Howells help 257f5b5a164SDavid Howells Build example userspace program to use the new mount_notify(), 258f5b5a164SDavid Howells sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. 259267c4025SMathieu Desnoyers 260ede5bab8SMike Leachconfig SAMPLE_CORESIGHT_SYSCFG 261ede5bab8SMike Leach tristate "Build example loadable module for CoreSight config" 262ede5bab8SMike Leach depends on CORESIGHT && m 263ede5bab8SMike Leach help 264ede5bab8SMike Leach Build an example loadable module that adds new CoreSight features 265ede5bab8SMike Leach and configuration using the CoreSight system configuration API. 266ede5bab8SMike Leach This demonstrates how a user may create their own CoreSight 267ede5bab8SMike Leach configurations and easily load them into the system at runtime. 268ede5bab8SMike Leach 269e4fc6580SMiguel Ojedasource "samples/rust/Kconfig" 270e4fc6580SMiguel Ojeda 271267c4025SMathieu Desnoyersendif # SAMPLES 272c316eb44SHeiko Carstens 273c316eb44SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT 274c316eb44SHeiko Carstens bool 2750b707e57SLinus Torvalds 276503e4510SHeiko Carstensconfig HAVE_SAMPLE_FTRACE_DIRECT_MULTI 2770b707e57SLinus Torvalds bool 278