From: Christian Brauner <brauner@kernel.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Christian Brauner" <brauner@kernel.org>,
"Kees Cook" <kees@kernel.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
rust-for-linux@vger.kernel.org,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>
Subject: Re: [PATCH] rust: add seqfile abstraction
Date: Tue, 1 Oct 2024 12:23:35 +0200 [thread overview]
Message-ID: <20241001-wohnmobil-umwandeln-ef7392edcdfd@brauner> (raw)
In-Reply-To: <20241001-seqfile-v1-1-dfcd0fc21e96@google.com>
On Tue, 01 Oct 2024 09:07:02 +0000, Alice Ryhl wrote:
> This adds a simple seq file abstraction that lets you print to a seq
> file using ordinary Rust printing syntax.
>
> An example user from Rust Binder:
>
> pub(crate) fn full_debug_print(
> &self,
> m: &SeqFile,
> owner_inner: &mut ProcessInner,
> ) -> Result<()> {
> let prio = self.node_prio();
> let inner = self.inner.access_mut(owner_inner);
> seq_print!(
> m,
> " node {}: u{:016x} c{:016x} pri {}:{} hs {} hw {} cs {} cw {}",
> self.debug_id,
> self.ptr,
> self.cookie,
> prio.sched_policy,
> prio.prio,
> inner.strong.has_count,
> inner.weak.has_count,
> inner.strong.count,
> inner.weak.count,
> );
> if !inner.refs.is_empty() {
> seq_print!(m, " proc");
> for node_ref in &inner.refs {
> seq_print!(m, " {}", node_ref.process.task.pid());
> }
> }
> seq_print!(m, "\n");
> for t in &inner.oneway_todo {
> t.debug_print_inner(m, " pending async transaction ");
> }
> Ok(())
> }
>
> [...]
Seems straightforward.
---
Applied to the vfs.rust.file branch of the vfs/vfs.git tree.
Patches in the vfs.rust.file branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.rust.file
[1/1] rust: add seqfile abstraction
https://git.kernel.org/vfs/vfs/c/66423ace209c
prev parent reply other threads:[~2024-10-01 10:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 9:07 [PATCH] rust: add seqfile abstraction Alice Ryhl
2024-10-01 9:10 ` Alice Ryhl
2024-10-01 10:23 ` Christian Brauner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241001-wohnmobil-umwandeln-ef7392edcdfd@brauner \
--to=brauner@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=kees@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox