mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
Adds a new sample driver `rust_scoped_debugfs` that demonstrates the use of the scoped debugfs APIs. The driver creates a `control` directory with two write-only files, `create` and `remove`. Writing a name and a series of numbers to `create` will create a new subdirectory under a `dynamic` directory. This new subdirectory will contain files that expose the numbers as atomic values. Writing a name to `remove` will remove the corresponding subdirectory from the `dynamic` directory. This sample serves as an example of how to use the `debugfs::Scope` and `debugfs::ScopedDir` APIs to create and manage debugfs entries that are tied to the lifetime of a data structure. Signed-off-by: Matthew Maurer <mmaurer@google.com> Tested-by: Dirk Behme <dirk.behme@de.bosch.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20250904-debugfs-rust-v11-7-7d12a165685a@google.com [ Rename "scoped_debugfs" -> "debugfs_scoped", fix up Result<(), Error> -> Result. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org>
19 lines
838 B
Makefile
19 lines
838 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
ccflags-y += -I$(src) # needed for trace events
|
|
|
|
obj-$(CONFIG_SAMPLE_RUST_MINIMAL) += rust_minimal.o
|
|
obj-$(CONFIG_SAMPLE_RUST_MISC_DEVICE) += rust_misc_device.o
|
|
obj-$(CONFIG_SAMPLE_RUST_PRINT) += rust_print.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DEBUGFS) += rust_debugfs.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DEBUGFS_SCOPED) += rust_debugfs_scoped.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DMA) += rust_dma.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DRIVER_PCI) += rust_driver_pci.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DRIVER_PLATFORM) += rust_driver_platform.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DRIVER_FAUX) += rust_driver_faux.o
|
|
obj-$(CONFIG_SAMPLE_RUST_DRIVER_AUXILIARY) += rust_driver_auxiliary.o
|
|
obj-$(CONFIG_SAMPLE_RUST_CONFIGFS) += rust_configfs.o
|
|
|
|
rust_print-y := rust_print_main.o rust_print_events.o
|
|
|
|
subdir-$(CONFIG_SAMPLE_RUST_HOSTPROGS) += hostprogs
|