Thomas Gleixner | ec8f24b | 2019-05-19 13:07:45 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Mathieu Desnoyers | 267c402 | 2007-10-18 23:41:07 -0700 | [diff] [blame] | 2 | menuconfig SAMPLES |
| 3 | bool "Sample kernel code" |
| 4 | help |
| 5 | You can build and test sample kernel code here. |
| 6 | |
| 7 | if SAMPLES |
| 8 | |
Steven Rostedt | 9cfe06f | 2009-04-14 21:37:03 -0400 | [diff] [blame] | 9 | config SAMPLE_TRACE_EVENTS |
Li Zefan | 96d1798 | 2009-05-06 10:32:32 +0800 | [diff] [blame] | 10 | tristate "Build trace_events examples -- loadable modules only" |
| 11 | depends on EVENT_TRACING && m |
Steven Rostedt | 9cfe06f | 2009-04-14 21:37:03 -0400 | [diff] [blame] | 12 | help |
| 13 | This build trace event example modules. |
| 14 | |
Steven Rostedt (Red Hat) | aad108a | 2016-06-17 14:50:23 -0400 | [diff] [blame] | 15 | config SAMPLE_TRACE_PRINTK |
| 16 | tristate "Build trace_printk module - tests various trace_printk formats" |
| 17 | depends on EVENT_TRACING && m |
| 18 | help |
| 19 | This builds a module that calls trace_printk() and can be used to |
| 20 | test various trace_printk() calls from a module. |
| 21 | |
Steven Rostedt (VMware) | b06457c | 2019-11-08 13:12:33 -0500 | [diff] [blame] | 22 | config SAMPLE_FTRACE_DIRECT |
| 23 | tristate "Build register_ftrace_direct() example" |
| 24 | depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m |
| 25 | depends on X86_64 # has x86_64 inlined asm |
| 26 | help |
| 27 | This builds an ftrace direct function example |
| 28 | that hooks to wake_up_process and prints the parameters. |
| 29 | |
Divya Indi | 89ed424 | 2019-11-20 11:08:39 -0800 | [diff] [blame] | 30 | config SAMPLE_TRACE_ARRAY |
| 31 | tristate "Build sample module for kernel access to Ftrace instancess" |
| 32 | depends on EVENT_TRACING && m |
| 33 | help |
| 34 | This builds a module that demonstrates the use of various APIs to |
| 35 | access Ftrace instances from within the kernel. |
| 36 | |
Greg Kroah-Hartman | 40efcb0 | 2007-11-27 11:28:26 -0800 | [diff] [blame] | 37 | config SAMPLE_KOBJECT |
Masahiro Yamada | e7e3491 | 2019-04-27 12:33:40 +0900 | [diff] [blame] | 38 | tristate "Build kobject examples" |
Greg Kroah-Hartman | 40efcb0 | 2007-11-27 11:28:26 -0800 | [diff] [blame] | 39 | help |
| 40 | This config option will allow you to build a number of |
| 41 | different kobject sample modules showing how to use kobjects, |
| 42 | ksets, and ktypes properly. |
| 43 | |
| 44 | If in doubt, say "N" here. |
| 45 | |
Ananth N Mavinakayanahalli | 804defe | 2008-03-04 14:28:38 -0800 | [diff] [blame] | 46 | config SAMPLE_KPROBES |
| 47 | tristate "Build kprobes examples -- loadable modules only" |
| 48 | depends on KPROBES && m |
| 49 | help |
| 50 | This build several kprobes example modules. |
| 51 | |
| 52 | config SAMPLE_KRETPROBES |
| 53 | tristate "Build kretprobes example -- loadable modules only" |
| 54 | default m |
| 55 | depends on SAMPLE_KPROBES && KRETPROBES |
| 56 | |
K.Prasad | 4320399 | 2009-06-01 23:46:20 +0530 | [diff] [blame] | 57 | config SAMPLE_HW_BREAKPOINT |
| 58 | tristate "Build kernel hardware breakpoint examples -- loadable module only" |
| 59 | depends on HAVE_HW_BREAKPOINT && m |
| 60 | help |
| 61 | This builds kernel hardware breakpoint example modules. |
| 62 | |
Stefani Seibold | 5bf2b19 | 2010-08-10 18:03:39 -0700 | [diff] [blame] | 63 | config SAMPLE_KFIFO |
| 64 | tristate "Build kfifo examples -- loadable modules only" |
| 65 | depends on m |
| 66 | help |
| 67 | This config option will allow you to build a number of |
| 68 | different kfifo sample modules showing how to use the |
| 69 | generic kfifo API. |
| 70 | |
| 71 | If in doubt, say "N" here. |
| 72 | |
Jason Wessel | 4aad8f5 | 2010-10-25 10:14:05 -0500 | [diff] [blame] | 73 | config SAMPLE_KDB |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 74 | tristate "Build kdb command example -- loadable modules only" |
Jason Wessel | 4aad8f5 | 2010-10-25 10:14:05 -0500 | [diff] [blame] | 75 | depends on KGDB_KDB && m |
| 76 | help |
| 77 | Build an example of how to dynamically add the hello |
| 78 | command to the kdb shell. |
| 79 | |
Bjorn Andersson | 842891b | 2017-06-26 09:02:28 -0700 | [diff] [blame] | 80 | config SAMPLE_QMI_CLIENT |
| 81 | tristate "Build qmi client sample -- loadable modules only" |
| 82 | depends on m |
| 83 | depends on ARCH_QCOM |
Arnd Bergmann | dea4bd1 | 2018-02-22 16:57:38 +0100 | [diff] [blame] | 84 | depends on NET |
Bjorn Andersson | 842891b | 2017-06-26 09:02:28 -0700 | [diff] [blame] | 85 | select QCOM_QMI_HELPERS |
| 86 | help |
| 87 | Build an QMI client sample driver, which demonstrates how to |
| 88 | communicate with a remote QRTR service, using QMI encoded messages. |
| 89 | |
Ohad Ben-Cohen | 779b96d | 2011-10-20 21:41:24 +0200 | [diff] [blame] | 90 | config SAMPLE_RPMSG_CLIENT |
| 91 | tristate "Build rpmsg client sample -- loadable modules only" |
| 92 | depends on RPMSG && m |
| 93 | help |
| 94 | Build an rpmsg client sample driver, which demonstrates how |
| 95 | to communicate with an AMP-configured remote processor over |
| 96 | the rpmsg bus. |
| 97 | |
Josh Poimboeuf | 12cf89b | 2015-02-03 16:45:18 -0600 | [diff] [blame] | 98 | config SAMPLE_LIVEPATCH |
Joe Lawrence | 439e727 | 2017-08-31 16:37:41 -0400 | [diff] [blame] | 99 | tristate "Build live patching samples -- loadable modules only" |
Josh Poimboeuf | 12cf89b | 2015-02-03 16:45:18 -0600 | [diff] [blame] | 100 | depends on LIVEPATCH && m |
Seth Jennings | 13d1cf7 | 2014-12-16 11:58:20 -0600 | [diff] [blame] | 101 | help |
Joe Lawrence | 439e727 | 2017-08-31 16:37:41 -0400 | [diff] [blame] | 102 | Build sample live patch demonstrations. |
Seth Jennings | 13d1cf7 | 2014-12-16 11:58:20 -0600 | [diff] [blame] | 103 | |
Christoph Hellwig | 5179822 | 2015-10-03 15:32:59 +0200 | [diff] [blame] | 104 | config SAMPLE_CONFIGFS |
| 105 | tristate "Build configfs patching sample -- loadable modules only" |
| 106 | depends on CONFIGFS_FS && m |
| 107 | help |
| 108 | Builds a sample configfs interface. |
| 109 | |
Arnd Bergmann | 14fbff6 | 2016-04-25 18:03:08 +0200 | [diff] [blame] | 110 | config SAMPLE_CONNECTOR |
| 111 | tristate "Build connector sample -- loadable modules only" |
Masahiro Yamada | e949f4c | 2019-06-04 19:13:59 +0900 | [diff] [blame] | 112 | depends on CONNECTOR && HEADERS_INSTALL && m |
Arnd Bergmann | 14fbff6 | 2016-04-25 18:03:08 +0200 | [diff] [blame] | 113 | help |
| 114 | When enabled, this builds both a sample kernel module for |
| 115 | the connector interface and a user space tool to communicate |
| 116 | with it. |
Mauro Carvalho Chehab | baa293e | 2019-06-27 15:39:22 -0300 | [diff] [blame] | 117 | See also Documentation/driver-api/connector.rst |
Arnd Bergmann | 14fbff6 | 2016-04-25 18:03:08 +0200 | [diff] [blame] | 118 | |
Masahiro Yamada | e949f4c | 2019-06-04 19:13:59 +0900 | [diff] [blame] | 119 | config SAMPLE_HIDRAW |
| 120 | bool "hidraw sample" |
| 121 | depends on HEADERS_INSTALL |
| 122 | |
| 123 | config SAMPLE_PIDFD |
| 124 | bool "pidfd sample" |
| 125 | depends on HEADERS_INSTALL |
| 126 | |
Olof Johansson | f6041c1 | 2016-07-05 23:53:19 -0700 | [diff] [blame] | 127 | config SAMPLE_SECCOMP |
Masahiro Yamada | 7206c12 | 2019-04-27 12:33:39 +0900 | [diff] [blame] | 128 | bool "Build seccomp sample code" |
Masahiro Yamada | f59e766 | 2020-04-29 12:45:16 +0900 | [diff] [blame] | 129 | depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL |
Olof Johansson | f6041c1 | 2016-07-05 23:53:19 -0700 | [diff] [blame] | 130 | help |
| 131 | Build samples of seccomp filters using various methods of |
| 132 | BPF filter construction. |
| 133 | |
Masahiro Yamada | 87ecdf4 | 2020-04-29 12:45:19 +0900 | [diff] [blame^] | 134 | config SAMPLE_UHID |
| 135 | bool "UHID sample" |
| 136 | depends on CC_CAN_LINK && HEADERS_INSTALL |
| 137 | help |
| 138 | Build UHID sample program. |
| 139 | |
Alex Williamson | 08c1a4e | 2016-12-30 08:13:30 -0700 | [diff] [blame] | 140 | config SAMPLE_VFIO_MDEV_MTTY |
| 141 | tristate "Build VFIO mtty example mediated device sample code -- loadable modules only" |
| 142 | depends on VFIO_MDEV_DEVICE && m |
| 143 | help |
| 144 | Build a virtual tty sample driver for use as a VFIO |
| 145 | mediated device |
| 146 | |
Gerd Hoffmann | d61fc96f | 2018-05-11 09:05:03 -0600 | [diff] [blame] | 147 | config SAMPLE_VFIO_MDEV_MDPY |
| 148 | tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" |
| 149 | depends on VFIO_MDEV_DEVICE && m |
| 150 | help |
| 151 | Build a virtual display sample driver for use as a VFIO |
| 152 | mediated device. It is a simple framebuffer and supports |
| 153 | the region display interface (VFIO_GFX_PLANE_TYPE_REGION). |
| 154 | |
Gerd Hoffmann | cacade1 | 2018-05-11 09:05:04 -0600 | [diff] [blame] | 155 | config SAMPLE_VFIO_MDEV_MDPY_FB |
| 156 | tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only" |
| 157 | depends on FB && m |
| 158 | select FB_CFB_FILLRECT |
| 159 | select FB_CFB_COPYAREA |
| 160 | select FB_CFB_IMAGEBLIT |
| 161 | help |
| 162 | Guest fbdev driver for the virtual display sample driver. |
| 163 | |
Gerd Hoffmann | a5e6e65 | 2018-05-11 09:05:04 -0600 | [diff] [blame] | 164 | config SAMPLE_VFIO_MDEV_MBOCHS |
| 165 | tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only" |
| 166 | depends on VFIO_MDEV_DEVICE && m |
Arnd Bergmann | c1abca9 | 2018-05-30 23:37:31 +0200 | [diff] [blame] | 167 | select DMA_SHARED_BUFFER |
Gerd Hoffmann | a5e6e65 | 2018-05-11 09:05:04 -0600 | [diff] [blame] | 168 | help |
| 169 | Build a virtual display sample driver for use as a VFIO |
| 170 | mediated device. It supports the region display interface |
| 171 | (VFIO_GFX_PLANE_TYPE_DMABUF). |
| 172 | Emulate enough of qemu stdvga to make bochs-drm.ko happy. |
| 173 | That is basically the vram memory bar and the bochs dispi |
| 174 | interface vbe registers in the mmio register bar. |
| 175 | Specifically it does *not* include any legacy vga stuff. |
| 176 | Device looks a lot like "qemu -device secondary-vga". |
| 177 | |
Christian Brauner | 9762dc1 | 2019-01-11 14:41:00 +0100 | [diff] [blame] | 178 | config SAMPLE_ANDROID_BINDERFS |
| 179 | bool "Build Android binderfs example" |
| 180 | depends on CONFIG_ANDROID_BINDERFS |
| 181 | help |
| 182 | Builds a sample program to illustrate the use of the Android binderfs |
| 183 | filesystem. |
| 184 | |
David Howells | f1b5618 | 2018-11-01 23:36:32 +0000 | [diff] [blame] | 185 | config SAMPLE_VFS |
| 186 | bool "Build example programs that use new VFS system calls" |
Masahiro Yamada | e949f4c | 2019-06-04 19:13:59 +0900 | [diff] [blame] | 187 | depends on HEADERS_INSTALL |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 188 | help |
David Howells | f1b5618 | 2018-11-01 23:36:32 +0000 | [diff] [blame] | 189 | Build example userspace programs that use new VFS system calls such |
| 190 | as mount API and statx(). Note that this is restricted to the x86 |
| 191 | arch whilst it accesses system calls that aren't yet in all arches. |
David Howells | a528d35 | 2017-01-31 16:46:22 +0000 | [diff] [blame] | 192 | |
Tomas Winkler | 6859eba | 2019-10-10 16:27:10 +0300 | [diff] [blame] | 193 | config SAMPLE_INTEL_MEI |
| 194 | bool "Build example program working with intel mei driver" |
| 195 | depends on INTEL_MEI |
| 196 | help |
| 197 | Build a sample program to work with mei device. |
| 198 | |
| 199 | |
Mathieu Desnoyers | 267c402 | 2007-10-18 23:41:07 -0700 | [diff] [blame] | 200 | endif # SAMPLES |