blob: b288d9991d27ae9f064e388fb691ff0d6f0c2ff8 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Mathieu Desnoyers267c4022007-10-18 23:41:07 -07002menuconfig SAMPLES
3 bool "Sample kernel code"
4 help
5 You can build and test sample kernel code here.
6
7if SAMPLES
8
Masahiro Yamada87ffbba2020-04-29 12:45:25 +09009config SAMPLE_AUXDISPLAY
10 bool "auxdisplay sample"
11 depends on CC_CAN_LINK
12
Steven Rostedt9cfe06f2009-04-14 21:37:03 -040013config SAMPLE_TRACE_EVENTS
Li Zefan96d17982009-05-06 10:32:32 +080014 tristate "Build trace_events examples -- loadable modules only"
15 depends on EVENT_TRACING && m
Steven Rostedt9cfe06f2009-04-14 21:37:03 -040016 help
Steven Rostedt (Google)953c2f02022-03-03 17:05:32 -050017 This builds the trace event example module.
18
19config SAMPLE_TRACE_CUSTOM_EVENTS
20 tristate "Build custom trace event example -- loadable modules only"
21 depends on EVENT_TRACING && m
22 help
23 This builds the custom trace event example module.
Steven Rostedt9cfe06f2009-04-14 21:37:03 -040024
Steven Rostedt (Red Hat)aad108a2016-06-17 14:50:23 -040025config SAMPLE_TRACE_PRINTK
26 tristate "Build trace_printk module - tests various trace_printk formats"
27 depends on EVENT_TRACING && m
28 help
29 This builds a module that calls trace_printk() and can be used to
30 test various trace_printk() calls from a module.
31
Steven Rostedt (VMware)b06457c2019-11-08 13:12:33 -050032config SAMPLE_FTRACE_DIRECT
33 tristate "Build register_ftrace_direct() example"
34 depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
Heiko Carstensc316eb42021-10-12 15:38:01 +020035 depends on HAVE_SAMPLE_FTRACE_DIRECT
Steven Rostedt (VMware)b06457c2019-11-08 13:12:33 -050036 help
37 This builds an ftrace direct function example
38 that hooks to wake_up_process and prints the parameters.
39
Heiko Carstens503e4512021-11-15 20:56:13 +010040config SAMPLE_FTRACE_DIRECT_MULTI
Florent Revestda8bdfbd2023-03-21 15:04:21 +010041 tristate "Build register_ftrace_direct() on multiple ips example"
Heiko Carstens503e4512021-11-15 20:56:13 +010042 depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
43 depends on HAVE_SAMPLE_FTRACE_DIRECT_MULTI
44 help
45 This builds an ftrace direct function example
46 that hooks to wake_up_process and schedule, and prints
47 the function addresses.
48
Mark Rutlandb56c68f2023-01-03 12:49:12 +000049config SAMPLE_FTRACE_OPS
50 tristate "Build custom ftrace ops example"
51 depends on FUNCTION_TRACER
52 help
53 This builds an ftrace ops example that hooks two functions and
54 measures the time taken to invoke one function a number of times.
55
Divya Indi89ed4242019-11-20 11:08:39 -080056config SAMPLE_TRACE_ARRAY
57 tristate "Build sample module for kernel access to Ftrace instancess"
58 depends on EVENT_TRACING && m
59 help
60 This builds a module that demonstrates the use of various APIs to
61 access Ftrace instances from within the kernel.
62
Greg Kroah-Hartman40efcb02007-11-27 11:28:26 -080063config SAMPLE_KOBJECT
Masahiro Yamadae7e34912019-04-27 12:33:40 +090064 tristate "Build kobject examples"
Greg Kroah-Hartman40efcb02007-11-27 11:28:26 -080065 help
66 This config option will allow you to build a number of
67 different kobject sample modules showing how to use kobjects,
68 ksets, and ktypes properly.
69
70 If in doubt, say "N" here.
71
Ananth N Mavinakayanahalli804defe2008-03-04 14:28:38 -080072config SAMPLE_KPROBES
73 tristate "Build kprobes examples -- loadable modules only"
74 depends on KPROBES && m
75 help
76 This build several kprobes example modules.
77
78config SAMPLE_KRETPROBES
79 tristate "Build kretprobes example -- loadable modules only"
80 default m
81 depends on SAMPLE_KPROBES && KRETPROBES
82
K.Prasad43203992009-06-01 23:46:20 +053083config SAMPLE_HW_BREAKPOINT
84 tristate "Build kernel hardware breakpoint examples -- loadable module only"
85 depends on HAVE_HW_BREAKPOINT && m
86 help
87 This builds kernel hardware breakpoint example modules.
88
Masami Hiramatsu6ee64cc2022-03-15 23:02:00 +090089config SAMPLE_FPROBE
90 tristate "Build fprobe examples -- loadable modules only"
91 depends on FPROBE && m
92 help
93 This builds a fprobe example module. This module has an option 'symbol'.
94 You can specify a probed symbol or symbols separated with ','.
95
Stefani Seibold5bf2b192010-08-10 18:03:39 -070096config SAMPLE_KFIFO
97 tristate "Build kfifo examples -- loadable modules only"
98 depends on m
99 help
100 This config option will allow you to build a number of
101 different kfifo sample modules showing how to use the
102 generic kfifo API.
103
104 If in doubt, say "N" here.
105
Jason Wessel4aad8f52010-10-25 10:14:05 -0500106config SAMPLE_KDB
Lucas De Marchi25985ed2011-03-30 22:57:33 -0300107 tristate "Build kdb command example -- loadable modules only"
Jason Wessel4aad8f52010-10-25 10:14:05 -0500108 depends on KGDB_KDB && m
109 help
110 Build an example of how to dynamically add the hello
111 command to the kdb shell.
112
Bjorn Andersson842891b2017-06-26 09:02:28 -0700113config SAMPLE_QMI_CLIENT
114 tristate "Build qmi client sample -- loadable modules only"
115 depends on m
116 depends on ARCH_QCOM
Arnd Bergmanndea4bd12018-02-22 16:57:38 +0100117 depends on NET
Bjorn Andersson842891b2017-06-26 09:02:28 -0700118 select QCOM_QMI_HELPERS
119 help
120 Build an QMI client sample driver, which demonstrates how to
121 communicate with a remote QRTR service, using QMI encoded messages.
122
Ohad Ben-Cohen779b96d2011-10-20 21:41:24 +0200123config SAMPLE_RPMSG_CLIENT
124 tristate "Build rpmsg client sample -- loadable modules only"
125 depends on RPMSG && m
126 help
127 Build an rpmsg client sample driver, which demonstrates how
128 to communicate with an AMP-configured remote processor over
129 the rpmsg bus.
130
Josh Poimboeuf12cf89b2015-02-03 16:45:18 -0600131config SAMPLE_LIVEPATCH
Joe Lawrence439e7272017-08-31 16:37:41 -0400132 tristate "Build live patching samples -- loadable modules only"
Josh Poimboeuf12cf89b2015-02-03 16:45:18 -0600133 depends on LIVEPATCH && m
Seth Jennings13d1cf72014-12-16 11:58:20 -0600134 help
Joe Lawrence439e7272017-08-31 16:37:41 -0400135 Build sample live patch demonstrations.
Seth Jennings13d1cf72014-12-16 11:58:20 -0600136
Christoph Hellwig51798222015-10-03 15:32:59 +0200137config SAMPLE_CONFIGFS
138 tristate "Build configfs patching sample -- loadable modules only"
139 depends on CONFIGFS_FS && m
140 help
141 Builds a sample configfs interface.
142
Arnd Bergmann14fbff62016-04-25 18:03:08 +0200143config SAMPLE_CONNECTOR
144 tristate "Build connector sample -- loadable modules only"
Masahiro Yamadae949f4c2019-06-04 19:13:59 +0900145 depends on CONNECTOR && HEADERS_INSTALL && m
Arnd Bergmann14fbff62016-04-25 18:03:08 +0200146 help
147 When enabled, this builds both a sample kernel module for
148 the connector interface and a user space tool to communicate
149 with it.
Mauro Carvalho Chehabbaa293e2019-06-27 15:39:22 -0300150 See also Documentation/driver-api/connector.rst
Arnd Bergmann14fbff62016-04-25 18:03:08 +0200151
Gabriel Krisman Bertazi54510932021-10-25 16:27:45 -0300152config SAMPLE_FANOTIFY_ERROR
153 bool "Build fanotify error monitoring sample"
Gabriel Krisman Bertazi8fc70b32021-10-28 15:56:28 -0300154 depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
Gabriel Krisman Bertazi54510932021-10-25 16:27:45 -0300155 help
156 When enabled, this builds an example code that uses the
157 FAN_FS_ERROR fanotify mechanism to monitor filesystem
158 errors.
159 See also Documentation/admin-guide/filesystem-monitoring.rst.
160
Masahiro Yamadae949f4c2019-06-04 19:13:59 +0900161config SAMPLE_HIDRAW
162 bool "hidraw sample"
Masahiro Yamada82d00a92020-04-29 12:45:20 +0900163 depends on CC_CAN_LINK && HEADERS_INSTALL
Masahiro Yamadae949f4c2019-06-04 19:13:59 +0900164
Mickaël Salaünba84b0b2021-04-22 17:41:21 +0200165config SAMPLE_LANDLOCK
166 bool "Landlock example"
167 depends on CC_CAN_LINK && HEADERS_INSTALL
168 help
169 Build a simple Landlock sandbox manager able to start a process
170 restricted by a user-defined filesystem access control policy.
171
Masahiro Yamadae949f4c2019-06-04 19:13:59 +0900172config SAMPLE_PIDFD
173 bool "pidfd sample"
Masahiro Yamada60fb0b12020-04-29 12:45:23 +0900174 depends on CC_CAN_LINK && HEADERS_INSTALL
Masahiro Yamadae949f4c2019-06-04 19:13:59 +0900175
Olof Johanssonf6041c12016-07-05 23:53:19 -0700176config SAMPLE_SECCOMP
Masahiro Yamada7206c122019-04-27 12:33:39 +0900177 bool "Build seccomp sample code"
Masahiro Yamadaf59e7662020-04-29 12:45:16 +0900178 depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL
Olof Johanssonf6041c12016-07-05 23:53:19 -0700179 help
180 Build samples of seccomp filters using various methods of
181 BPF filter construction.
182
Masahiro Yamadab98ccc72020-04-29 12:45:26 +0900183config SAMPLE_TIMER
184 bool "Timer sample"
185 depends on CC_CAN_LINK && HEADERS_INSTALL
186
Masahiro Yamada87ecdf42020-04-29 12:45:19 +0900187config SAMPLE_UHID
188 bool "UHID sample"
189 depends on CC_CAN_LINK && HEADERS_INSTALL
190 help
191 Build UHID sample program.
192
Alex Williamson08c1a4e2016-12-30 08:13:30 -0700193config SAMPLE_VFIO_MDEV_MTTY
Christoph Hellwig6b182402023-01-10 10:10:06 +0100194 tristate "Build VFIO mtty example mediated device sample code"
Arnd Bergmannde858a02023-01-26 22:08:31 +0100195 depends on VFIO
Christoph Hellwig8bf8c5e2023-01-10 10:10:07 +0100196 select VFIO_MDEV
Alex Williamson08c1a4e2016-12-30 08:13:30 -0700197 help
198 Build a virtual tty sample driver for use as a VFIO
199 mediated device
200
Gerd Hoffmannd61fc96f2018-05-11 09:05:03 -0600201config SAMPLE_VFIO_MDEV_MDPY
Christoph Hellwig6b182402023-01-10 10:10:06 +0100202 tristate "Build VFIO mdpy example mediated device sample code"
Arnd Bergmannde858a02023-01-26 22:08:31 +0100203 depends on VFIO
Christoph Hellwig8bf8c5e2023-01-10 10:10:07 +0100204 select VFIO_MDEV
Gerd Hoffmannd61fc96f2018-05-11 09:05:03 -0600205 help
206 Build a virtual display sample driver for use as a VFIO
207 mediated device. It is a simple framebuffer and supports
208 the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
209
Gerd Hoffmanncacade12018-05-11 09:05:04 -0600210config SAMPLE_VFIO_MDEV_MDPY_FB
Christoph Hellwig6b182402023-01-10 10:10:06 +0100211 tristate "Build VFIO mdpy example guest fbdev driver"
212 depends on FB
Thomas Zimmermanne4ef4e52023-08-03 20:36:12 +0200213 select FB_IOMEM_HELPERS
Gerd Hoffmanncacade12018-05-11 09:05:04 -0600214 help
215 Guest fbdev driver for the virtual display sample driver.
216
Gerd Hoffmanna5e6e652018-05-11 09:05:04 -0600217config SAMPLE_VFIO_MDEV_MBOCHS
ye xingchene951eaa2023-01-30 10:13:51 +0800218 tristate "Build VFIO mbochs example mediated device sample code"
Arnd Bergmannde858a02023-01-26 22:08:31 +0100219 depends on VFIO
Christoph Hellwig8bf8c5e2023-01-10 10:10:07 +0100220 select VFIO_MDEV
Arnd Bergmannc1abca92018-05-30 23:37:31 +0200221 select DMA_SHARED_BUFFER
Gerd Hoffmanna5e6e652018-05-11 09:05:04 -0600222 help
223 Build a virtual display sample driver for use as a VFIO
224 mediated device. It supports the region display interface
225 (VFIO_GFX_PLANE_TYPE_DMABUF).
226 Emulate enough of qemu stdvga to make bochs-drm.ko happy.
227 That is basically the vram memory bar and the bochs dispi
228 interface vbe registers in the mmio register bar.
229 Specifically it does *not* include any legacy vga stuff.
230 Device looks a lot like "qemu -device secondary-vga".
231
Christian Brauner9762dc12019-01-11 14:41:00 +0100232config SAMPLE_ANDROID_BINDERFS
233 bool "Build Android binderfs example"
Masahiro Yamadafca5e942020-06-07 12:20:53 +0900234 depends on CC_CAN_LINK && HEADERS_INSTALL
Christian Brauner9762dc12019-01-11 14:41:00 +0100235 help
236 Builds a sample program to illustrate the use of the Android binderfs
237 filesystem.
238
David Howellsf1b56182018-11-01 23:36:32 +0000239config SAMPLE_VFS
240 bool "Build example programs that use new VFS system calls"
Masahiro Yamada28949b82020-04-29 12:45:22 +0900241 depends on CC_CAN_LINK && HEADERS_INSTALL
David Howellsa528d352017-01-31 16:46:22 +0000242 help
David Howellsf1b56182018-11-01 23:36:32 +0000243 Build example userspace programs that use new VFS system calls such
244 as mount API and statx(). Note that this is restricted to the x86
245 arch whilst it accesses system calls that aren't yet in all arches.
David Howellsa528d352017-01-31 16:46:22 +0000246
Tomas Winkler6859eba2019-10-10 16:27:10 +0300247config SAMPLE_INTEL_MEI
248 bool "Build example program working with intel mei driver"
249 depends on INTEL_MEI
Masahiro Yamadac4c10992020-04-29 12:45:24 +0900250 depends on CC_CAN_LINK && HEADERS_INSTALL
Tomas Winkler6859eba2019-10-10 16:27:10 +0300251 help
252 Build a sample program to work with mei device.
253
Julien Panis9e66fb522023-05-11 11:51:26 +0200254config SAMPLE_TPS6594_PFSM
255 bool "Build example program working with TPS6594 PFSM driver"
256 depends on HEADERS_INSTALL
Arnd Bergmanna5052c82023-06-16 16:50:10 +0200257 depends on CC_CAN_LINK
Julien Panis9e66fb522023-05-11 11:51:26 +0200258 help
259 Build a sample program to work with PFSM devices.
260
Masahiro Yamada88a8e272020-04-29 12:45:27 +0900261config SAMPLE_WATCHDOG
262 bool "watchdog sample"
263 depends on CC_CAN_LINK
Tomas Winkler6859eba2019-10-10 16:27:10 +0300264
David Howellsf5b5a162020-01-14 17:07:11 +0000265config SAMPLE_WATCH_QUEUE
Gabriel Krisman Bertazi8fe62e02020-11-24 15:28:02 -0500266 bool "Build example watch_queue notification API consumer"
Masahiro Yamada214377e2020-06-17 11:08:38 +0900267 depends on CC_CAN_LINK && HEADERS_INSTALL
David Howellsf5b5a162020-01-14 17:07:11 +0000268 help
269 Build example userspace program to use the new mount_notify(),
270 sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
Mathieu Desnoyers267c4022007-10-18 23:41:07 -0700271
Mike Leachede5bab2021-11-24 20:00:36 +0000272config SAMPLE_CORESIGHT_SYSCFG
273 tristate "Build example loadable module for CoreSight config"
274 depends on CORESIGHT && m
275 help
276 Build an example loadable module that adds new CoreSight features
277 and configuration using the CoreSight system configuration API.
278 This demonstrates how a user may create their own CoreSight
279 configurations and easily load them into the system at runtime.
280
Hao Ge27d9a0f2023-03-30 14:09:04 +0800281config SAMPLE_KMEMLEAK
282 tristate "Simple test for the kernel memory leak detector"
283 depends on DEBUG_KMEMLEAK && m
284 help
285 Build a sample program which have explicitly leaks memory to test
286 kmemleak
287
Dmitry Rokosov60433a92023-11-23 10:19:43 +0300288config SAMPLE_CGROUP
289 bool "Build cgroup sample code"
290 depends on CGROUPS && CC_CAN_LINK && HEADERS_INSTALL
291 help
292 Build samples that demonstrate the usage of the cgroup API.
293
Miguel Ojedae4fc6582021-07-03 17:21:12 +0200294source "samples/rust/Kconfig"
295
Mathieu Desnoyers267c4022007-10-18 23:41:07 -0700296endif # SAMPLES
Heiko Carstensc316eb42021-10-12 15:38:01 +0200297
298config HAVE_SAMPLE_FTRACE_DIRECT
299 bool
Linus Torvalds0b707e52021-11-06 14:48:06 -0700300
Heiko Carstens503e4512021-11-15 20:56:13 +0100301config HAVE_SAMPLE_FTRACE_DIRECT_MULTI
Linus Torvalds0b707e52021-11-06 14:48:06 -0700302 bool