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