Skip to content

rust: debugfs: Support attaching data to DebugFS directories

Matthew Maurer lkml rust-for-linux 2 versions – New

Get series with b4
b4 am [email protected] change-id 20250501-debugfs-rust-attach-e164b67c9c16

Versions newest first

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Rebased on top of new DebugFS bindings to make it easier to play with.
- Attachment model still hasn't changed as that's still being discussed.
See: https://lore.kernel.org/all/CAGSQo03sHhUX-Eo31cMmeNMaNnzWxU0c-ObTkr7Z1CJ2uQ6c4g@mail.gmail.com/
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2rust: debugfs: Add interface to build debugfs off pinned objectsrust/kernel/debugfs.rs+208 -100 replies
2/2rust: debugfs: Extend sample to use attached datasamples/rust/rust_debugfs.rs+106 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH WIP v2 0/2] rust: debugfs: Support attaching data to DebugFS directories

We can wait to properly review and land this until after we've decided on the final interface for the first part, but since [email protected] was poking at how this might work in his review of the previous patchset, I wanted to upload this sketch as context.

The general concept here is that you select an owning directory and attach data to it while converting its lifetime to be invariant (e.g. can't be shortened) so that you know that the DebugFS contents will be cleaned up before the data. You can then implement things underneath that directory using the attached data.

---
Changes in v2:
- Rebased on top of new DebugFS bindings to make it easier to play with.
- Attachment model still hasn't changed as that's still being discussed.
See: https://lore.kernel.org/all/CAGSQo03sHhUX-Eo31cMmeNMaNnzWxU0c-ObTkr7Z1CJ2uQ6c4g@mail.gmail.com/
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Matthew Maurer (2):
rust: debugfs: Add interface to build debugfs off pinned objects
rust: debugfs: Extend sample to use attached data

 rust/kernel/debugfs.rs       | 218 +++++++++++++++++++++++++++++++++++++++++--
 samples/rust/rust_debugfs.rs | 110 +++++++++++++++++++++-
 2 files changed, 314 insertions(+), 14 deletions(-)

---
base-commit: 33035b665157558254b3c21c3f049fd728e72368
change-id: 20250501-debugfs-rust-attach-e164b67c9c16
prerequisite-change-id: 20250428-debugfs-rust-3cd5c97eb7d1:v5
prerequisite-patch-id: 1bc0f0d9ea12a4dfa986bd6b88863b0561d7e215
prerequisite-patch-id: 6338f30c269eb6ec314d3e4c0b9c2c0215f58325
prerequisite-patch-id: 862adaf3d9fbc860a8eb23bf8779c4b299c0149e
prerequisite-patch-id: 0198767a9410d24382e72ca9cf1e3d205deb4fd3

Best regards,

Signature · 1 line
Matthew Maurer <[email protected]>