From: Steven Rostedt <rostedt@goodmis.org>
To: Alice Ryhl <aliceryhl@google.com>
Cc: "Masami Hiramatsu" <mhiramat@kernel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Josh Poimboeuf" <jpoimboe@kernel.org>,
"Jason Baron" <jbaron@akamai.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Wedson Almeida Filho" <wedsonaf@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@samsung.com>,
linux-trace-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
"Arnd Bergmann" <arnd@arndb.de>,
linux-arch@vger.kernel.org,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"Dave Hansen" <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
"Sean Christopherson" <seanjc@google.com>,
"Uros Bizjak" <ubizjak@gmail.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>, "Marc Zyngier" <maz@kernel.org>,
"Oliver Upton" <oliver.upton@linux.dev>,
"Mark Rutland" <mark.rutland@arm.com>,
"Ryan Roberts" <ryan.roberts@arm.com>,
"Fuad Tabba" <tabba@google.com>,
linux-arm-kernel@lists.infradead.org,
"Paul Walmsley" <paul.walmsley@sifive.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Anup Patel" <apatel@ventanamicro.com>,
"Andrew Jones" <ajones@ventanamicro.com>,
"Alexandre Ghiti" <alexghiti@rivosinc.com>,
"Conor Dooley" <conor.dooley@microchip.com>,
"Samuel Holland" <samuel.holland@sifive.com>,
linux-riscv@lists.infradead.org,
"Huacai Chen" <chenhuacai@kernel.org>,
"WANG Xuerui" <kernel@xen0n.name>,
"Bibo Mao" <maobibo@loongson.cn>,
"Tiezhu Yang" <yangtiezhu@loongson.cn>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Tianrui Zhao" <zhaotianrui@loongson.cn>,
loongarch@lists.linux.dev, "Carlos Llamas" <cmllamas@google.com>
Subject: Re: [PATCH v8 0/5] Tracepoints and static branch in Rust
Date: Tue, 1 Oct 2024 09:15:27 -0400 [thread overview]
Message-ID: <20241001091527.2fe4e039@gandalf.local.home> (raw)
In-Reply-To: <20240822-tracepoint-v8-0-f0c5899e6fd3@google.com>
Hi Alice,
Can you rebase this series on v6.12-rc1?
Thanks,
-- Steve
On Thu, 22 Aug 2024 12:04:12 +0000
Alice Ryhl <aliceryhl@google.com> wrote:
> An important part of a production ready Linux kernel driver is
> tracepoints. So to write production ready Linux kernel drivers in Rust,
> we must be able to call tracepoints from Rust code. This patch series
> adds support for calling tracepoints declared in C from Rust.
>
> This series includes a patch that adds a user of tracepoits to the
> rust_print sample. Please see that sample for details on what is needed
> to use this feature in Rust code.
>
> This is intended for use in the Rust Binder driver, which was originally
> sent as an RFC [1]. The RFC did not include tracepoint support, but you
> can see how it will be used in Rust Binder at [2]. The author has
> verified that the tracepoint support works on Android devices.
>
> This implementation implements support for static keys in Rust so that
> the actual static branch happens in the Rust object file. However, the
> __DO_TRACE body remains in C code. See v1 for an implementation where
> __DO_TRACE is also implemented in Rust.
>
> When compiling for x86, this patchset has a dependency on [3] as we need
> objtool to convert jmp instructions to nop instructions. This patchset
> is based on top of the series containing [3].
>
> There is also a conflict with splitting up the C helpers [4]. I've
> included an alternate version of the first patch that shows how to
> resolve the conflict. When using the alternate version of the first
> patch, this series applies cleanly on top of rust-next.
>
> Both [3] and [4] are already in rust-next.
>
> Link: https://lore.kernel.org/rust-for-linux/20231101-rust-binder-v1-0-08ba9197f637@google.com/ [1]
> Link: https://r.android.com/3119993 [2]
> Link: https://lore.kernel.org/all/20240725183325.122827-7-ojeda@kernel.org/ [3]
> Link: https://lore.kernel.org/all/20240815103016.2771842-1-nmi@metaspace.dk/ [4]
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> ---
> Changes in v8:
> - Use OBJTREE instead of SRCTREE for temporary asm file.
> - Adjust comments on `asm!` wrapper to be less confusing.
> - Include resolution of conflict with helpers splitting.
> - Link to v7: https://lore.kernel.org/r/20240816-tracepoint-v7-0-d609b916b819@google.com
>
> Changes in v7:
> - Fix spurious file included in first patch.
> - Fix issue with riscv asm.
> - Fix tags on fourth patch to match fifth patch.
> - Add Reviewed-by/Acked-by tags where appropriate.
> - Link to v6: https://lore.kernel.org/r/20240808-tracepoint-v6-0-a23f800f1189@google.com
>
> Changes in v6:
> - Add support for !CONFIG_JUMP_LABEL.
> - Add tracepoint to rust_print sample.
> - Deduplicate inline asm.
> - Require unsafe inside `declare_trace!`.
> - Fix bug on x86 due to use of intel syntax.
> - Link to v5: https://lore.kernel.org/r/20240802-tracepoint-v5-0-faa164494dcb@google.com
>
> Changes in v5:
> - Update first patch regarding inline asm duplication.
> - Add __rust_do_trace helper to support conditions.
> - Rename DEFINE_RUST_DO_TRACE_REAL to __DEFINE_RUST_DO_TRACE.
> - Get rid of glob-import in tracepoint macro.
> - Address safety requirements on tracepoints in docs.
> - Link to v4: https://lore.kernel.org/rust-for-linux/20240628-tracepoint-v4-0-353d523a9c15@google.com
>
> Changes in v4:
> - Move arch-specific code into rust/kernel/arch.
> - Restore DEFINE_RUST_DO_TRACE at end of define_trace.h
> - Link to v3: https://lore.kernel.org/r/20240621-tracepoint-v3-0-9e44eeea2b85@google.com
>
> Changes in v3:
> - Support for Rust static_key on loongarch64 and riscv64.
> - Avoid failing compilation on architectures that are missing Rust
> static_key support when the archtectures does not actually use it.
> - Link to v2: https://lore.kernel.org/r/20240610-tracepoint-v2-0-faebad81b355@google.com
>
> Changes in v2:
> - Call into C code for __DO_TRACE.
> - Drop static_call patch, as it is no longer needed.
> - Link to v1: https://lore.kernel.org/r/20240606-tracepoint-v1-0-6551627bf51b@google.com
>
> ---
> Alice Ryhl (5):
> rust: add generic static_key_false
> rust: add tracepoint support
> rust: samples: add tracepoint to Rust sample
> jump_label: adjust inline asm to be consistent
> rust: add arch_static_branch
>
> MAINTAINERS | 1 +
> arch/arm/include/asm/jump_label.h | 14 +++--
> arch/arm64/include/asm/jump_label.h | 20 +++++---
> arch/loongarch/include/asm/jump_label.h | 16 +++---
> arch/riscv/include/asm/jump_label.h | 50 ++++++++++--------
> arch/x86/include/asm/jump_label.h | 38 ++++++--------
> include/linux/tracepoint.h | 22 +++++++-
> include/trace/define_trace.h | 12 +++++
> include/trace/events/rust_sample.h | 31 +++++++++++
> rust/Makefile | 5 +-
> rust/bindings/bindings_helper.h | 3 ++
> rust/helpers.c | 9 ++++
> rust/kernel/.gitignore | 3 ++
> rust/kernel/arch_static_branch_asm.rs.S | 7 +++
> rust/kernel/jump_label.rs | 91 +++++++++++++++++++++++++++++++++
> rust/kernel/lib.rs | 37 ++++++++++++++
> rust/kernel/tracepoint.rs | 49 ++++++++++++++++++
> samples/rust/Makefile | 3 +-
> samples/rust/rust_print.rs | 18 +++++++
> samples/rust/rust_print_events.c | 8 +++
> scripts/Makefile.build | 9 +++-
> 21 files changed, 379 insertions(+), 67 deletions(-)
> ---
> base-commit: 88359b25b950670432ef1da4352eb6cc62e0fa9f
> change-id: 20240606-tracepoint-31e15b90e471
>
> Best regards,
next prev parent reply other threads:[~2024-10-01 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 12:04 [PATCH v8 0/5] Tracepoints and static branch in Rust Alice Ryhl
2024-08-22 12:04 ` [PATCH v8 1/5] rust: add generic static_key_false Alice Ryhl
2024-08-22 12:08 ` [PATCH v8 1/5 alt] " Alice Ryhl
2024-08-22 13:43 ` Boqun Feng
2024-08-22 12:04 ` [PATCH v8 2/5] rust: add tracepoint support Alice Ryhl
2024-08-22 14:38 ` Boqun Feng
2024-08-22 12:04 ` [PATCH v8 3/5] rust: samples: add tracepoint to Rust sample Alice Ryhl
2024-08-22 17:19 ` Boqun Feng
2024-08-22 12:04 ` [PATCH v8 4/5] jump_label: adjust inline asm to be consistent Alice Ryhl
2024-08-22 12:04 ` [PATCH v8 5/5] rust: add arch_static_branch Alice Ryhl
2024-10-01 13:15 ` Steven Rostedt [this message]
2024-10-01 13:32 ` [PATCH v8 0/5] Tracepoints and static branch in Rust Alice Ryhl
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=20241001091527.2fe4e039@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=a.hindborg@samsung.com \
--cc=ajones@ventanamicro.com \
--cc=akpm@linux-foundation.org \
--cc=alex.gaynor@gmail.com \
--cc=alexghiti@rivosinc.com \
--cc=aliceryhl@google.com \
--cc=aou@eecs.berkeley.edu \
--cc=apatel@ventanamicro.com \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=chenhuacai@kernel.org \
--cc=cmllamas@google.com \
--cc=conor.dooley@microchip.com \
--cc=dave.hansen@linux.intel.com \
--cc=gary@garyguo.net \
--cc=hpa@zytor.com \
--cc=jbaron@akamai.com \
--cc=jpoimboe@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=maobibo@loongson.cn \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=maz@kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=ojeda@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=ryan.roberts@arm.com \
--cc=samuel.holland@sifive.com \
--cc=seanjc@google.com \
--cc=tabba@google.com \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--cc=wedsonaf@gmail.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=yangtiezhu@loongson.cn \
--cc=zhaotianrui@loongson.cn \
/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;
as well as URLs for NNTP newsgroup(s).