1/* 2 * Copyright (C) 2021 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 20import "protos/perfetto/common/android_energy_consumer_descriptor.proto"; 21 22// Energy data retrieve using the ODPM(On Device Power Monitor) API. 23// This proto represents the aidl class: 24// android.hardware.power.stats.EnergyConsumerResult. 25message AndroidEnergyEstimationBreakdown { 26 // The first trace packet of each session should include a energy consumer 27 // descriptor. 28 optional AndroidEnergyConsumerDescriptor energy_consumer_descriptor = 1; 29 30 // ID of the AndroidEnergyConsumer associated with this result. Matches 31 // the energy_consumer_id in the AndroidEnergyConsumerDescriptor that 32 // should be sent at the beginning of a trace. 33 optional int32 energy_consumer_id = 2; 34 35 // Total accumulated energy since boot in microwatt-seconds (uWs) 36 optional int64 energy_uws = 3; 37 38 message EnergyUidBreakdown { 39 // Android ID/Linux UID, the accumulated energy is attributed to. 40 optional int32 uid = 1; 41 42 // Accumulated energy since boot in microwatt-seconds (uWs). 43 optional int64 energy_uws = 2; 44 } 45 // Optional attributed energy per Android ID / Linux UID for this 46 // EnergyConsumer. Sum total of attributed energy must be less than or equal 47 // to total accumulated energy. 48 repeated EnergyUidBreakdown per_uid_breakdown = 4; 49} 50