CONFIG_SAMPLES Sample kernel code
You can build and test sample kernel code here.
If SAMPLES
CONFIG_SAMPLE_AUXDISPLAY auxdisplay sample
- Depends on
SAMPLES && CC_CAN_LINK
CONFIG_SAMPLE_TRACE_EVENTS Build trace_events examples -- loadable modules only
- Off
- Module
- Built in
This builds the trace event example module.
- Depends on
SAMPLES && EVENT_TRACING && m &&
CONFIG_SAMPLE_TRACE_CUSTOM_EVENTS Build custom trace event example -- loadable modules only
- Off
- Module
- Built in
This builds the custom trace event example module.
- Depends on
SAMPLES && EVENT_TRACING && m &&
CONFIG_SAMPLE_TRACE_PRINTK Build trace_printk module - tests various trace_printk formats
- Off
- Module
- Built in
This builds a module that calls trace_printk() and can be used to test various trace_printk() calls from a module.
- Depends on
SAMPLES && EVENT_TRACING && m &&
CONFIG_SAMPLE_FTRACE_DIRECT Build register_ftrace_direct() example
- Off
- Module
- Built in
This builds an ftrace direct function example that hooks to wake_up_process and prints the parameters.
- Depends on
SAMPLES && DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m && && HAVE_SAMPLE_FTRACE_DIRECT
CONFIG_SAMPLE_FTRACE_DIRECT_MULTI Build register_ftrace_direct() on multiple ips example
- Off
- Module
- Built in
This builds an ftrace direct function example that hooks to wake_up_process and schedule, and prints the function addresses.
- Depends on
SAMPLES && DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m && && HAVE_SAMPLE_FTRACE_DIRECT_MULTI
CONFIG_SAMPLE_FTRACE_OPS Build custom ftrace ops example
- Off
- Module
- Built in
This builds an ftrace ops example that hooks two functions and measures the time taken to invoke one function a number of times.
- Depends on
SAMPLES && FUNCTION_TRACER
CONFIG_SAMPLE_TRACE_ARRAY Build sample module for kernel access to Ftrace instances
- Off
- Module
- Built in
This builds a module that demonstrates the use of various APIs to access Ftrace instances from within the kernel.
- Depends on
SAMPLES && EVENT_TRACING && m &&
CONFIG_SAMPLE_KOBJECT Build kobject examples
- Off
- Module
- Built in
This config option will allow you to build a number of different kobject sample modules showing how to use kobjects, ksets, and ktypes properly.
If in doubt, say "N" here.
CONFIG_SAMPLE_KPROBES Build kprobes examples -- loadable modules only
- Off
- Module
- Built in
This build several kprobes example modules.
- Depends on
SAMPLES && KPROBES && EVENT_TRACING && m &&
If SAMPLE_KPROBES
CONFIG_SAMPLE_KRETPROBES Build kretprobes example -- loadable modules only
- Off
- Module
- Built in
- Depends on
SAMPLES && SAMPLE_KPROBES && KRETPROBES
CONFIG_SAMPLE_HW_BREAKPOINT Build kernel hardware breakpoint examples -- loadable module only
- Off
- Module
- Built in
This builds kernel hardware breakpoint example modules.
- Depends on
SAMPLES && HAVE_HW_BREAKPOINT && m &&
CONFIG_SAMPLE_FPROBE Build fprobe examples -- loadable modules only
- Off
- Module
- Built in
This builds a fprobe example module. This module has an option 'symbol'. You can specify a probed symbol or symbols separated with ','.
- Depends on
SAMPLES && FPROBE && EVENT_TRACING && m &&
CONFIG_SAMPLE_KFIFO Build kfifo examples -- loadable modules only
- Off
- Module
- Built in
This config option will allow you to build a number of different kfifo sample modules showing how to use the generic kfifo API.
If in doubt, say "N" here.
- Depends on
SAMPLES && m &&
CONFIG_SAMPLE_KDB Build kdb command example -- loadable modules only
- Off
- Module
- Built in
Build an example of how to dynamically add the hello command to the kdb shell.
CONFIG_SAMPLE_QMI_CLIENT Build qmi client sample -- loadable modules only
- Off
- Module
- Built in
Build an QMI client sample driver, which demonstrates how to communicate with a remote QRTR service, using QMI encoded messages.
- Depends on
SAMPLES && m && && && NET - Selects
QCOM_QMI_HELPERS if SAMPLES && m && && && NET
CONFIG_SAMPLE_RPMSG_CLIENT Build rpmsg client sample -- loadable modules only
- Off
- Module
- Built in
Build an rpmsg client sample driver, which demonstrates how to communicate with an AMP-configured remote processor over the rpmsg bus.
CONFIG_SAMPLE_LIVEPATCH Build live patching samples -- loadable modules only
- Off
- Module
- Built in
Build sample live patch demonstrations.
CONFIG_SAMPLE_CONFIGFS Build configfs patching sample -- loadable modules only
- Off
- Module
- Built in
Builds a sample configfs interface.
- Depends on
SAMPLES && CONFIGFS_FS && m &&
CONFIG_SAMPLE_CONNECTOR Build connector sample -- loadable modules only
- Off
- Module
- Built in
When enabled, this builds both a sample kernel module for the connector interface and a user space tool to communicate with it. See also Documentation/driver-api/connector.rst
- Depends on
SAMPLES && CONNECTOR && HEADERS_INSTALL && m &&
CONFIG_SAMPLE_FANOTIFY_ERROR Build fanotify error monitoring sample
When enabled, this builds an example code that uses the FAN_FS_ERROR fanotify mechanism to monitor filesystem errors. See also Documentation/admin-guide/filesystem-monitoring.rst.
- Depends on
SAMPLES && FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_HIDRAW hidraw sample
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_LANDLOCK Landlock example
Build a Landlock sandbox manager able to start a process restricted by user-defined filesystem, network, scope, namespace, and capability policies.
The optional libcap development headers and library enable capability names. Without them, the sample still builds, accepts capability numbers, and warns when capability settings are used.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
If SAMPLE_LANDLOCK
CONFIG_SAMPLE_LANDLOCK_LIBCAP
- Depends on
SAMPLES && SAMPLE_LANDLOCK
CONFIG_SAMPLE_PIDFD pidfd sample
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_SECCOMP Build seccomp sample code
Build samples of seccomp filters using various methods of BPF filter construction.
- Depends on
SAMPLES && SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_TIMER Timer sample
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_TSM_MR TSM measurement sample
- Off
- Module
- Built in
Build a sample module that emulates MRs (Measurement Registers) and exposes them to user mode applications through the TSM sysfs interface (/sys/class/misc/tsm_mr_sample/emulated_mr/).
The module name will be tsm-mr-sample when built as a module.
- Selects
CRYPTO_LIB_SHA256 if SAMPLES - Selects
CRYPTO_LIB_SHA512 if SAMPLES - Selects
TSM_MEASUREMENTS if SAMPLES - Selects
VIRT_DRIVERS if SAMPLES
CONFIG_SAMPLE_UHID UHID sample
Build UHID sample program.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_VFIO_MDEV_MTTY Build VFIO mtty example mediated device sample code
- Off
- Module
- Built in
Build a virtual tty sample driver for use as a VFIO mediated device
CONFIG_SAMPLE_VFIO_MDEV_MDPY Build VFIO mdpy example mediated device sample code
- Off
- Module
- Built in
Build a virtual display sample driver for use as a VFIO mediated device. It is a simple framebuffer and supports the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
CONFIG_SAMPLE_VFIO_MDEV_MDPY_FB Build VFIO mdpy example guest fbdev driver
- Off
- Module
- Built in
Guest fbdev driver for the virtual display sample driver.
- Depends on
SAMPLES && FB - Selects
FB_IOMEM_HELPERS if SAMPLES && FB
CONFIG_SAMPLE_VFIO_MDEV_MBOCHS Build VFIO mbochs example mediated device sample code
- Off
- Module
- Built in
Build a virtual display sample driver for use as a VFIO mediated device. It supports the region display interface (VFIO_GFX_PLANE_TYPE_DMABUF). Emulate enough of qemu stdvga to make bochs-drm.ko happy. That is basically the vram memory bar and the bochs dispi interface vbe registers in the mmio register bar. Specifically it does *not* include any legacy vga stuff. Device looks a lot like "qemu -device secondary-vga".
CONFIG_SAMPLE_ANDROID_BINDERFS Build Android binderfs example
Builds a sample program to illustrate the use of the Android binderfs filesystem.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_VFS Build example programs that use new VFS system calls
Build example userspace programs that use new VFS system calls such as mount API and statx(). Note that this is restricted to the x86 arch whilst it accesses system calls that aren't yet in all arches.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_INTEL_MEI Build example program working with intel mei driver
Build a sample program to work with mei device.
- Depends on
SAMPLES && INTEL_MEI && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_TPS6594_PFSM Build example program working with TPS6594 PFSM driver
Build a sample program to work with PFSM devices.
- Depends on
SAMPLES && HEADERS_INSTALL && CC_CAN_LINK
CONFIG_SAMPLE_WATCHDOG watchdog sample
- Depends on
SAMPLES && CC_CAN_LINK
CONFIG_SAMPLE_WATCH_QUEUE Build example watch_queue notification API consumer
Build example userspace program to use the new mount_notify(), sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_CORESIGHT_SYSCFG Build example loadable module for CoreSight config
- Off
- Module
- Built in
Build an example loadable module that adds new CoreSight features and configuration using the CoreSight system configuration API. This demonstrates how a user may create their own CoreSight configurations and easily load them into the system at runtime.
CONFIG_SAMPLE_KMEMLEAK Simple test for the kernel memory leak detector
- Off
- Module
- Built in
Build a sample program which have explicitly leaks memory to test kmemleak.
- Depends on
SAMPLES && DEBUG_KMEMLEAK && m &&
CONFIG_SAMPLE_CGROUP Build cgroup sample code
Build samples that demonstrate the usage of the cgroup API.
- Depends on
SAMPLES && CGROUPS && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_CHECK_EXEC Exec secure bits examples
Build a tool to easily configure SECBIT_EXEC_RESTRICT_FILE and SECBIT_EXEC_DENY_INTERACTIVE, and a simple script interpreter to demonstrate how they should be used with execveat(2) + AT_EXECVE_CHECK.
- Depends on
SAMPLES && CC_CAN_LINK && HEADERS_INSTALL
CONFIG_SAMPLE_HUNG_TASK Hung task detector test code
- Off
- Module
- Built in
Build a module that provides debugfs files (e.g., mutex, semaphore, rw_semaphore_read, rw_semaphore_write) under <debugfs>/hung_task. Reading these files with multiple processes triggers hung task detection by holding locks for a long time (256 seconds).
- Depends on
SAMPLES && DETECT_HUNG_TASK && DEBUG_FS