1/* 2 * Copyright (C) 2023 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"; 18package perfetto.protos; 19 20message EntityStateResidency { 21 message PowerEntityState { 22 // Index corresponding to the entity 23 optional int32 entity_index = 1; 24 25 // Index corresponding to the state 26 optional int32 state_index = 2; 27 28 // Name of the entity. This is device-specific, determined by the PowerStats 29 // HAL, and cannot be configured by the user. An example would be 30 // "Bluetooth". 31 optional string entity_name = 3; 32 33 // Name of the state. This is device-specific, determined by the PowerStats 34 // HAL, and cannot be configured by the user. An example would be 35 // "Active". 36 optional string state_name = 4; 37 } 38 39 // This is only emitted at the beginning of the trace. 40 repeated PowerEntityState power_entity_state = 1; 41 42 message StateResidency { 43 // Index corresponding to PowerEntityState.entity_index 44 optional int32 entity_index = 1; 45 46 // Index corresponding to PowerEntityState.state_index 47 optional int32 state_index = 2; 48 49 // Time since boot that this entity has been in this state 50 optional uint64 total_time_in_state_ms = 3; 51 52 // Total number of times since boot that the entity has entered this state 53 optional uint64 total_state_entry_count = 4; 54 55 // Timestamp of the last time the entity entered this state 56 optional uint64 last_entry_timestamp_ms = 5; 57 } 58 59 repeated StateResidency residency = 2; 60} 61