0001 # SPDX-License-Identifier: GPL-2.0-only
0002 menuconfig SAMPLES
0003 bool "Sample kernel code"
0004 help
0005 You can build and test sample kernel code here.
0006
0007 if SAMPLES
0008
0009 config SAMPLE_AUXDISPLAY
0010 bool "auxdisplay sample"
0011 depends on CC_CAN_LINK
0012
0013 config SAMPLE_TRACE_EVENTS
0014 tristate "Build trace_events examples -- loadable modules only"
0015 depends on EVENT_TRACING && m
0016 help
0017 This builds the trace event example module.
0018
0019 config SAMPLE_TRACE_CUSTOM_EVENTS
0020 tristate "Build custom trace event example -- loadable modules only"
0021 depends on EVENT_TRACING && m
0022 help
0023 This builds the custom trace event example module.
0024
0025 config SAMPLE_TRACE_PRINTK
0026 tristate "Build trace_printk module - tests various trace_printk formats"
0027 depends on EVENT_TRACING && m
0028 help
0029 This builds a module that calls trace_printk() and can be used to
0030 test various trace_printk() calls from a module.
0031
0032 config SAMPLE_FTRACE_DIRECT
0033 tristate "Build register_ftrace_direct() example"
0034 depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
0035 depends on HAVE_SAMPLE_FTRACE_DIRECT
0036 help
0037 This builds an ftrace direct function example
0038 that hooks to wake_up_process and prints the parameters.
0039
0040 config SAMPLE_FTRACE_DIRECT_MULTI
0041 tristate "Build register_ftrace_direct_multi() example"
0042 depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
0043 depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI
0044 help
0045 This builds an ftrace direct function example
0046 that hooks to wake_up_process and schedule, and prints
0047 the function addresses.
0048
0049 config SAMPLE_TRACE_ARRAY
0050 tristate "Build sample module for kernel access to Ftrace instancess"
0051 depends on EVENT_TRACING && m
0052 help
0053 This builds a module that demonstrates the use of various APIs to
0054 access Ftrace instances from within the kernel.
0055
0056 config SAMPLE_KOBJECT
0057 tristate "Build kobject examples"
0058 help
0059 This config option will allow you to build a number of
0060 different kobject sample modules showing how to use kobjects,
0061 ksets, and ktypes properly.
0062
0063 If in doubt, say "N" here.
0064
0065 config SAMPLE_KPROBES
0066 tristate "Build kprobes examples -- loadable modules only"
0067 depends on KPROBES && m
0068 help
0069 This build several kprobes example modules.
0070
0071 config SAMPLE_KRETPROBES
0072 tristate "Build kretprobes example -- loadable modules only"
0073 default m
0074 depends on SAMPLE_KPROBES && KRETPROBES
0075
0076 config SAMPLE_HW_BREAKPOINT
0077 tristate "Build kernel hardware breakpoint examples -- loadable module only"
0078 depends on HAVE_HW_BREAKPOINT && m
0079 help
0080 This builds kernel hardware breakpoint example modules.
0081
0082 config SAMPLE_FPROBE
0083 tristate "Build fprobe examples -- loadable modules only"
0084 depends on FPROBE && m
0085 help
0086 This builds a fprobe example module. This module has an option 'symbol'.
0087 You can specify a probed symbol or symbols separated with ','.
0088
0089 config SAMPLE_KFIFO
0090 tristate "Build kfifo examples -- loadable modules only"
0091 depends on m
0092 help
0093 This config option will allow you to build a number of
0094 different kfifo sample modules showing how to use the
0095 generic kfifo API.
0096
0097 If in doubt, say "N" here.
0098
0099 config SAMPLE_KDB
0100 tristate "Build kdb command example -- loadable modules only"
0101 depends on KGDB_KDB && m
0102 help
0103 Build an example of how to dynamically add the hello
0104 command to the kdb shell.
0105
0106 config SAMPLE_QMI_CLIENT
0107 tristate "Build qmi client sample -- loadable modules only"
0108 depends on m
0109 depends on ARCH_QCOM
0110 depends on NET
0111 select QCOM_QMI_HELPERS
0112 help
0113 Build an QMI client sample driver, which demonstrates how to
0114 communicate with a remote QRTR service, using QMI encoded messages.
0115
0116 config SAMPLE_RPMSG_CLIENT
0117 tristate "Build rpmsg client sample -- loadable modules only"
0118 depends on RPMSG && m
0119 help
0120 Build an rpmsg client sample driver, which demonstrates how
0121 to communicate with an AMP-configured remote processor over
0122 the rpmsg bus.
0123
0124 config SAMPLE_LIVEPATCH
0125 tristate "Build live patching samples -- loadable modules only"
0126 depends on LIVEPATCH && m
0127 help
0128 Build sample live patch demonstrations.
0129
0130 config SAMPLE_CONFIGFS
0131 tristate "Build configfs patching sample -- loadable modules only"
0132 depends on CONFIGFS_FS && m
0133 help
0134 Builds a sample configfs interface.
0135
0136 config SAMPLE_CONNECTOR
0137 tristate "Build connector sample -- loadable modules only"
0138 depends on CONNECTOR && HEADERS_INSTALL && m
0139 help
0140 When enabled, this builds both a sample kernel module for
0141 the connector interface and a user space tool to communicate
0142 with it.
0143 See also Documentation/driver-api/connector.rst
0144
0145 config SAMPLE_FANOTIFY_ERROR
0146 bool "Build fanotify error monitoring sample"
0147 depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
0148 help
0149 When enabled, this builds an example code that uses the
0150 FAN_FS_ERROR fanotify mechanism to monitor filesystem
0151 errors.
0152 See also Documentation/admin-guide/filesystem-monitoring.rst.
0153
0154 config SAMPLE_HIDRAW
0155 bool "hidraw sample"
0156 depends on CC_CAN_LINK && HEADERS_INSTALL
0157
0158 config SAMPLE_LANDLOCK
0159 bool "Landlock example"
0160 depends on CC_CAN_LINK && HEADERS_INSTALL
0161 help
0162 Build a simple Landlock sandbox manager able to start a process
0163 restricted by a user-defined filesystem access control policy.
0164
0165 config SAMPLE_PIDFD
0166 bool "pidfd sample"
0167 depends on CC_CAN_LINK && HEADERS_INSTALL
0168
0169 config SAMPLE_SECCOMP
0170 bool "Build seccomp sample code"
0171 depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL
0172 help
0173 Build samples of seccomp filters using various methods of
0174 BPF filter construction.
0175
0176 config SAMPLE_TIMER
0177 bool "Timer sample"
0178 depends on CC_CAN_LINK && HEADERS_INSTALL
0179
0180 config SAMPLE_UHID
0181 bool "UHID sample"
0182 depends on CC_CAN_LINK && HEADERS_INSTALL
0183 help
0184 Build UHID sample program.
0185
0186 config SAMPLE_VFIO_MDEV_MTTY
0187 tristate "Build VFIO mtty example mediated device sample code -- loadable modules only"
0188 depends on VFIO_MDEV && m
0189 help
0190 Build a virtual tty sample driver for use as a VFIO
0191 mediated device
0192
0193 config SAMPLE_VFIO_MDEV_MDPY
0194 tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only"
0195 depends on VFIO_MDEV && m
0196 help
0197 Build a virtual display sample driver for use as a VFIO
0198 mediated device. It is a simple framebuffer and supports
0199 the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
0200
0201 config SAMPLE_VFIO_MDEV_MDPY_FB
0202 tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only"
0203 depends on FB && m
0204 select FB_CFB_FILLRECT
0205 select FB_CFB_COPYAREA
0206 select FB_CFB_IMAGEBLIT
0207 help
0208 Guest fbdev driver for the virtual display sample driver.
0209
0210 config SAMPLE_VFIO_MDEV_MBOCHS
0211 tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only"
0212 depends on VFIO_MDEV && m
0213 select DMA_SHARED_BUFFER
0214 help
0215 Build a virtual display sample driver for use as a VFIO
0216 mediated device. It supports the region display interface
0217 (VFIO_GFX_PLANE_TYPE_DMABUF).
0218 Emulate enough of qemu stdvga to make bochs-drm.ko happy.
0219 That is basically the vram memory bar and the bochs dispi
0220 interface vbe registers in the mmio register bar.
0221 Specifically it does *not* include any legacy vga stuff.
0222 Device looks a lot like "qemu -device secondary-vga".
0223
0224 config SAMPLE_ANDROID_BINDERFS
0225 bool "Build Android binderfs example"
0226 depends on CC_CAN_LINK && HEADERS_INSTALL
0227 help
0228 Builds a sample program to illustrate the use of the Android binderfs
0229 filesystem.
0230
0231 config SAMPLE_VFS
0232 bool "Build example programs that use new VFS system calls"
0233 depends on CC_CAN_LINK && HEADERS_INSTALL
0234 help
0235 Build example userspace programs that use new VFS system calls such
0236 as mount API and statx(). Note that this is restricted to the x86
0237 arch whilst it accesses system calls that aren't yet in all arches.
0238
0239 config SAMPLE_INTEL_MEI
0240 bool "Build example program working with intel mei driver"
0241 depends on INTEL_MEI
0242 depends on CC_CAN_LINK && HEADERS_INSTALL
0243 help
0244 Build a sample program to work with mei device.
0245
0246 config SAMPLE_WATCHDOG
0247 bool "watchdog sample"
0248 depends on CC_CAN_LINK
0249
0250 config SAMPLE_WATCH_QUEUE
0251 bool "Build example watch_queue notification API consumer"
0252 depends on CC_CAN_LINK && HEADERS_INSTALL
0253 help
0254 Build example userspace program to use the new mount_notify(),
0255 sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
0256
0257 config SAMPLE_CORESIGHT_SYSCFG
0258 tristate "Build example loadable module for CoreSight config"
0259 depends on CORESIGHT && m
0260 help
0261 Build an example loadable module that adds new CoreSight features
0262 and configuration using the CoreSight system configuration API.
0263 This demonstrates how a user may create their own CoreSight
0264 configurations and easily load them into the system at runtime.
0265
0266 endif # SAMPLES
0267
0268 config HAVE_SAMPLE_FTRACE_DIRECT
0269 bool
0270
0271 config HAVE_SAMPLE_FTRACE_DIRECT_MULTI
0272 bool