rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Access Rust fields from TP_fast_assign in TRACE_EVENT
@ 2025-12-03 14:48 Alice Ryhl
  2025-12-03 14:48 ` [PATCH 1/2] rust: sync: add Arc::DATA_OFFSET Alice Ryhl
  2025-12-03 14:48 ` [PATCH 2/2] rust_binder: add binder_transaction tracepoint Alice Ryhl
  0 siblings, 2 replies; 4+ messages in thread
From: Alice Ryhl @ 2025-12-03 14:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Carlos Llamas, Steven Rostedt
  Cc: Masami Hiramatsu, Mathieu Desnoyers, Miguel Ojeda, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Trevor Gross, Danilo Krummrich, Arve Hjønnevåg,
	Todd Kjos, Martijn Coenen, Joel Fernandes, Christian Brauner,
	Suren Baghdasaryan, rust-for-linux, linux-trace-kernel,
	linux-kernel, Alice Ryhl

This patch shows one possible mechanism for accessing Rust fields from
the TP_fast_assign() body of a trace event. The idea is to have the
driver expose the offsets of the relevant fields, and to have the C code
use those offsets to access the data.

I'm currently using this mechanism in the Rust Binder driver on
Android's fork of 6.12.

Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Alice Ryhl (2):
      rust: sync: add Arc::DATA_OFFSET
      rust_binder: add binder_transaction tracepoint

 drivers/android/binder/node.rs              |  8 +++
 drivers/android/binder/process.rs           |  7 +++
 drivers/android/binder/rust_binder.h        | 79 +++++++++++++++++++++++++++++
 drivers/android/binder/rust_binder_events.h | 30 +++++++++++
 drivers/android/binder/rust_binder_main.rs  |  8 +++
 drivers/android/binder/thread.rs            |  1 +
 drivers/android/binder/trace.rs             | 21 ++++++++
 drivers/android/binder/transaction.rs       | 14 +++++
 rust/kernel/sync/arc.rs                     |  3 ++
 9 files changed, 171 insertions(+)
---
base-commit: 211ddde0823f1442e4ad052a2f30f050145ccada
change-id: 20251113-binder-trace1-b2d369f63e30

Best regards,
-- 
Alice Ryhl <aliceryhl@google.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-04 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 14:48 [PATCH 0/2] Access Rust fields from TP_fast_assign in TRACE_EVENT Alice Ryhl
2025-12-03 14:48 ` [PATCH 1/2] rust: sync: add Arc::DATA_OFFSET Alice Ryhl
2025-12-04 13:32   ` Daniel Almeida
2025-12-03 14:48 ` [PATCH 2/2] rust_binder: add binder_transaction tracepoint Alice Ryhl

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).