1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only 2*4882a593Smuzhiyunmenuconfig SAMPLES 3*4882a593Smuzhiyun bool "Sample kernel code" 4*4882a593Smuzhiyun help 5*4882a593Smuzhiyun You can build and test sample kernel code here. 6*4882a593Smuzhiyun 7*4882a593Smuzhiyunif SAMPLES 8*4882a593Smuzhiyun 9*4882a593Smuzhiyunconfig SAMPLE_AUXDISPLAY 10*4882a593Smuzhiyun bool "auxdisplay sample" 11*4882a593Smuzhiyun depends on CC_CAN_LINK 12*4882a593Smuzhiyun 13*4882a593Smuzhiyunconfig SAMPLE_TRACE_EVENTS 14*4882a593Smuzhiyun tristate "Build trace_events examples -- loadable modules only" 15*4882a593Smuzhiyun depends on EVENT_TRACING && m 16*4882a593Smuzhiyun help 17*4882a593Smuzhiyun This build trace event example modules. 18*4882a593Smuzhiyun 19*4882a593Smuzhiyunconfig SAMPLE_TRACE_PRINTK 20*4882a593Smuzhiyun tristate "Build trace_printk module - tests various trace_printk formats" 21*4882a593Smuzhiyun depends on EVENT_TRACING && m 22*4882a593Smuzhiyun help 23*4882a593Smuzhiyun This builds a module that calls trace_printk() and can be used to 24*4882a593Smuzhiyun test various trace_printk() calls from a module. 25*4882a593Smuzhiyun 26*4882a593Smuzhiyunconfig SAMPLE_FTRACE_DIRECT 27*4882a593Smuzhiyun tristate "Build register_ftrace_direct() example" 28*4882a593Smuzhiyun depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m 29*4882a593Smuzhiyun depends on X86_64 # has x86_64 inlined asm 30*4882a593Smuzhiyun help 31*4882a593Smuzhiyun This builds an ftrace direct function example 32*4882a593Smuzhiyun that hooks to wake_up_process and prints the parameters. 33*4882a593Smuzhiyun 34*4882a593Smuzhiyunconfig SAMPLE_TRACE_ARRAY 35*4882a593Smuzhiyun tristate "Build sample module for kernel access to Ftrace instancess" 36*4882a593Smuzhiyun depends on EVENT_TRACING && m 37*4882a593Smuzhiyun help 38*4882a593Smuzhiyun This builds a module that demonstrates the use of various APIs to 39*4882a593Smuzhiyun access Ftrace instances from within the kernel. 40*4882a593Smuzhiyun 41*4882a593Smuzhiyunconfig SAMPLE_KOBJECT 42*4882a593Smuzhiyun tristate "Build kobject examples" 43*4882a593Smuzhiyun help 44*4882a593Smuzhiyun This config option will allow you to build a number of 45*4882a593Smuzhiyun different kobject sample modules showing how to use kobjects, 46*4882a593Smuzhiyun ksets, and ktypes properly. 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun If in doubt, say "N" here. 49*4882a593Smuzhiyun 50*4882a593Smuzhiyunconfig SAMPLE_KPROBES 51*4882a593Smuzhiyun tristate "Build kprobes examples -- loadable modules only" 52*4882a593Smuzhiyun depends on KPROBES && m 53*4882a593Smuzhiyun help 54*4882a593Smuzhiyun This build several kprobes example modules. 55*4882a593Smuzhiyun 56*4882a593Smuzhiyunconfig SAMPLE_KRETPROBES 57*4882a593Smuzhiyun tristate "Build kretprobes example -- loadable modules only" 58*4882a593Smuzhiyun default m 59*4882a593Smuzhiyun depends on SAMPLE_KPROBES && KRETPROBES 60*4882a593Smuzhiyun 61*4882a593Smuzhiyunconfig SAMPLE_HW_BREAKPOINT 62*4882a593Smuzhiyun tristate "Build kernel hardware breakpoint examples -- loadable module only" 63*4882a593Smuzhiyun depends on HAVE_HW_BREAKPOINT && m 64*4882a593Smuzhiyun help 65*4882a593Smuzhiyun This builds kernel hardware breakpoint example modules. 66*4882a593Smuzhiyun 67*4882a593Smuzhiyunconfig SAMPLE_KFIFO 68*4882a593Smuzhiyun tristate "Build kfifo examples -- loadable modules only" 69*4882a593Smuzhiyun depends on m 70*4882a593Smuzhiyun help 71*4882a593Smuzhiyun This config option will allow you to build a number of 72*4882a593Smuzhiyun different kfifo sample modules showing how to use the 73*4882a593Smuzhiyun generic kfifo API. 74*4882a593Smuzhiyun 75*4882a593Smuzhiyun If in doubt, say "N" here. 76*4882a593Smuzhiyun 77*4882a593Smuzhiyunconfig SAMPLE_KDB 78*4882a593Smuzhiyun tristate "Build kdb command example -- loadable modules only" 79*4882a593Smuzhiyun depends on KGDB_KDB && m 80*4882a593Smuzhiyun help 81*4882a593Smuzhiyun Build an example of how to dynamically add the hello 82*4882a593Smuzhiyun command to the kdb shell. 83*4882a593Smuzhiyun 84*4882a593Smuzhiyunconfig SAMPLE_QMI_CLIENT 85*4882a593Smuzhiyun tristate "Build qmi client sample -- loadable modules only" 86*4882a593Smuzhiyun depends on m 87*4882a593Smuzhiyun depends on ARCH_QCOM 88*4882a593Smuzhiyun depends on NET 89*4882a593Smuzhiyun select QCOM_QMI_HELPERS 90*4882a593Smuzhiyun help 91*4882a593Smuzhiyun Build an QMI client sample driver, which demonstrates how to 92*4882a593Smuzhiyun communicate with a remote QRTR service, using QMI encoded messages. 93*4882a593Smuzhiyun 94*4882a593Smuzhiyunconfig SAMPLE_RPMSG_CLIENT 95*4882a593Smuzhiyun tristate "Build rpmsg client sample -- loadable modules only" 96*4882a593Smuzhiyun depends on RPMSG && m 97*4882a593Smuzhiyun help 98*4882a593Smuzhiyun Build an rpmsg client sample driver, which demonstrates how 99*4882a593Smuzhiyun to communicate with an AMP-configured remote processor over 100*4882a593Smuzhiyun the rpmsg bus. 101*4882a593Smuzhiyun 102*4882a593Smuzhiyunconfig SAMPLE_LIVEPATCH 103*4882a593Smuzhiyun tristate "Build live patching samples -- loadable modules only" 104*4882a593Smuzhiyun depends on LIVEPATCH && m 105*4882a593Smuzhiyun help 106*4882a593Smuzhiyun Build sample live patch demonstrations. 107*4882a593Smuzhiyun 108*4882a593Smuzhiyunconfig SAMPLE_CONFIGFS 109*4882a593Smuzhiyun tristate "Build configfs patching sample -- loadable modules only" 110*4882a593Smuzhiyun depends on CONFIGFS_FS && m 111*4882a593Smuzhiyun help 112*4882a593Smuzhiyun Builds a sample configfs interface. 113*4882a593Smuzhiyun 114*4882a593Smuzhiyunconfig SAMPLE_CONNECTOR 115*4882a593Smuzhiyun tristate "Build connector sample -- loadable modules only" 116*4882a593Smuzhiyun depends on CONNECTOR && HEADERS_INSTALL && m 117*4882a593Smuzhiyun help 118*4882a593Smuzhiyun When enabled, this builds both a sample kernel module for 119*4882a593Smuzhiyun the connector interface and a user space tool to communicate 120*4882a593Smuzhiyun with it. 121*4882a593Smuzhiyun See also Documentation/driver-api/connector.rst 122*4882a593Smuzhiyun 123*4882a593Smuzhiyunconfig SAMPLE_HIDRAW 124*4882a593Smuzhiyun bool "hidraw sample" 125*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 126*4882a593Smuzhiyun 127*4882a593Smuzhiyunconfig SAMPLE_PIDFD 128*4882a593Smuzhiyun bool "pidfd sample" 129*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 130*4882a593Smuzhiyun 131*4882a593Smuzhiyunconfig SAMPLE_SECCOMP 132*4882a593Smuzhiyun bool "Build seccomp sample code" 133*4882a593Smuzhiyun depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL 134*4882a593Smuzhiyun help 135*4882a593Smuzhiyun Build samples of seccomp filters using various methods of 136*4882a593Smuzhiyun BPF filter construction. 137*4882a593Smuzhiyun 138*4882a593Smuzhiyunconfig SAMPLE_TIMER 139*4882a593Smuzhiyun bool "Timer sample" 140*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 141*4882a593Smuzhiyun 142*4882a593Smuzhiyunconfig SAMPLE_UHID 143*4882a593Smuzhiyun bool "UHID sample" 144*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 145*4882a593Smuzhiyun help 146*4882a593Smuzhiyun Build UHID sample program. 147*4882a593Smuzhiyun 148*4882a593Smuzhiyunconfig SAMPLE_VFIO_MDEV_MTTY 149*4882a593Smuzhiyun tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" 150*4882a593Smuzhiyun depends on VFIO_MDEV_DEVICE && m 151*4882a593Smuzhiyun help 152*4882a593Smuzhiyun Build a virtual tty sample driver for use as a VFIO 153*4882a593Smuzhiyun mediated device 154*4882a593Smuzhiyun 155*4882a593Smuzhiyunconfig SAMPLE_VFIO_MDEV_MDPY 156*4882a593Smuzhiyun tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 157*4882a593Smuzhiyun depends on VFIO_MDEV_DEVICE && m 158*4882a593Smuzhiyun help 159*4882a593Smuzhiyun Build a virtual display sample driver for use as a VFIO 160*4882a593Smuzhiyun mediated device. It is a simple framebuffer and supports 161*4882a593Smuzhiyun the region display interface (VFIO_GFX_PLANE_TYPE_REGION). 162*4882a593Smuzhiyun 163*4882a593Smuzhiyunconfig SAMPLE_VFIO_MDEV_MDPY_FB 164*4882a593Smuzhiyun tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" 165*4882a593Smuzhiyun depends on FB && m 166*4882a593Smuzhiyun select FB_CFB_FILLRECT 167*4882a593Smuzhiyun select FB_CFB_COPYAREA 168*4882a593Smuzhiyun select FB_CFB_IMAGEBLIT 169*4882a593Smuzhiyun help 170*4882a593Smuzhiyun Guest fbdev driver for the virtual display sample driver. 171*4882a593Smuzhiyun 172*4882a593Smuzhiyunconfig SAMPLE_VFIO_MDEV_MBOCHS 173*4882a593Smuzhiyun tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" 174*4882a593Smuzhiyun depends on VFIO_MDEV_DEVICE && m 175*4882a593Smuzhiyun select DMA_SHARED_BUFFER 176*4882a593Smuzhiyun help 177*4882a593Smuzhiyun Build a virtual display sample driver for use as a VFIO 178*4882a593Smuzhiyun mediated device. It supports the region display interface 179*4882a593Smuzhiyun (VFIO_GFX_PLANE_TYPE_DMABUF). 180*4882a593Smuzhiyun Emulate enough of qemu stdvga to make bochs-drm.ko happy. 181*4882a593Smuzhiyun That is basically the vram memory bar and the bochs dispi 182*4882a593Smuzhiyun interface vbe registers in the mmio register bar. 183*4882a593Smuzhiyun Specifically it does *not* include any legacy vga stuff. 184*4882a593Smuzhiyun Device looks a lot like "qemu -device secondary-vga". 185*4882a593Smuzhiyun 186*4882a593Smuzhiyunconfig SAMPLE_ANDROID_BINDERFS 187*4882a593Smuzhiyun bool "Build Android binderfs example" 188*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 189*4882a593Smuzhiyun help 190*4882a593Smuzhiyun Builds a sample program to illustrate the use of the Android binderfs 191*4882a593Smuzhiyun filesystem. 192*4882a593Smuzhiyun 193*4882a593Smuzhiyunconfig SAMPLE_VFS 194*4882a593Smuzhiyun bool "Build example programs that use new VFS system calls" 195*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 196*4882a593Smuzhiyun help 197*4882a593Smuzhiyun Build example userspace programs that use new VFS system calls such 198*4882a593Smuzhiyun as mount API and statx(). Note that this is restricted to the x86 199*4882a593Smuzhiyun arch whilst it accesses system calls that aren't yet in all arches. 200*4882a593Smuzhiyun 201*4882a593Smuzhiyunconfig SAMPLE_INTEL_MEI 202*4882a593Smuzhiyun bool "Build example program working with intel mei driver" 203*4882a593Smuzhiyun depends on INTEL_MEI 204*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 205*4882a593Smuzhiyun help 206*4882a593Smuzhiyun Build a sample program to work with mei device. 207*4882a593Smuzhiyun 208*4882a593Smuzhiyunconfig SAMPLE_WATCHDOG 209*4882a593Smuzhiyun bool "watchdog sample" 210*4882a593Smuzhiyun depends on CC_CAN_LINK 211*4882a593Smuzhiyun 212*4882a593Smuzhiyunconfig SAMPLE_WATCH_QUEUE 213*4882a593Smuzhiyun bool "Build example watch_queue notification API consumer" 214*4882a593Smuzhiyun depends on CC_CAN_LINK && HEADERS_INSTALL 215*4882a593Smuzhiyun help 216*4882a593Smuzhiyun Build example userspace program to use the new mount_notify(), 217*4882a593Smuzhiyun sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function. 218*4882a593Smuzhiyun 219*4882a593Smuzhiyunendif # SAMPLES 220