18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright (C) 2012 Google, Inc. 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#undef TRACE_SYSTEM 78c2ecf20Sopenharmony_ci#define TRACE_SYSTEM binder 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#if !defined(_BINDER_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 108c2ecf20Sopenharmony_ci#define _BINDER_TRACE_H 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <linux/tracepoint.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistruct binder_buffer; 158c2ecf20Sopenharmony_cistruct binder_node; 168c2ecf20Sopenharmony_cistruct binder_proc; 178c2ecf20Sopenharmony_cistruct binder_alloc; 188c2ecf20Sopenharmony_cistruct binder_ref_data; 198c2ecf20Sopenharmony_cistruct binder_thread; 208c2ecf20Sopenharmony_cistruct binder_transaction; 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ciTRACE_EVENT(binder_ioctl, 238c2ecf20Sopenharmony_ci TP_PROTO(unsigned int cmd, unsigned long arg), 248c2ecf20Sopenharmony_ci TP_ARGS(cmd, arg), 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_ci TP_STRUCT__entry( 278c2ecf20Sopenharmony_ci __field(unsigned int, cmd) 288c2ecf20Sopenharmony_ci __field(unsigned long, arg) 298c2ecf20Sopenharmony_ci ), 308c2ecf20Sopenharmony_ci TP_fast_assign( 318c2ecf20Sopenharmony_ci __entry->cmd = cmd; 328c2ecf20Sopenharmony_ci __entry->arg = arg; 338c2ecf20Sopenharmony_ci ), 348c2ecf20Sopenharmony_ci TP_printk("cmd=0x%x arg=0x%lx", __entry->cmd, __entry->arg) 358c2ecf20Sopenharmony_ci); 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciDECLARE_EVENT_CLASS(binder_lock_class, 388c2ecf20Sopenharmony_ci TP_PROTO(const char *tag), 398c2ecf20Sopenharmony_ci TP_ARGS(tag), 408c2ecf20Sopenharmony_ci TP_STRUCT__entry( 418c2ecf20Sopenharmony_ci __field(const char *, tag) 428c2ecf20Sopenharmony_ci ), 438c2ecf20Sopenharmony_ci TP_fast_assign( 448c2ecf20Sopenharmony_ci __entry->tag = tag; 458c2ecf20Sopenharmony_ci ), 468c2ecf20Sopenharmony_ci TP_printk("tag=%s", __entry->tag) 478c2ecf20Sopenharmony_ci); 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci#define DEFINE_BINDER_LOCK_EVENT(name) \ 508c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lock_class, name, \ 518c2ecf20Sopenharmony_ci TP_PROTO(const char *func), \ 528c2ecf20Sopenharmony_ci TP_ARGS(func)) 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_ciDEFINE_BINDER_LOCK_EVENT(binder_lock); 558c2ecf20Sopenharmony_ciDEFINE_BINDER_LOCK_EVENT(binder_locked); 568c2ecf20Sopenharmony_ciDEFINE_BINDER_LOCK_EVENT(binder_unlock); 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ciDECLARE_EVENT_CLASS(binder_function_return_class, 598c2ecf20Sopenharmony_ci TP_PROTO(int ret), 608c2ecf20Sopenharmony_ci TP_ARGS(ret), 618c2ecf20Sopenharmony_ci TP_STRUCT__entry( 628c2ecf20Sopenharmony_ci __field(int, ret) 638c2ecf20Sopenharmony_ci ), 648c2ecf20Sopenharmony_ci TP_fast_assign( 658c2ecf20Sopenharmony_ci __entry->ret = ret; 668c2ecf20Sopenharmony_ci ), 678c2ecf20Sopenharmony_ci TP_printk("ret=%d", __entry->ret) 688c2ecf20Sopenharmony_ci); 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci#define DEFINE_BINDER_FUNCTION_RETURN_EVENT(name) \ 718c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_function_return_class, name, \ 728c2ecf20Sopenharmony_ci TP_PROTO(int ret), \ 738c2ecf20Sopenharmony_ci TP_ARGS(ret)) 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ciDEFINE_BINDER_FUNCTION_RETURN_EVENT(binder_ioctl_done); 768c2ecf20Sopenharmony_ciDEFINE_BINDER_FUNCTION_RETURN_EVENT(binder_write_done); 778c2ecf20Sopenharmony_ciDEFINE_BINDER_FUNCTION_RETURN_EVENT(binder_read_done); 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ciTRACE_EVENT(binder_wait_for_work, 808c2ecf20Sopenharmony_ci TP_PROTO(bool proc_work, bool transaction_stack, bool thread_todo), 818c2ecf20Sopenharmony_ci TP_ARGS(proc_work, transaction_stack, thread_todo), 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci TP_STRUCT__entry( 848c2ecf20Sopenharmony_ci __field(bool, proc_work) 858c2ecf20Sopenharmony_ci __field(bool, transaction_stack) 868c2ecf20Sopenharmony_ci __field(bool, thread_todo) 878c2ecf20Sopenharmony_ci ), 888c2ecf20Sopenharmony_ci TP_fast_assign( 898c2ecf20Sopenharmony_ci __entry->proc_work = proc_work; 908c2ecf20Sopenharmony_ci __entry->transaction_stack = transaction_stack; 918c2ecf20Sopenharmony_ci __entry->thread_todo = thread_todo; 928c2ecf20Sopenharmony_ci ), 938c2ecf20Sopenharmony_ci TP_printk("proc_work=%d transaction_stack=%d thread_todo=%d", 948c2ecf20Sopenharmony_ci __entry->proc_work, __entry->transaction_stack, 958c2ecf20Sopenharmony_ci __entry->thread_todo) 968c2ecf20Sopenharmony_ci); 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction, 998c2ecf20Sopenharmony_ci TP_PROTO(bool reply, struct binder_transaction *t, 1008c2ecf20Sopenharmony_ci struct binder_node *target_node), 1018c2ecf20Sopenharmony_ci TP_ARGS(reply, t, target_node), 1028c2ecf20Sopenharmony_ci TP_STRUCT__entry( 1038c2ecf20Sopenharmony_ci __field(int, debug_id) 1048c2ecf20Sopenharmony_ci __field(int, target_node) 1058c2ecf20Sopenharmony_ci __field(int, to_proc) 1068c2ecf20Sopenharmony_ci __field(int, to_thread) 1078c2ecf20Sopenharmony_ci __field(int, reply) 1088c2ecf20Sopenharmony_ci __field(unsigned int, code) 1098c2ecf20Sopenharmony_ci __field(unsigned int, flags) 1108c2ecf20Sopenharmony_ci ), 1118c2ecf20Sopenharmony_ci TP_fast_assign( 1128c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 1138c2ecf20Sopenharmony_ci __entry->target_node = target_node ? target_node->debug_id : 0; 1148c2ecf20Sopenharmony_ci __entry->to_proc = t->to_proc->pid; 1158c2ecf20Sopenharmony_ci __entry->to_thread = t->to_thread ? t->to_thread->pid : 0; 1168c2ecf20Sopenharmony_ci __entry->reply = reply; 1178c2ecf20Sopenharmony_ci __entry->code = t->code; 1188c2ecf20Sopenharmony_ci __entry->flags = t->flags; 1198c2ecf20Sopenharmony_ci ), 1208c2ecf20Sopenharmony_ci TP_printk("transaction=%d dest_node=%d dest_proc=%d dest_thread=%d reply=%d flags=0x%x code=0x%x", 1218c2ecf20Sopenharmony_ci __entry->debug_id, __entry->target_node, 1228c2ecf20Sopenharmony_ci __entry->to_proc, __entry->to_thread, 1238c2ecf20Sopenharmony_ci __entry->reply, __entry->flags, __entry->code) 1248c2ecf20Sopenharmony_ci); 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_received, 1278c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t), 1288c2ecf20Sopenharmony_ci TP_ARGS(t), 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci TP_STRUCT__entry( 1318c2ecf20Sopenharmony_ci __field(int, debug_id) 1328c2ecf20Sopenharmony_ci ), 1338c2ecf20Sopenharmony_ci TP_fast_assign( 1348c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 1358c2ecf20Sopenharmony_ci ), 1368c2ecf20Sopenharmony_ci TP_printk("transaction=%d", __entry->debug_id) 1378c2ecf20Sopenharmony_ci); 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_node_to_ref, 1408c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t, struct binder_node *node, 1418c2ecf20Sopenharmony_ci struct binder_ref_data *rdata), 1428c2ecf20Sopenharmony_ci TP_ARGS(t, node, rdata), 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci TP_STRUCT__entry( 1458c2ecf20Sopenharmony_ci __field(int, debug_id) 1468c2ecf20Sopenharmony_ci __field(int, node_debug_id) 1478c2ecf20Sopenharmony_ci __field(binder_uintptr_t, node_ptr) 1488c2ecf20Sopenharmony_ci __field(int, ref_debug_id) 1498c2ecf20Sopenharmony_ci __field(uint32_t, ref_desc) 1508c2ecf20Sopenharmony_ci ), 1518c2ecf20Sopenharmony_ci TP_fast_assign( 1528c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 1538c2ecf20Sopenharmony_ci __entry->node_debug_id = node->debug_id; 1548c2ecf20Sopenharmony_ci __entry->node_ptr = node->ptr; 1558c2ecf20Sopenharmony_ci __entry->ref_debug_id = rdata->debug_id; 1568c2ecf20Sopenharmony_ci __entry->ref_desc = rdata->desc; 1578c2ecf20Sopenharmony_ci ), 1588c2ecf20Sopenharmony_ci TP_printk("transaction=%d node=%d src_ptr=0x%016llx ==> dest_ref=%d dest_desc=%d", 1598c2ecf20Sopenharmony_ci __entry->debug_id, __entry->node_debug_id, 1608c2ecf20Sopenharmony_ci (u64)__entry->node_ptr, 1618c2ecf20Sopenharmony_ci __entry->ref_debug_id, __entry->ref_desc) 1628c2ecf20Sopenharmony_ci); 1638c2ecf20Sopenharmony_ci 1648c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_ref_to_node, 1658c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t, struct binder_node *node, 1668c2ecf20Sopenharmony_ci struct binder_ref_data *rdata), 1678c2ecf20Sopenharmony_ci TP_ARGS(t, node, rdata), 1688c2ecf20Sopenharmony_ci 1698c2ecf20Sopenharmony_ci TP_STRUCT__entry( 1708c2ecf20Sopenharmony_ci __field(int, debug_id) 1718c2ecf20Sopenharmony_ci __field(int, ref_debug_id) 1728c2ecf20Sopenharmony_ci __field(uint32_t, ref_desc) 1738c2ecf20Sopenharmony_ci __field(int, node_debug_id) 1748c2ecf20Sopenharmony_ci __field(binder_uintptr_t, node_ptr) 1758c2ecf20Sopenharmony_ci ), 1768c2ecf20Sopenharmony_ci TP_fast_assign( 1778c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 1788c2ecf20Sopenharmony_ci __entry->ref_debug_id = rdata->debug_id; 1798c2ecf20Sopenharmony_ci __entry->ref_desc = rdata->desc; 1808c2ecf20Sopenharmony_ci __entry->node_debug_id = node->debug_id; 1818c2ecf20Sopenharmony_ci __entry->node_ptr = node->ptr; 1828c2ecf20Sopenharmony_ci ), 1838c2ecf20Sopenharmony_ci TP_printk("transaction=%d node=%d src_ref=%d src_desc=%d ==> dest_ptr=0x%016llx", 1848c2ecf20Sopenharmony_ci __entry->debug_id, __entry->node_debug_id, 1858c2ecf20Sopenharmony_ci __entry->ref_debug_id, __entry->ref_desc, 1868c2ecf20Sopenharmony_ci (u64)__entry->node_ptr) 1878c2ecf20Sopenharmony_ci); 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_ref_to_ref, 1908c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t, struct binder_node *node, 1918c2ecf20Sopenharmony_ci struct binder_ref_data *src_ref, 1928c2ecf20Sopenharmony_ci struct binder_ref_data *dest_ref), 1938c2ecf20Sopenharmony_ci TP_ARGS(t, node, src_ref, dest_ref), 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci TP_STRUCT__entry( 1968c2ecf20Sopenharmony_ci __field(int, debug_id) 1978c2ecf20Sopenharmony_ci __field(int, node_debug_id) 1988c2ecf20Sopenharmony_ci __field(int, src_ref_debug_id) 1998c2ecf20Sopenharmony_ci __field(uint32_t, src_ref_desc) 2008c2ecf20Sopenharmony_ci __field(int, dest_ref_debug_id) 2018c2ecf20Sopenharmony_ci __field(uint32_t, dest_ref_desc) 2028c2ecf20Sopenharmony_ci ), 2038c2ecf20Sopenharmony_ci TP_fast_assign( 2048c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 2058c2ecf20Sopenharmony_ci __entry->node_debug_id = node->debug_id; 2068c2ecf20Sopenharmony_ci __entry->src_ref_debug_id = src_ref->debug_id; 2078c2ecf20Sopenharmony_ci __entry->src_ref_desc = src_ref->desc; 2088c2ecf20Sopenharmony_ci __entry->dest_ref_debug_id = dest_ref->debug_id; 2098c2ecf20Sopenharmony_ci __entry->dest_ref_desc = dest_ref->desc; 2108c2ecf20Sopenharmony_ci ), 2118c2ecf20Sopenharmony_ci TP_printk("transaction=%d node=%d src_ref=%d src_desc=%d ==> dest_ref=%d dest_desc=%d", 2128c2ecf20Sopenharmony_ci __entry->debug_id, __entry->node_debug_id, 2138c2ecf20Sopenharmony_ci __entry->src_ref_debug_id, __entry->src_ref_desc, 2148c2ecf20Sopenharmony_ci __entry->dest_ref_debug_id, __entry->dest_ref_desc) 2158c2ecf20Sopenharmony_ci); 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_fd_send, 2188c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t, int fd, size_t offset), 2198c2ecf20Sopenharmony_ci TP_ARGS(t, fd, offset), 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci TP_STRUCT__entry( 2228c2ecf20Sopenharmony_ci __field(int, debug_id) 2238c2ecf20Sopenharmony_ci __field(int, fd) 2248c2ecf20Sopenharmony_ci __field(size_t, offset) 2258c2ecf20Sopenharmony_ci ), 2268c2ecf20Sopenharmony_ci TP_fast_assign( 2278c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 2288c2ecf20Sopenharmony_ci __entry->fd = fd; 2298c2ecf20Sopenharmony_ci __entry->offset = offset; 2308c2ecf20Sopenharmony_ci ), 2318c2ecf20Sopenharmony_ci TP_printk("transaction=%d src_fd=%d offset=%zu", 2328c2ecf20Sopenharmony_ci __entry->debug_id, __entry->fd, __entry->offset) 2338c2ecf20Sopenharmony_ci); 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ciTRACE_EVENT(binder_transaction_fd_recv, 2368c2ecf20Sopenharmony_ci TP_PROTO(struct binder_transaction *t, int fd, size_t offset), 2378c2ecf20Sopenharmony_ci TP_ARGS(t, fd, offset), 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_ci TP_STRUCT__entry( 2408c2ecf20Sopenharmony_ci __field(int, debug_id) 2418c2ecf20Sopenharmony_ci __field(int, fd) 2428c2ecf20Sopenharmony_ci __field(size_t, offset) 2438c2ecf20Sopenharmony_ci ), 2448c2ecf20Sopenharmony_ci TP_fast_assign( 2458c2ecf20Sopenharmony_ci __entry->debug_id = t->debug_id; 2468c2ecf20Sopenharmony_ci __entry->fd = fd; 2478c2ecf20Sopenharmony_ci __entry->offset = offset; 2488c2ecf20Sopenharmony_ci ), 2498c2ecf20Sopenharmony_ci TP_printk("transaction=%d dest_fd=%d offset=%zu", 2508c2ecf20Sopenharmony_ci __entry->debug_id, __entry->fd, __entry->offset) 2518c2ecf20Sopenharmony_ci); 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_ciDECLARE_EVENT_CLASS(binder_buffer_class, 2548c2ecf20Sopenharmony_ci TP_PROTO(struct binder_buffer *buf), 2558c2ecf20Sopenharmony_ci TP_ARGS(buf), 2568c2ecf20Sopenharmony_ci TP_STRUCT__entry( 2578c2ecf20Sopenharmony_ci __field(int, debug_id) 2588c2ecf20Sopenharmony_ci __field(size_t, data_size) 2598c2ecf20Sopenharmony_ci __field(size_t, offsets_size) 2608c2ecf20Sopenharmony_ci __field(size_t, extra_buffers_size) 2618c2ecf20Sopenharmony_ci ), 2628c2ecf20Sopenharmony_ci TP_fast_assign( 2638c2ecf20Sopenharmony_ci __entry->debug_id = buf->debug_id; 2648c2ecf20Sopenharmony_ci __entry->data_size = buf->data_size; 2658c2ecf20Sopenharmony_ci __entry->offsets_size = buf->offsets_size; 2668c2ecf20Sopenharmony_ci __entry->extra_buffers_size = buf->extra_buffers_size; 2678c2ecf20Sopenharmony_ci ), 2688c2ecf20Sopenharmony_ci TP_printk("transaction=%d data_size=%zd offsets_size=%zd extra_buffers_size=%zd", 2698c2ecf20Sopenharmony_ci __entry->debug_id, __entry->data_size, __entry->offsets_size, 2708c2ecf20Sopenharmony_ci __entry->extra_buffers_size) 2718c2ecf20Sopenharmony_ci); 2728c2ecf20Sopenharmony_ci 2738c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_buffer_class, binder_transaction_alloc_buf, 2748c2ecf20Sopenharmony_ci TP_PROTO(struct binder_buffer *buffer), 2758c2ecf20Sopenharmony_ci TP_ARGS(buffer)); 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_buffer_class, binder_transaction_buffer_release, 2788c2ecf20Sopenharmony_ci TP_PROTO(struct binder_buffer *buffer), 2798c2ecf20Sopenharmony_ci TP_ARGS(buffer)); 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_buffer_class, binder_transaction_failed_buffer_release, 2828c2ecf20Sopenharmony_ci TP_PROTO(struct binder_buffer *buffer), 2838c2ecf20Sopenharmony_ci TP_ARGS(buffer)); 2848c2ecf20Sopenharmony_ci 2858c2ecf20Sopenharmony_ciTRACE_EVENT(binder_update_page_range, 2868c2ecf20Sopenharmony_ci TP_PROTO(struct binder_alloc *alloc, bool allocate, 2878c2ecf20Sopenharmony_ci void __user *start, void __user *end), 2888c2ecf20Sopenharmony_ci TP_ARGS(alloc, allocate, start, end), 2898c2ecf20Sopenharmony_ci TP_STRUCT__entry( 2908c2ecf20Sopenharmony_ci __field(int, proc) 2918c2ecf20Sopenharmony_ci __field(bool, allocate) 2928c2ecf20Sopenharmony_ci __field(size_t, offset) 2938c2ecf20Sopenharmony_ci __field(size_t, size) 2948c2ecf20Sopenharmony_ci ), 2958c2ecf20Sopenharmony_ci TP_fast_assign( 2968c2ecf20Sopenharmony_ci __entry->proc = alloc->pid; 2978c2ecf20Sopenharmony_ci __entry->allocate = allocate; 2988c2ecf20Sopenharmony_ci __entry->offset = start - alloc->buffer; 2998c2ecf20Sopenharmony_ci __entry->size = end - start; 3008c2ecf20Sopenharmony_ci ), 3018c2ecf20Sopenharmony_ci TP_printk("proc=%d allocate=%d offset=%zu size=%zu", 3028c2ecf20Sopenharmony_ci __entry->proc, __entry->allocate, 3038c2ecf20Sopenharmony_ci __entry->offset, __entry->size) 3048c2ecf20Sopenharmony_ci); 3058c2ecf20Sopenharmony_ci 3068c2ecf20Sopenharmony_ciDECLARE_EVENT_CLASS(binder_lru_page_class, 3078c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3088c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index), 3098c2ecf20Sopenharmony_ci TP_STRUCT__entry( 3108c2ecf20Sopenharmony_ci __field(int, proc) 3118c2ecf20Sopenharmony_ci __field(size_t, page_index) 3128c2ecf20Sopenharmony_ci ), 3138c2ecf20Sopenharmony_ci TP_fast_assign( 3148c2ecf20Sopenharmony_ci __entry->proc = alloc->pid; 3158c2ecf20Sopenharmony_ci __entry->page_index = page_index; 3168c2ecf20Sopenharmony_ci ), 3178c2ecf20Sopenharmony_ci TP_printk("proc=%d page_index=%zu", 3188c2ecf20Sopenharmony_ci __entry->proc, __entry->page_index) 3198c2ecf20Sopenharmony_ci); 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_alloc_lru_start, 3228c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3238c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_alloc_lru_end, 3268c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3278c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_free_lru_start, 3308c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3318c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3328c2ecf20Sopenharmony_ci 3338c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_free_lru_end, 3348c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3358c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3368c2ecf20Sopenharmony_ci 3378c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_alloc_page_start, 3388c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3398c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_alloc_page_end, 3428c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3438c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3448c2ecf20Sopenharmony_ci 3458c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_unmap_user_start, 3468c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3478c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_unmap_user_end, 3508c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3518c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_unmap_kernel_start, 3548c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3558c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3568c2ecf20Sopenharmony_ci 3578c2ecf20Sopenharmony_ciDEFINE_EVENT(binder_lru_page_class, binder_unmap_kernel_end, 3588c2ecf20Sopenharmony_ci TP_PROTO(const struct binder_alloc *alloc, size_t page_index), 3598c2ecf20Sopenharmony_ci TP_ARGS(alloc, page_index)); 3608c2ecf20Sopenharmony_ci 3618c2ecf20Sopenharmony_ciTRACE_EVENT(binder_command, 3628c2ecf20Sopenharmony_ci TP_PROTO(uint32_t cmd), 3638c2ecf20Sopenharmony_ci TP_ARGS(cmd), 3648c2ecf20Sopenharmony_ci TP_STRUCT__entry( 3658c2ecf20Sopenharmony_ci __field(uint32_t, cmd) 3668c2ecf20Sopenharmony_ci ), 3678c2ecf20Sopenharmony_ci TP_fast_assign( 3688c2ecf20Sopenharmony_ci __entry->cmd = cmd; 3698c2ecf20Sopenharmony_ci ), 3708c2ecf20Sopenharmony_ci TP_printk("cmd=0x%x %s", 3718c2ecf20Sopenharmony_ci __entry->cmd, 3728c2ecf20Sopenharmony_ci _IOC_NR(__entry->cmd) < ARRAY_SIZE(binder_command_strings) ? 3738c2ecf20Sopenharmony_ci binder_command_strings[_IOC_NR(__entry->cmd)] : 3748c2ecf20Sopenharmony_ci "unknown") 3758c2ecf20Sopenharmony_ci); 3768c2ecf20Sopenharmony_ci 3778c2ecf20Sopenharmony_ciTRACE_EVENT(binder_return, 3788c2ecf20Sopenharmony_ci TP_PROTO(uint32_t cmd), 3798c2ecf20Sopenharmony_ci TP_ARGS(cmd), 3808c2ecf20Sopenharmony_ci TP_STRUCT__entry( 3818c2ecf20Sopenharmony_ci __field(uint32_t, cmd) 3828c2ecf20Sopenharmony_ci ), 3838c2ecf20Sopenharmony_ci TP_fast_assign( 3848c2ecf20Sopenharmony_ci __entry->cmd = cmd; 3858c2ecf20Sopenharmony_ci ), 3868c2ecf20Sopenharmony_ci TP_printk("cmd=0x%x %s", 3878c2ecf20Sopenharmony_ci __entry->cmd, 3888c2ecf20Sopenharmony_ci _IOC_NR(__entry->cmd) < ARRAY_SIZE(binder_return_strings) ? 3898c2ecf20Sopenharmony_ci binder_return_strings[_IOC_NR(__entry->cmd)] : 3908c2ecf20Sopenharmony_ci "unknown") 3918c2ecf20Sopenharmony_ci); 3928c2ecf20Sopenharmony_ci 3938c2ecf20Sopenharmony_ci#endif /* _BINDER_TRACE_H */ 3948c2ecf20Sopenharmony_ci 3958c2ecf20Sopenharmony_ci#undef TRACE_INCLUDE_PATH 3968c2ecf20Sopenharmony_ci#undef TRACE_INCLUDE_FILE 3978c2ecf20Sopenharmony_ci#define TRACE_INCLUDE_PATH . 3988c2ecf20Sopenharmony_ci#define TRACE_INCLUDE_FILE binder_trace 3998c2ecf20Sopenharmony_ci#include <trace/define_trace.h> 400