xref: /linux/samples/Kconfig (revision 8fc70b3a142f97f7859bf052151df896933d2586)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2267c4025SMathieu Desnoyersmenuconfig SAMPLES
3267c4025SMathieu Desnoyers	bool "Sample kernel code"
4267c4025SMathieu Desnoyers	help
5267c4025SMathieu Desnoyers	  You can build and test sample kernel code here.
6267c4025SMathieu Desnoyers
7267c4025SMathieu Desnoyersif SAMPLES
8267c4025SMathieu Desnoyers
987ffbba9SMasahiro Yamadaconfig SAMPLE_AUXDISPLAY
1087ffbba9SMasahiro Yamada	bool "auxdisplay sample"
1187ffbba9SMasahiro Yamada	depends on CC_CAN_LINK
1287ffbba9SMasahiro Yamada
139cfe06f8SSteven Rostedtconfig SAMPLE_TRACE_EVENTS
1496d17980SLi Zefan	tristate "Build trace_events examples -- loadable modules only"
1596d17980SLi Zefan	depends on EVENT_TRACING && m
169cfe06f8SSteven Rostedt	help
179cfe06f8SSteven Rostedt	  This build trace event example modules.
189cfe06f8SSteven Rostedt
19aad108aaSSteven Rostedt (Red Hat)config SAMPLE_TRACE_PRINTK
20aad108aaSSteven Rostedt (Red Hat)        tristate "Build trace_printk module - tests various trace_printk formats"
21aad108aaSSteven Rostedt (Red Hat)	depends on EVENT_TRACING && m
22aad108aaSSteven Rostedt (Red Hat)	help
23aad108aaSSteven Rostedt (Red Hat)	 This builds a module that calls trace_printk() and can be used to
24aad108aaSSteven Rostedt (Red Hat)	 test various trace_printk() calls from a module.
25aad108aaSSteven Rostedt (Red Hat)
26b06457c8SSteven Rostedt (VMware)config SAMPLE_FTRACE_DIRECT
27b06457c8SSteven Rostedt (VMware)	tristate "Build register_ftrace_direct() example"
28b06457c8SSteven Rostedt (VMware)	depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS && m
29b06457c8SSteven Rostedt (VMware)	depends on X86_64 # has x86_64 inlined asm
30b06457c8SSteven Rostedt (VMware)	help
31b06457c8SSteven Rostedt (VMware)	  This builds an ftrace direct function example
32b06457c8SSteven Rostedt (VMware)	  that hooks to wake_up_process and prints the parameters.
33b06457c8SSteven Rostedt (VMware)
3489ed4249SDivya Indiconfig SAMPLE_TRACE_ARRAY
3589ed4249SDivya Indi        tristate "Build sample module for kernel access to Ftrace instancess"
3689ed4249SDivya Indi	depends on EVENT_TRACING && m
3789ed4249SDivya Indi	help
3889ed4249SDivya Indi	 This builds a module that demonstrates the use of various APIs to
3989ed4249SDivya Indi	 access Ftrace instances from within the kernel.
4089ed4249SDivya Indi
4140efcb05SGreg Kroah-Hartmanconfig SAMPLE_KOBJECT
42e7e34917SMasahiro Yamada	tristate "Build kobject examples"
4340efcb05SGreg Kroah-Hartman	help
4440efcb05SGreg Kroah-Hartman	  This config option will allow you to build a number of
4540efcb05SGreg Kroah-Hartman	  different kobject sample modules showing how to use kobjects,
4640efcb05SGreg Kroah-Hartman	  ksets, and ktypes properly.
4740efcb05SGreg Kroah-Hartman
4840efcb05SGreg Kroah-Hartman	  If in doubt, say "N" here.
4940efcb05SGreg Kroah-Hartman
50804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KPROBES
51804defeaSAnanth N Mavinakayanahalli	tristate "Build kprobes examples -- loadable modules only"
52804defeaSAnanth N Mavinakayanahalli	depends on KPROBES && m
53804defeaSAnanth N Mavinakayanahalli	help
54804defeaSAnanth N Mavinakayanahalli	  This build several kprobes example modules.
55804defeaSAnanth N Mavinakayanahalli
56804defeaSAnanth N Mavinakayanahalliconfig SAMPLE_KRETPROBES
57804defeaSAnanth N Mavinakayanahalli	tristate "Build kretprobes example -- loadable modules only"
58804defeaSAnanth N Mavinakayanahalli	default m
59804defeaSAnanth N Mavinakayanahalli	depends on SAMPLE_KPROBES && KRETPROBES
60804defeaSAnanth N Mavinakayanahalli
6143203993SK.Prasadconfig SAMPLE_HW_BREAKPOINT
6243203993SK.Prasad	tristate "Build kernel hardware breakpoint examples -- loadable module only"
6343203993SK.Prasad	depends on HAVE_HW_BREAKPOINT && m
6443203993SK.Prasad	help
6543203993SK.Prasad	  This builds kernel hardware breakpoint example modules.
6643203993SK.Prasad
675bf2b193SStefani Seiboldconfig SAMPLE_KFIFO
685bf2b193SStefani Seibold	tristate "Build kfifo examples -- loadable modules only"
695bf2b193SStefani Seibold	depends on m
705bf2b193SStefani Seibold	help
715bf2b193SStefani Seibold	  This config option will allow you to build a number of
725bf2b193SStefani Seibold	  different kfifo sample modules showing how to use the
735bf2b193SStefani Seibold	  generic kfifo API.
745bf2b193SStefani Seibold
755bf2b193SStefani Seibold	  If in doubt, say "N" here.
765bf2b193SStefani Seibold
774aad8f51SJason Wesselconfig SAMPLE_KDB
7825985edcSLucas De Marchi	tristate "Build kdb command example -- loadable modules only"
794aad8f51SJason Wessel	depends on KGDB_KDB && m
804aad8f51SJason Wessel	help
814aad8f51SJason Wessel	  Build an example of how to dynamically add the hello
824aad8f51SJason Wessel	  command to the kdb shell.
834aad8f51SJason Wessel
84842891beSBjorn Anderssonconfig SAMPLE_QMI_CLIENT
85842891beSBjorn Andersson	tristate "Build qmi client sample -- loadable modules only"
86842891beSBjorn Andersson	depends on m
87842891beSBjorn Andersson	depends on ARCH_QCOM
88dea4bd19SArnd Bergmann	depends on NET
89842891beSBjorn Andersson	select QCOM_QMI_HELPERS
90842891beSBjorn Andersson	help
91842891beSBjorn Andersson	  Build an QMI client sample driver, which demonstrates how to
92842891beSBjorn Andersson	  communicate with a remote QRTR service, using QMI encoded messages.
93842891beSBjorn Andersson
94779b96d2SOhad Ben-Cohenconfig SAMPLE_RPMSG_CLIENT
95779b96d2SOhad Ben-Cohen	tristate "Build rpmsg client sample -- loadable modules only"
96779b96d2SOhad Ben-Cohen	depends on RPMSG && m
97779b96d2SOhad Ben-Cohen	help
98779b96d2SOhad Ben-Cohen	  Build an rpmsg client sample driver, which demonstrates how
99779b96d2SOhad Ben-Cohen	  to communicate with an AMP-configured remote processor over
100779b96d2SOhad Ben-Cohen	  the rpmsg bus.
101779b96d2SOhad Ben-Cohen
10212cf89b5SJosh Poimboeufconfig SAMPLE_LIVEPATCH
103439e7271SJoe Lawrence	tristate "Build live patching samples -- loadable modules only"
10412cf89b5SJosh Poimboeuf	depends on LIVEPATCH && m
10513d1cf7eSSeth Jennings	help
106439e7271SJoe Lawrence	  Build sample live patch demonstrations.
10713d1cf7eSSeth Jennings
10851798222SChristoph Hellwigconfig SAMPLE_CONFIGFS
10951798222SChristoph Hellwig	tristate "Build configfs patching sample -- loadable modules only"
11051798222SChristoph Hellwig	depends on CONFIGFS_FS && m
11151798222SChristoph Hellwig	help
11251798222SChristoph Hellwig	  Builds a sample configfs interface.
11351798222SChristoph Hellwig
11414fbff6bSArnd Bergmannconfig SAMPLE_CONNECTOR
11514fbff6bSArnd Bergmann	tristate "Build connector sample -- loadable modules only"
116e949f4c2SMasahiro Yamada	depends on CONNECTOR && HEADERS_INSTALL && m
11714fbff6bSArnd Bergmann	help
11814fbff6bSArnd Bergmann	  When enabled, this builds both a sample kernel module for
11914fbff6bSArnd Bergmann	  the connector interface and a user space tool to communicate
12014fbff6bSArnd Bergmann	  with it.
121baa293e9SMauro Carvalho Chehab	  See also Documentation/driver-api/connector.rst
12214fbff6bSArnd Bergmann
12354510930SGabriel Krisman Bertaziconfig SAMPLE_FANOTIFY_ERROR
12454510930SGabriel Krisman Bertazi	bool "Build fanotify error monitoring sample"
125*8fc70b3aSGabriel Krisman Bertazi	depends on FANOTIFY && CC_CAN_LINK && HEADERS_INSTALL
12654510930SGabriel Krisman Bertazi	help
12754510930SGabriel Krisman Bertazi	  When enabled, this builds an example code that uses the
12854510930SGabriel Krisman Bertazi	  FAN_FS_ERROR fanotify mechanism to monitor filesystem
12954510930SGabriel Krisman Bertazi	  errors.
13054510930SGabriel Krisman Bertazi	  See also Documentation/admin-guide/filesystem-monitoring.rst.
13154510930SGabriel Krisman Bertazi
132e949f4c2SMasahiro Yamadaconfig SAMPLE_HIDRAW
133e949f4c2SMasahiro Yamada	bool "hidraw sample"
13482d00a93SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
135e949f4c2SMasahiro Yamada
136ba84b0bfSMickaël Salaünconfig SAMPLE_LANDLOCK
137ba84b0bfSMickaël Salaün	bool "Landlock example"
138ba84b0bfSMickaël Salaün	depends on CC_CAN_LINK && HEADERS_INSTALL
139ba84b0bfSMickaël Salaün	help
140ba84b0bfSMickaël Salaün	  Build a simple Landlock sandbox manager able to start a process
141ba84b0bfSMickaël Salaün	  restricted by a user-defined filesystem access control policy.
142ba84b0bfSMickaël Salaün
143e949f4c2SMasahiro Yamadaconfig SAMPLE_PIDFD
144e949f4c2SMasahiro Yamada	bool "pidfd sample"
14560fb0b12SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
146e949f4c2SMasahiro Yamada
147f6041c1dSOlof Johanssonconfig SAMPLE_SECCOMP
1487206c124SMasahiro Yamada	bool "Build seccomp sample code"
149f59e7668SMasahiro Yamada	depends on SECCOMP_FILTER && CC_CAN_LINK && HEADERS_INSTALL
150f6041c1dSOlof Johansson	help
151f6041c1dSOlof Johansson	  Build samples of seccomp filters using various methods of
152f6041c1dSOlof Johansson	  BPF filter construction.
153f6041c1dSOlof Johansson
154b98ccc71SMasahiro Yamadaconfig SAMPLE_TIMER
155b98ccc71SMasahiro Yamada	bool "Timer sample"
156b98ccc71SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
157b98ccc71SMasahiro Yamada
15887ecdf4fSMasahiro Yamadaconfig SAMPLE_UHID
15987ecdf4fSMasahiro Yamada	bool "UHID sample"
16087ecdf4fSMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
16187ecdf4fSMasahiro Yamada	help
16287ecdf4fSMasahiro Yamada	  Build UHID sample program.
16387ecdf4fSMasahiro Yamada
16408c1a4efSAlex Williamsonconfig SAMPLE_VFIO_MDEV_MTTY
16508c1a4efSAlex Williamson	tristate "Build VFIO mtty example mediated device sample code -- loadable modules only"
166af3ab3f9SJason Gunthorpe	depends on VFIO_MDEV && m
16708c1a4efSAlex Williamson	help
16808c1a4efSAlex Williamson	  Build a virtual tty sample driver for use as a VFIO
16908c1a4efSAlex Williamson	  mediated device
17008c1a4efSAlex Williamson
171d61fc96fSGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY
172d61fc96fSGerd Hoffmann	tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only"
173af3ab3f9SJason Gunthorpe	depends on VFIO_MDEV && m
174d61fc96fSGerd Hoffmann	help
175d61fc96fSGerd Hoffmann	  Build a virtual display sample driver for use as a VFIO
176d61fc96fSGerd Hoffmann	  mediated device.  It is a simple framebuffer and supports
177d61fc96fSGerd Hoffmann	  the region display interface (VFIO_GFX_PLANE_TYPE_REGION).
178d61fc96fSGerd Hoffmann
179cacade19SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MDPY_FB
180cacade19SGerd Hoffmann	tristate "Build VFIO mdpy example guest fbdev driver -- loadable module only"
181cacade19SGerd Hoffmann	depends on FB && m
182cacade19SGerd Hoffmann	select FB_CFB_FILLRECT
183cacade19SGerd Hoffmann	select FB_CFB_COPYAREA
184cacade19SGerd Hoffmann	select FB_CFB_IMAGEBLIT
185cacade19SGerd Hoffmann	help
186cacade19SGerd Hoffmann	  Guest fbdev driver for the virtual display sample driver.
187cacade19SGerd Hoffmann
188a5e6e650SGerd Hoffmannconfig SAMPLE_VFIO_MDEV_MBOCHS
189a5e6e650SGerd Hoffmann	tristate "Build VFIO mdpy example mediated device sample code -- loadable modules only"
190af3ab3f9SJason Gunthorpe	depends on VFIO_MDEV && m
191c1abca96SArnd Bergmann	select DMA_SHARED_BUFFER
192a5e6e650SGerd Hoffmann	help
193a5e6e650SGerd Hoffmann	  Build a virtual display sample driver for use as a VFIO
194a5e6e650SGerd Hoffmann	  mediated device.  It supports the region display interface
195a5e6e650SGerd Hoffmann	  (VFIO_GFX_PLANE_TYPE_DMABUF).
196a5e6e650SGerd Hoffmann	  Emulate enough of qemu stdvga to make bochs-drm.ko happy.
197a5e6e650SGerd Hoffmann	  That is basically the vram memory bar and the bochs dispi
198a5e6e650SGerd Hoffmann	  interface vbe registers in the mmio register bar.
199a5e6e650SGerd Hoffmann	  Specifically it does *not* include any legacy vga stuff.
200a5e6e650SGerd Hoffmann	  Device looks a lot like "qemu -device secondary-vga".
201a5e6e650SGerd Hoffmann
2029762dc14SChristian Braunerconfig SAMPLE_ANDROID_BINDERFS
2039762dc14SChristian Brauner	bool "Build Android binderfs example"
204fca5e949SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
2059762dc14SChristian Brauner	help
2069762dc14SChristian Brauner	  Builds a sample program to illustrate the use of the Android binderfs
2079762dc14SChristian Brauner	  filesystem.
2089762dc14SChristian Brauner
209f1b5618eSDavid Howellsconfig SAMPLE_VFS
210f1b5618eSDavid Howells	bool "Build example programs that use new VFS system calls"
21128949b84SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
212a528d35eSDavid Howells	help
213f1b5618eSDavid Howells	  Build example userspace programs that use new VFS system calls such
214f1b5618eSDavid Howells	  as mount API and statx().  Note that this is restricted to the x86
215f1b5618eSDavid Howells	  arch whilst it accesses system calls that aren't yet in all arches.
216a528d35eSDavid Howells
2176859eba4STomas Winklerconfig SAMPLE_INTEL_MEI
2186859eba4STomas Winkler	bool "Build example program working with intel mei driver"
2196859eba4STomas Winkler	depends on INTEL_MEI
220c4c10996SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
2216859eba4STomas Winkler	help
2226859eba4STomas Winkler	  Build a sample program to work with mei device.
2236859eba4STomas Winkler
22488a8e278SMasahiro Yamadaconfig SAMPLE_WATCHDOG
22588a8e278SMasahiro Yamada	bool "watchdog sample"
22688a8e278SMasahiro Yamada	depends on CC_CAN_LINK
2276859eba4STomas Winkler
228f5b5a164SDavid Howellsconfig SAMPLE_WATCH_QUEUE
2298fe62e0cSGabriel Krisman Bertazi	bool "Build example watch_queue notification API consumer"
230214377e9SMasahiro Yamada	depends on CC_CAN_LINK && HEADERS_INSTALL
231f5b5a164SDavid Howells	help
232f5b5a164SDavid Howells	  Build example userspace program to use the new mount_notify(),
233f5b5a164SDavid Howells	  sb_notify() syscalls and the KEYCTL_WATCH_KEY keyctl() function.
234267c4025SMathieu Desnoyers
235267c4025SMathieu Desnoyersendif # SAMPLES
236