rust_binder_events.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2025 Google, Inc.
  4. */
  5. #undef TRACE_SYSTEM
  6. #undef TRACE_INCLUDE_FILE
  7. #undef TRACE_INCLUDE_PATH
  8. #define TRACE_SYSTEM rust_binder
  9. #define TRACE_INCLUDE_FILE rust_binder_events
  10. #define TRACE_INCLUDE_PATH ../drivers/android/binder
  11. #if !defined(_RUST_BINDER_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  12. #define _RUST_BINDER_TRACE_H
  13. #include <linux/tracepoint.h>
  14. TRACE_EVENT(rust_binder_ioctl,
  15. TP_PROTO(unsigned int cmd, unsigned long arg),
  16. TP_ARGS(cmd, arg),
  17. TP_STRUCT__entry(
  18. __field(unsigned int, cmd)
  19. __field(unsigned long, arg)
  20. ),
  21. TP_fast_assign(
  22. __entry->cmd = cmd;
  23. __entry->arg = arg;
  24. ),
  25. TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg)
  26. );
  27. TRACE_EVENT(rust_binder_transaction,
  28. TP_PROTO(bool reply, rust_binder_transaction t, struct task_struct *thread),
  29. TP_ARGS(reply, t, thread),
  30. TP_STRUCT__entry(
  31. __field(int, debug_id)
  32. __field(int, target_node)
  33. __field(int, to_proc)
  34. __field(int, to_thread)
  35. __field(int, reply)
  36. __field(unsigned int, code)
  37. __field(unsigned int, flags)
  38. ),
  39. TP_fast_assign(
  40. rust_binder_process to = rust_binder_transaction_to_proc(t);
  41. rust_binder_node target_node = rust_binder_transaction_target_node(t);
  42. __entry->debug_id = rust_binder_transaction_debug_id(t);
  43. __entry->target_node = target_node ? rust_binder_node_debug_id(target_node) : 0;
  44. __entry->to_proc = rust_binder_process_task(to)->pid;
  45. __entry->to_thread = thread ? thread->pid : 0;
  46. __entry->reply = reply;
  47. __entry->code = rust_binder_transaction_code(t);
  48. __entry->flags = rust_binder_transaction_flags(t);
  49. ),
  50. TP_printk("transaction=%d dest_node=%d dest_proc=%d dest_thread=%d reply=%d flags=0x%x code=0x%x",
  51. __entry->debug_id, __entry->target_node,
  52. __entry->to_proc, __entry->to_thread,
  53. __entry->reply, __entry->flags, __entry->code)
  54. );
  55. #endif /* _RUST_BINDER_TRACE_H */
  56. /* This part must be outside protection */
  57. #include <trace/define_trace.h>