1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18 19package perfetto.protos; 20 21// This metric provides the following: 22// 1. Per-process Binder statistics for traces with binder_driver enabled. 23// Specifically, transactions are categorized and counted 24// 2. Unaggregated binder txn durations with per-txn aggregated thread state and 25// blocked function 26// durations 27message AndroidBinderMetric { 28 message PerProcessBreakdown { 29 optional string process_name = 1; 30 optional uint32 pid = 2; 31 optional string slice_name = 3; 32 optional uint32 count = 4; 33 } 34 35 message UnaggregatedTxnBreakdown { 36 // General 37 optional string aidl_name = 1; 38 // Client 39 // Removed: was binder_txn_id 40 reserved 2; 41 optional string client_process = 3; 42 optional string client_thread = 4; 43 optional bool is_main_thread = 5; 44 optional int64 client_ts = 6; 45 optional int64 client_dur = 7; 46 // Server 47 // Removed: was binder_reply_id 48 reserved 8; 49 optional string server_process = 9; 50 optional string server_thread = 10; 51 optional int64 server_ts = 11; 52 optional int64 server_dur = 12; 53 // Aggregations 54 repeated ThreadStateBreakdown thread_states = 13; 55 repeated BlockedFunctionBreakdown blocked_functions = 14; 56 57 optional uint32 client_tid = 15; 58 optional uint32 server_tid = 16; 59 60 optional uint32 client_pid = 17; 61 optional uint32 server_pid = 18; 62 } 63 64 message ThreadStateBreakdown { 65 optional string thread_state_type = 1; 66 optional string thread_state = 2; 67 optional int64 thread_state_dur = 3; 68 optional int64 thread_state_count = 4; 69 } 70 71 message BlockedFunctionBreakdown { 72 optional string thread_state_type = 1; 73 optional string blocked_function = 2; 74 optional int64 blocked_function_dur = 3; 75 optional int64 blocked_function_count = 4; 76 } 77 78 repeated PerProcessBreakdown process_breakdown = 1; 79 repeated UnaggregatedTxnBreakdown unaggregated_txn_breakdown = 2; 80} 81