1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
|
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
syntax = "proto2";
package com.android.server.powerstats;
option java_multiple_files = true;
/**
* IncidentReportMeterProto is used only in the parsing tool located
* in frameworks/base/tools which is used to parse this data out of
* incident reports.
*/
message IncidentReportMeterProto {
/** Section number matches that in incident.proto */
optional PowerStatsServiceMeterProto incident_report = 3054;
}
/**
* IncidentReportModelProto is used only in the parsing tool located
* in frameworks/base/tools which is used to parse this data out of
* incident reports.
*/
message IncidentReportModelProto {
/** Section number matches that in incident.proto */
optional PowerStatsServiceModelProto incident_report = 3055;
}
/**
* IncidentReportResidencyProto is used only in the parsing tool located
* in frameworks/base/tools which is used to parse this data out of
* incident reports.
*/
message IncidentReportResidencyProto {
/** Section number matches that in incident.proto */
optional PowerStatsServiceResidencyProto incident_report = 3056;
}
/**
* EnergyConsumer (model) data is exposed by the PowerStats HAL. This data
* represents modeled energy consumption estimates and is provided per
* subsystem. The default subsystems are defined in EnergyConsumerType.aidl.
* Energy model estimates will be logged to incident reports in addition to
* the raw energy meter data.
*/
message PowerStatsServiceModelProto {
repeated EnergyConsumerProto energy_consumer = 1;
repeated EnergyConsumerResultProto energy_consumer_result = 2;
}
/**
* EnergyMeasurement (meter) data is exposed by the PowerStats HAL. This data
* represents measurements taken directly from on-device energy meters.
* This raw energy meter data will be logged to incident reports.
*/
message PowerStatsServiceMeterProto {
repeated ChannelProto channel = 1;
repeated EnergyMeasurementProto energy_measurement = 2;
}
/**
* A PowerEntity is defined as a platform subsystem, peripheral, or power domain
* that impacts the total device power consumption. PowerEntity is
* information related to each power entity. Each PowerEntity may reside in one
* of multiple states. It may also transition from one state to another.
* StateResidency is defined as an accumulation of time that a PowerEntity
* resided in each of its possible states, the number of times that each state
* was entered, and a timestamp corresponding to the last time that state was
* entered.
*/
message PowerStatsServiceResidencyProto {
repeated PowerEntityProto power_entity = 1;
repeated StateResidencyResultProto state_residency_result = 2;
}
/**
* Information about the possible states for a particular PowerEntity.
*/
message StateProto {
/**
* Unique (for a given PowerEntity) ID of this State
*/
optional int32 id = 1;
/**
* Unique (for a given PowerEntity) name of the state. Vendor/device specific.
* Opaque to framework
*/
optional string name = 2;
}
/**
* A PowerEntity is defined as a platform subsystem, peripheral, or power domain
* that impacts the total device power consumption. PowerEntity is
* information about a PowerEntity. It includes an array of information about
* each possible state of the PowerEntity.
*/
message PowerEntityProto {
/**
* Unique ID of this PowerEntity
*/
optional int32 id = 1;
/**
* Unique name of the PowerEntity. Vendor/device specific. Opaque to framework
*/
optional string name = 2;
/**
* List of states that the PowerEntity may reside in
*/
repeated StateProto states = 3;
}
/**
* StateResidency is defined as an accumulation of time that a PowerEntity
* resided in each of its possible states, the number of times that each state
* was entered, and a timestamp corresponding to the last time that state was
* entered. Data is accumulated starting at device boot.
*/
message StateResidencyProto {
/**
* ID of the state associated with this residency
*/
optional int32 id = 1;
/**
* Total time in milliseconds that the corresponding PowerEntity resided
* in this state since boot
*/
optional int64 total_time_in_state_ms = 2;
/**
* Total number of times that the state was entered since boot
*/
optional int64 total_state_entry_count = 3;
/**
* Last time this state was entered. Walltime in milliseconds since Unix epoch.
*/
optional int64 last_entry_timestamp_ms = 4;
}
/**
* A StateResidencyResult is an array of StateResidencies for a particular
* PowerEntity. The StateResidencyResult can be matched to its corresponding
* PowerEntity through the id field.
*/
message StateResidencyResultProto {
/**
* ID of the PowerEntity associated with this result
*/
optional int32 id = 1;
/**
* Residency for each state in the PowerEntity's state space
*/
repeated StateResidencyProto state_residency_data = 2;
}
/**
* Energy consumer:
* A list of default subsystems for which energy consumption estimates
* may be provided (hardware dependent).
*/
message EnergyConsumerProto {
/** Unique ID of this EnergyConsumer */
optional int32 id = 1;
/**
* For a group of EnergyConsumers of the same logical type, sorting by
* ordinal should be give their physical order. No other meaning is
* carried by it.
*/
optional int32 ordinal = 2;
/** Type of this EnergyConsumer */
optional int32 type = 3;
/**
* Unique name of this EnergyConsumer. Vendor/device specific. Opaque
* to framework
*/
optional string name = 4;
}
message EnergyConsumerAttributionProto {
/** Android ID / Linux UID, the accumulated energy should be attributed to. */
optional int32 uid = 1;
/** Accumulated energy since boot in microwatt-seconds (uWs) for this AID. */
optional int64 energy_uws = 2;
}
/**
* Energy consumer result:
* An estimate of energy consumption since boot for the subsystem identified
* by the unique id.
*/
message EnergyConsumerResultProto {
/** Unique index identifying the energy consumer. */
optional int32 id = 1;
/** Walltime in milliseconds since Unix epoch */
optional int64 timestamp_ms = 2;
/** Accumulated energy since device boot in microwatt-seconds (uWs) */
optional int64 energy_uws = 3;
/** Optional attribution per UID for this EnergyConsumer. */
repeated EnergyConsumerAttributionProto attribution = 4;
}
/**
* Channel information:
* Reports information related to the energy meter channels being monitored.
*/
message ChannelProto {
/**
* Index corresponding to the energy meter channel. This index matches
* the index returned in Channel.
*/
optional int32 id = 1;
/** Name of the energy meter channel */
optional string name = 2;
/** Name of the subsystem associated with this Channel. Opaque to framework */
optional string subsystem = 3;
}
/**
* Energy measurements:
* Reports accumulated energy since boot for each energy meter.
*/
message EnergyMeasurementProto {
/**
* Index corresponding to the energy meter channel. This index matches
* the index returned in Channel.
*/
optional int32 id = 1;
/** Walltime in milliseconds since Unix epoch */
optional int64 timestamp_ms = 2;
/** Accumulated energy since device boot in microwatt-seconds (uWs) */
optional int64 energy_uws = 3;
/** Duration in milliseconds that energy has been accumulated */
optional int64 duration_ms = 4;
}
|