summaryrefslogtreecommitdiff
path: root/drivers/android/binder/trace.rs
blob: 9839901c7151590defed297b091f1339603c09df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// SPDX-License-Identifier: GPL-2.0

// Copyright (C) 2025 Google LLC.

use crate::transaction::Transaction;

use kernel::bindings::{rust_binder_transaction, task_struct};
use kernel::ffi::{c_uint, c_ulong};
use kernel::task::Task;
use kernel::tracepoint::declare_trace;

declare_trace! {
    unsafe fn rust_binder_ioctl(cmd: c_uint, arg: c_ulong);
    unsafe fn rust_binder_transaction(reply: bool, t: rust_binder_transaction, thread: *mut task_struct);
}

#[inline]
fn raw_transaction(t: &Transaction) -> rust_binder_transaction {
    t as *const Transaction as rust_binder_transaction
}

#[inline]
pub(crate) fn trace_ioctl(cmd: u32, arg: usize) {
    // SAFETY: Always safe to call.
    unsafe { rust_binder_ioctl(cmd, arg as c_ulong) }
}

#[inline]
pub(crate) fn trace_transaction(reply: bool, t: &Transaction, thread: Option<&Task>) {
    let thread = match thread {
        Some(thread) => thread.as_ptr(),
        None => core::ptr::null_mut(),
    };
    // SAFETY: The raw transaction is valid for the duration of this call. The thread pointer is
    // valid or null.
    unsafe { rust_binder_transaction(reply, raw_transaction(t), thread) }
}
8e'>net: usb: aqc111: Initialize wol_cfg with memset in aqc111_suspendNathan Chancellor 2018-11-27net: usb: aqc111: Add ASIX's HW idsDmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for wake on LAN by MAGIC packetDmitry Bezrukov 2018-11-27net: usb: aqc111: Implement get/set_link_ksettings callbacksDmitry Bezrukov 2018-11-27net: usb: aqc111: Initialize ethtool_ops structureDmitry Bezrukov 2018-11-27net: usb: aqc111: Add RX VLAN filtering supportDmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for VLAN_CTAG_TX/RX offloadDmitry Bezrukov 2018-11-27net: usb: aqc111: Implement set_rx_mode callbackDmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for TSODmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for enable/disable checksum offloadDmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for changing MTUDmitry Bezrukov 2018-11-27net: usb: aqc111: Add checksum offload supportDmitry Bezrukov 2018-11-27net: usb: aqc111: Implement RX data pathDmitry Bezrukov 2018-11-27net: usb: aqc111: Implement TX data pathDmitry Bezrukov 2018-11-27net: usb: aqc111: Add support for getting and setting of MAC addressDmitry Bezrukov 2018-11-27net: usb: aqc111: Introduce link managementDmitry Bezrukov 2018-11-27net: usb: aqc111: Introduce PHY accessDmitry Bezrukov 2018-11-27net: usb: aqc111: Various callbacks implementationDmitry Bezrukov 2018-11-27net: usb: aqc111: Add implementation of read and write commandsDmitry Bezrukov 2018-11-27net: usb: aqc111: Add bind and empty unbind callbacksDmitry Bezrukov 2018-11-27net: usb: aqc111: Driver skeleton for Aquantia AQtion USB to 5GbEDmitry Bezrukov