xref: /linux/drivers/android/binder/trace.rs (revision 4f38da1f027ea2c9f01bb71daa7a299c191b6940)
1*eafedbc7SAlice Ryhl // SPDX-License-Identifier: GPL-2.0
2*eafedbc7SAlice Ryhl 
3*eafedbc7SAlice Ryhl // Copyright (C) 2025 Google LLC.
4*eafedbc7SAlice Ryhl 
5*eafedbc7SAlice Ryhl use kernel::ffi::{c_uint, c_ulong};
6*eafedbc7SAlice Ryhl use kernel::tracepoint::declare_trace;
7*eafedbc7SAlice Ryhl 
8*eafedbc7SAlice Ryhl declare_trace! {
9*eafedbc7SAlice Ryhl     unsafe fn rust_binder_ioctl(cmd: c_uint, arg: c_ulong);
10*eafedbc7SAlice Ryhl }
11*eafedbc7SAlice Ryhl 
12*eafedbc7SAlice Ryhl #[inline]
13*eafedbc7SAlice Ryhl pub(crate) fn trace_ioctl(cmd: u32, arg: usize) {
14*eafedbc7SAlice Ryhl     // SAFETY: Always safe to call.
15*eafedbc7SAlice Ryhl     unsafe { rust_binder_ioctl(cmd, arg as c_ulong) }
16*eafedbc7SAlice Ryhl }
17