Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
| 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 19 | // TODO: Not the right package and class name |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 21 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 22 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 23 | |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 24 | import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 30 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 31 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 32 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 33 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 34 | * raw stats log events from the Android system, also known as "atoms." |
| 35 | * |
| 36 | * This field contains a single oneof with all of the available messages. |
| 37 | * The stats-log-api-gen tool runs as part of the Android build and |
| 38 | * generates the android.util.StatsLog class, which contains the constants |
| 39 | * and methods that Android uses to log. |
| 40 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 41 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 42 | * Instead, statsd on Android constructs these messages synthetically, |
| 43 | * in the format defined here and in stats_log.proto. |
| 44 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 45 | message Atom { |
| 46 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 47 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 48 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 49 | BleScanStateChanged ble_scan_state_changed = 2; |
| 50 | BleUnoptimizedScanStateChanged ble_unoptimized_scan_state_changed = 3; |
| 51 | BleScanResultReceived ble_scan_result_received = 4; |
| 52 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 53 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 54 | SyncStateChanged sync_state_changed = 7; |
| 55 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 56 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 57 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 58 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 59 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 60 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
| 61 | // TODO: 14-19 are blank, but need not be |
| 62 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 63 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 64 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 65 | AudioStateChanged audio_state_changed = 23; |
| 66 | MediaCodecActivityChanged media_codec_activity_changed = 24; |
| 67 | CameraStateChanged camera_state_changed = 25; |
| 68 | FlashlightStateChanged flashlight_state_changed = 26; |
| 69 | UidProcessStateChanged uid_process_state_changed = 27; |
| 70 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 71 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 72 | BatteryLevelChanged battery_level_changed = 30; |
| 73 | ChargingStateChanged charging_state_changed = 31; |
| 74 | PluggedStateChanged plugged_state_changed = 32; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 75 | // TODO: 33 is blank, but is available for use. |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 76 | DeviceOnStatusChanged device_on_status_changed = 34; |
| 77 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 78 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 79 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 80 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 81 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 82 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 83 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 84 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 85 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 86 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 87 | DropboxErrorChanged dropbox_error_changed = 45; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 88 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 89 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 90 | AppStartChanged app_start_changed = 48; |
| 91 | AppStartCancelChanged app_start_cancel_changed = 49; |
| 92 | AppStartFullyDrawnChanged app_start_fully_drawn_changed = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 93 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 94 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 95 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 96 | LmkStateChanged lmk_state_changed = 54; |
| 97 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 98 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 99 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 100 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 101 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 102 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 103 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 104 | KeyguardStateChanged keyguard_state_changed = 62; |
| 105 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 106 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 107 | AppDied app_died=65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 108 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 109 | // TODO: Reorder the numbering so that the most frequent occur events occur in the first 15. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 110 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 111 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 112 | // Pulled events will start at field 10000. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 113 | // Next: 10022 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 114 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 115 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 116 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 117 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 118 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 119 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 120 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 121 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 122 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 123 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 124 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
| 125 | WifiActivityEnergyInfo wifi_activity_energy_info = 10011; |
| 126 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 127 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 128 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 129 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 130 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 131 | CpuActiveTime cpu_active_time = 10016; |
| 132 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 133 | DiskSpace disk_space = 10018; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 134 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 135 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 136 | Temperature temperature = 10021; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 137 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 138 | |
| 139 | // DO NOT USE field numbers above 100,000 in AOSP. Field numbers above |
| 140 | // 100,000 are reserved for non-AOSP (e.g. OEMs) to use. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 141 | } |
| 142 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 143 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 144 | * This proto represents a node of an attribution chain. |
| 145 | * Note: All attribution chains are represented as a repeated field of type |
| 146 | * AttributionNode. It is understood that in such arrays, the order is that |
| 147 | * of calls, that is [A, B, C] if A calls B that calls C. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 148 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 149 | message AttributionNode { |
| 150 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 151 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 152 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 153 | // The (optional) string tag for an element in the attribution chain. If the |
| 154 | // element has no tag, it is encoded as an empty string. |
| 155 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 156 | } |
| 157 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 158 | /* |
| 159 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 160 | * Below are all of the individual atoms that are logged by Android via statsd. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 161 | * |
| 162 | * RULES: |
| 163 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 164 | * Skipping field ids is not allowed. |
| 165 | * - These form an API, so renaming, renumbering or removing fields is |
| 166 | * not allowed between android releases. (This is not currently enforced, |
| 167 | * but there will be a tool to enforce this restriction). |
| 168 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 169 | * are allowed (yet). The bytes type is also not allowed. |
| 170 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 171 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 172 | * - If an atom represents work that can be attributed to an app, there can |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 173 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 174 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 175 | * annotation. The generated code on android will be represented by UIDs, |
| 176 | * and those UIDs will be translated in xxx to those strings. |
| 177 | * |
| 178 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 179 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 180 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 181 | * ***************************************************************************** |
| 182 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 183 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 184 | /** |
| 185 | * Logs when the screen state changes. |
| 186 | * |
| 187 | * Logged from: |
| 188 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 189 | */ |
| 190 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 191 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 192 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 193 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 194 | |
| 195 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 196 | * Logs that the state of a process state, as per the activity manager, has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 197 | * |
| 198 | * Logged from: |
| 199 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 200 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 201 | message UidProcessStateChanged { |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 202 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 203 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 204 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 205 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 209 | * Logs that a process started, finished, crashed, or ANRed. |
| 210 | * |
| 211 | * Logged from: |
| 212 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 213 | */ |
| 214 | message ProcessLifeCycleStateChanged { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 215 | // TODO: should be a string tagged w/ uid annotation |
| 216 | optional int32 uid = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 217 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 218 | // The process name (usually same as the app name). |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 219 | optional string name = 2; |
| 220 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 221 | // What lifecycle state the process changed to. |
| 222 | // This enum is specific to atoms.proto. |
| 223 | enum Event { |
| 224 | PROCESS_FINISHED = 0; |
| 225 | PROCESS_STARTED = 1; |
| 226 | PROCESS_CRASHED = 2; |
| 227 | PROCESS_ANRED = 3; |
| 228 | } |
| 229 | optional Event event = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 230 | } |
| 231 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 232 | /** |
| 233 | * Logs when the ble scan state changes. |
| 234 | * |
| 235 | * Logged from: |
| 236 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 237 | */ |
| 238 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 239 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 240 | |
| 241 | enum State { |
| 242 | OFF = 0; |
| 243 | ON = 1; |
| 244 | } |
| 245 | optional State state = 2; |
| 246 | } |
| 247 | |
| 248 | /** |
| 249 | * Logs when an unoptimized ble scan state changes. |
| 250 | * |
| 251 | * Logged from: |
| 252 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 253 | */ |
| 254 | // TODO: Consider changing to tracking per-scanner-id (log from AppScanStats). |
| 255 | message BleUnoptimizedScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 256 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 257 | |
| 258 | enum State { |
| 259 | OFF = 0; |
| 260 | ON = 1; |
| 261 | } |
| 262 | optional State state = 2; |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Logs reporting of a ble scan finding results. |
| 267 | * |
| 268 | * Logged from: |
| 269 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 270 | */ |
| 271 | // TODO: Consider changing to tracking per-scanner-id (log from AppScanStats). |
| 272 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 273 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 274 | |
| 275 | // Number of ble scan results returned. |
| 276 | optional int32 num_of_results = 2; |
| 277 | } |
| 278 | |
| 279 | /** |
| 280 | * Logs when a sensor state changes. |
| 281 | * |
| 282 | * Logged from: |
| 283 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 284 | */ |
| 285 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 286 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 287 | |
| 288 | // TODO: Is there a way to get the actual name of the sensor? |
| 289 | // The id (int) of the sensor. |
| 290 | optional int32 sensor_id = 2; |
| 291 | |
| 292 | enum State { |
| 293 | OFF = 0; |
| 294 | ON = 1; |
| 295 | } |
| 296 | optional State state = 3; |
| 297 | } |
| 298 | |
| 299 | |
| 300 | /** |
| 301 | * Logs when GPS state changes. |
| 302 | * |
| 303 | * Logged from: |
| 304 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 305 | */ |
| 306 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 307 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 308 | |
| 309 | enum State { |
| 310 | OFF = 0; |
| 311 | ON = 1; |
| 312 | } |
| 313 | optional State state = 2; |
| 314 | } |
| 315 | |
| 316 | |
| 317 | /** |
| 318 | * Logs when a sync manager sync state changes. |
| 319 | * |
| 320 | * Logged from: |
| 321 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 322 | */ |
| 323 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 324 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 325 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 326 | // Name of the sync (as named in the app). Can be chosen at run-time. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 327 | optional string name = 2; |
| 328 | |
| 329 | enum State { |
| 330 | OFF = 0; |
| 331 | ON = 1; |
| 332 | } |
| 333 | optional State state = 3; |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Logs when a job scheduler job state changes. |
| 338 | * |
| 339 | * Logged from: |
| 340 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 341 | */ |
| 342 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 343 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 344 | |
| 345 | // Name of the job (as named in the app) |
| 346 | optional string name = 2; |
| 347 | |
| 348 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 349 | FINISHED = 0; |
| 350 | STARTED = 1; |
| 351 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 352 | } |
| 353 | optional State state = 3; |
| 354 | |
| 355 | // TODO: Consider adding the stopReason (int) |
| 356 | } |
| 357 | |
| 358 | /** |
| 359 | * Logs when the audio state changes. |
| 360 | * |
| 361 | * Logged from: |
| 362 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 363 | */ |
| 364 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 365 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 366 | |
| 367 | enum State { |
| 368 | OFF = 0; |
| 369 | ON = 1; |
| 370 | } |
| 371 | optional State state = 2; |
| 372 | } |
| 373 | |
| 374 | /** |
| 375 | * Logs when the video codec state changes. |
| 376 | * |
| 377 | * Logged from: |
| 378 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 379 | */ |
| 380 | message MediaCodecActivityChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 381 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 382 | |
| 383 | enum State { |
| 384 | OFF = 0; |
| 385 | ON = 1; |
| 386 | } |
| 387 | optional State state = 2; |
| 388 | } |
| 389 | |
| 390 | /** |
| 391 | * Logs when the flashlight state changes. |
| 392 | * |
| 393 | * Logged from: |
| 394 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 395 | */ |
| 396 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 397 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 398 | |
| 399 | enum State { |
| 400 | OFF = 0; |
| 401 | ON = 1; |
| 402 | } |
| 403 | optional State state = 2; |
| 404 | } |
| 405 | |
| 406 | /** |
| 407 | * Logs when the camera state changes. |
| 408 | * |
| 409 | * Logged from: |
| 410 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 411 | */ |
| 412 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 413 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 414 | |
| 415 | enum State { |
| 416 | OFF = 0; |
| 417 | ON = 1; |
| 418 | } |
| 419 | optional State state = 2; |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Logs that the state of a wakelock (per app and per wakelock name) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 424 | * |
| 425 | * Logged from: |
| 426 | * TODO |
| 427 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 428 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 429 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 430 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 431 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 432 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 433 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 434 | |
| 435 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 436 | optional string tag = 3; |
| 437 | |
| 438 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 439 | RELEASE = 0; |
| 440 | ACQUIRE = 1; |
| 441 | CHANGE_RELEASE = 2; |
| 442 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 443 | } |
| 444 | optional State state = 4; |
| 445 | } |
| 446 | |
| 447 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 448 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 449 | * |
| 450 | * Logged from: |
| 451 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 452 | */ |
| 453 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 454 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 455 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 456 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 457 | optional string tag = 2; |
| 458 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 459 | // TODO: I have no idea what this is. |
| 460 | optional string history_tag = 3; |
| 461 | |
| 462 | enum State { |
| 463 | OFF = 0; |
| 464 | ON = 1; |
| 465 | } |
| 466 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 467 | } |
| 468 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 469 | /** |
| 470 | * Logs Battery Saver state change. |
| 471 | * |
| 472 | * Logged from: |
| 473 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 474 | */ |
| 475 | message BatterySaverModeStateChanged { |
| 476 | enum State { |
| 477 | OFF = 0; |
| 478 | ON = 1; |
| 479 | } |
| 480 | optional State state = 1; |
| 481 | } |
| 482 | |
| 483 | /** |
| 484 | * Logs Doze mode state change. |
| 485 | * |
| 486 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 487 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 488 | */ |
| 489 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 490 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 491 | } |
| 492 | |
| 493 | |
| 494 | /** |
| 495 | * Logs state change of Doze mode including maintenance windows. |
| 496 | * |
| 497 | * Logged from: |
| 498 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 499 | */ |
| 500 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 501 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | /** |
| 505 | * Logs screen brightness level. |
| 506 | * |
| 507 | * Logged from: |
| 508 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 509 | */ |
| 510 | message ScreenBrightnessChanged { |
| 511 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 512 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 513 | } |
| 514 | |
| 515 | /** |
| 516 | * Logs battery level (percent full, from 0 to 100). |
| 517 | * |
| 518 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 519 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 520 | */ |
| 521 | message BatteryLevelChanged { |
| 522 | // Battery level. Should be in [0, 100]. |
| 523 | optional int32 battery_level = 1; |
| 524 | } |
| 525 | |
| 526 | /** |
| 527 | * Logs change in charging status of the device. |
| 528 | * |
| 529 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 530 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 531 | */ |
| 532 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 533 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 534 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 535 | } |
| 536 | |
| 537 | /** |
| 538 | * Logs whether the device is plugged in, and what power source it is using. |
| 539 | * |
| 540 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 541 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 542 | */ |
| 543 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 544 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 545 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 546 | } |
| 547 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 548 | // TODO: Define this more precisely. |
| 549 | // TODO: Log the ON state somewhere. It isn't currently logged anywhere. |
| 550 | /** |
| 551 | * Logs when the device turns off or on. |
| 552 | * |
| 553 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 554 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 555 | */ |
| 556 | message DeviceOnStatusChanged { |
| 557 | enum State { |
| 558 | OFF = 0; |
| 559 | ON = 1; |
| 560 | } |
| 561 | optional State state = 1; |
| 562 | } |
| 563 | |
| 564 | /** |
| 565 | * Logs when an app's wakeup alarm fires. |
| 566 | * |
| 567 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 568 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 569 | */ |
| 570 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 571 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 572 | |
| 573 | // Name of the wakeup alarm. |
| 574 | optional string tag = 2; |
| 575 | } |
| 576 | |
| 577 | /** |
| 578 | * Logs when an an app causes the mobile radio to change state. |
| 579 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 580 | * |
| 581 | * Logged from: |
| 582 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 583 | */ |
| 584 | message MobileRadioPowerStateChanged { |
| 585 | // TODO: Add attribution instead of uid? |
| 586 | optional int32 uid = 1; |
| 587 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 588 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 589 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 590 | } |
| 591 | |
| 592 | /** |
| 593 | * Logs when an an app causes the wifi radio to change state. |
| 594 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 595 | * |
| 596 | * Logged from: |
| 597 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 598 | */ |
| 599 | message WifiRadioPowerStateChanged { |
| 600 | // TODO: Add attribution instead of uid? |
| 601 | optional int32 uid = 1; |
| 602 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 603 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 604 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 605 | } |
| 606 | |
| 607 | /** |
| 608 | * Logs kernel wakeup reasons and aborts. |
| 609 | * |
| 610 | * Logged from: |
| 611 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 612 | */ |
| 613 | message KernelWakeupReported { |
| 614 | // Name of the kernel wakeup reason (or abort). |
| 615 | optional string wakeup_reason_name = 1; |
| 616 | |
| 617 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 618 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | /** |
| 622 | * Logs wifi locks held by an app. |
| 623 | * |
| 624 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 625 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 626 | */ |
| 627 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 628 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 629 | |
| 630 | enum State { |
| 631 | OFF = 0; |
| 632 | ON = 1; |
| 633 | } |
| 634 | optional State state = 2; |
| 635 | } |
| 636 | |
| 637 | /** |
| 638 | * Logs wifi signal strength changes. |
| 639 | * |
| 640 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 641 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 642 | */ |
| 643 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 644 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 645 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 646 | } |
| 647 | |
| 648 | /** |
| 649 | * Logs wifi scans performed by an app. |
| 650 | * |
| 651 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 652 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 653 | */ |
| 654 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 655 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 656 | |
| 657 | enum State { |
| 658 | OFF = 0; |
| 659 | ON = 1; |
| 660 | } |
| 661 | optional State state = 2; |
| 662 | } |
| 663 | |
| 664 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 665 | * Logs wifi multicast locks held by an app |
| 666 | * |
| 667 | * Logged from: |
| 668 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 669 | */ |
| 670 | message WifiMulticastLockStateChanged { |
| 671 | repeated AttributionNode attribution_node = 1; |
| 672 | |
| 673 | enum State { |
| 674 | OFF = 0; |
| 675 | ON = 1; |
| 676 | } |
| 677 | optional State state = 2; |
| 678 | } |
| 679 | |
| 680 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 681 | * Logs shutdown reason and duration on next boot. |
| 682 | * |
| 683 | * Logged from: |
| 684 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 685 | */ |
| 686 | message ShutdownSequenceReported { |
| 687 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 688 | optional bool reboot = 1; |
| 689 | |
| 690 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 691 | optional string reason = 2; |
| 692 | |
| 693 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 694 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 695 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 696 | |
| 697 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 698 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 699 | } |
| 700 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 701 | |
| 702 | /** |
| 703 | * Logs boot reason and duration. |
| 704 | * |
| 705 | * Logged from: |
| 706 | * system/core/bootstat/bootstat.cpp |
| 707 | */ |
| 708 | message BootSequenceReported { |
| 709 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 710 | // Default: "<EMPTY>" if not available. |
| 711 | optional string bootloader_reason = 1; |
| 712 | |
| 713 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 714 | // Default: "<EMPTY>" if not available. |
| 715 | optional string system_reason = 2; |
| 716 | |
| 717 | // End of boot time in ms from unix epoch using system wall clock. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 718 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 719 | |
| 720 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 721 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 722 | |
| 723 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 724 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 725 | |
| 726 | // Time since last boot in ms. Default: 0 if not available. |
| 727 | optional int64 time_since_last_boot = 6; |
| 728 | } |
| 729 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 730 | |
| 731 | /** |
| 732 | * Logs call state and disconnect cause (if applicable). |
| 733 | * |
| 734 | * Logged from: |
| 735 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 736 | */ |
| 737 | message CallStateChanged { |
| 738 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 739 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 740 | optional android.telecom.CallStateEnum call_state = 1; |
| 741 | |
| 742 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 743 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 744 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 745 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 746 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 747 | |
| 748 | // True if the call is self-managed, which are apps that use the |
| 749 | // telecom infrastructure to make their own calls. |
| 750 | optional bool self_managed = 3; |
| 751 | |
| 752 | // True if call is external. External calls are calls on connected Wear |
| 753 | // devices but show up in Telecom so the user can pull them onto the device. |
| 754 | optional bool external_call = 4; |
| 755 | } |
| 756 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 757 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 758 | * Logs keyguard state. The keyguard is the lock screen. |
| 759 | * |
| 760 | * Logged from: |
| 761 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 762 | */ |
| 763 | message KeyguardStateChanged { |
| 764 | enum State { |
| 765 | UNKNOWN = 0; |
| 766 | // The keyguard is hidden when the phone is unlocked. |
| 767 | HIDDEN = 1; |
| 768 | // The keyguard is shown when the phone is locked (screen turns off). |
| 769 | SHOWN= 2; |
| 770 | // The keyguard is occluded when something is overlaying the keyguard. |
| 771 | // Eg. Opening the camera while on the lock screen. |
| 772 | OCCLUDED = 3; |
| 773 | } |
| 774 | optional State state = 1; |
| 775 | } |
| 776 | |
| 777 | /** |
| 778 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 779 | * prompts the user to enter a password (pattern, pin, etc). |
| 780 | * |
| 781 | * Logged from: |
| 782 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 783 | */ |
| 784 | |
| 785 | message KeyguardBouncerStateChanged { |
| 786 | enum State { |
| 787 | UNKNOWN = 0; |
| 788 | // Bouncer is hidden, either as a result of successfully entering the |
| 789 | // password, screen timing out, or user going back to lock screen. |
| 790 | HIDDEN = 1; |
| 791 | // This is when the user is being prompted to enter the password. |
| 792 | SHOWN = 2; |
| 793 | } |
| 794 | optional State state = 1; |
| 795 | } |
| 796 | |
| 797 | /** |
| 798 | * Logs the result of entering a password into the keyguard bouncer. |
| 799 | * |
| 800 | * Logged from: |
| 801 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 802 | */ |
| 803 | message KeyguardBouncerPasswordEntered { |
| 804 | enum BouncerResult { |
| 805 | UNKNOWN = 0; |
| 806 | // The password entered was incorrect. |
| 807 | FAILURE = 1; |
| 808 | // The password entered was correct. |
| 809 | SUCCESS = 2; |
| 810 | } |
| 811 | optional BouncerResult result = 1; |
| 812 | } |
| 813 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 814 | /* |
| 815 | * Logs changes to the configuration of the device. The configuration is defined |
| 816 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 817 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 818 | * Please go there to interpret the possible values each field can be. |
| 819 | * |
| 820 | * Logged from: |
| 821 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 822 | */ |
| 823 | message ResourceConfigurationChanged { |
| 824 | // Bit mask of color capabilities of the screen. |
| 825 | // Contains information about the color gamut and hdr mode of the screen. |
| 826 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 827 | optional int32 colorMode = 1; |
| 828 | |
| 829 | // The target screen density being rendered to. |
| 830 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 831 | optional int32 densityDpi = 2; |
| 832 | |
| 833 | // Current user preference for the scaling factor for fonts, |
| 834 | // relative to the base density scaling. |
| 835 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 836 | optional float fontScale = 3; |
| 837 | |
| 838 | // Flag indicating whether the hard keyboard is hidden. |
| 839 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 840 | optional int32 hardKeyboardHidden = 4; |
| 841 | |
| 842 | // The type of keyboard attached to the device. |
| 843 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 844 | optional int32 keyboard = 5; |
| 845 | |
| 846 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 847 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 848 | optional int32 keyboardHideen = 6; |
| 849 | |
| 850 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 851 | // 0 if undefined. |
| 852 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 853 | optional int32 mcc = 7; |
| 854 | |
| 855 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 856 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 857 | // MNC_ZERO symbol defined in Configuration.java. |
| 858 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 859 | optional int32 mnc = 8; |
| 860 | |
| 861 | // The kind of navigation available on the device. |
| 862 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 863 | optional int32 navigation = 9; |
| 864 | |
| 865 | // Flag indicating whether the navigation is available. |
| 866 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 867 | optional int32 navigationHidden = 10; |
| 868 | |
| 869 | // Overall orientation of the screen. |
| 870 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 871 | optional int32 orientation = 11; |
| 872 | |
| 873 | // The current height of the available screen space, in dp units. |
| 874 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 875 | optional int32 screenHeightDp = 12; |
| 876 | |
| 877 | // Bit mask of overall layout of the screen. |
| 878 | // Contains information about screen size, whether the screen is wider/taller |
| 879 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 880 | // and whether the screen has a rounded shape. |
| 881 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 882 | optional int32 screenLayout = 13; |
| 883 | |
| 884 | // Current width of the available screen space, in dp units. |
| 885 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 886 | optional int32 screenWidthDp = 14; |
| 887 | |
| 888 | // The smallest screen size an application will see in normal operation. |
| 889 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 890 | // in portrait and landscape. |
| 891 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 892 | optional int32 smallestScreenWidthDp = 15; |
| 893 | |
| 894 | // The type of touch screen attached to the device. |
| 895 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 896 | optional int32 touchscreen = 16; |
| 897 | |
| 898 | // Bit mask of the ui mode. |
| 899 | // Contains information about the overall ui mode of the device. |
| 900 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 901 | // Also contains information about whether the device is in night mode. |
| 902 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 903 | optional int32 uiMode = 17; |
| 904 | } |
| 905 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 906 | /** |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 907 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
| 908 | * |
| 909 | * Logged from: |
| 910 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 911 | */ |
| 912 | message DaveyOccurred { |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 913 | // The UID that logged this atom. |
| 914 | optional int32 uid = 1; |
| 915 | |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 916 | // Amount of time it took to render the frame. Should be >=700ms. |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 917 | optional int64 jank_duration_millis = 2; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 918 | } |
| 919 | |
| 920 | /** |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 921 | * Logs phone signal strength changes. |
| 922 | * |
| 923 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 924 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 925 | */ |
| 926 | message PhoneSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 927 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 928 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 929 | } |
| 930 | |
| 931 | /** |
| 932 | * Logs that a setting was updated. |
| 933 | * Logged from: |
| 934 | * frameworks/base/core/java/android/provider/Settings.java |
| 935 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 936 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 937 | */ |
| 938 | message SettingChanged { |
| 939 | // The name of the setting. |
| 940 | optional string setting = 1; |
| 941 | |
| 942 | // The change being imposed on this setting. May represent a number, eg "3". |
| 943 | optional string value = 2; |
| 944 | |
| 945 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 946 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 947 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 948 | // The +/- feature is currently only used for location_providers_allowed. |
| 949 | optional string new_value = 3; |
| 950 | |
| 951 | // The previous value of this setting. |
| 952 | optional string prev_value = 4; |
| 953 | |
| 954 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 955 | optional string tag = 5; |
| 956 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 957 | // True if this setting with tag should be resettable. |
| 958 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 959 | |
| 960 | // The user ID associated. Defined in android/os/UserHandle.java |
| 961 | optional int32 user = 7; |
| 962 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 963 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 964 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 965 | * Logs activity going to foreground or background |
| 966 | * |
| 967 | * Logged from: |
| 968 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 969 | */ |
| 970 | message ActivityForegroundStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 971 | optional int32 uid = 1; |
| 972 | optional string pkg_name = 2; |
| 973 | optional string class_name = 3; |
| 974 | |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 975 | enum Activity { |
| 976 | MOVE_TO_BACKGROUND = 0; |
| 977 | MOVE_TO_FOREGROUND = 1; |
| 978 | } |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 979 | optional Activity activity = 4; |
| 980 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 981 | |
| 982 | /** |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 983 | * Logs when an error is written to dropbox. |
| 984 | * Logged from: |
| 985 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 986 | */ |
| 987 | message DropboxErrorChanged { |
| 988 | // The uid if available. -1 means not available. |
| 989 | optional int32 uid = 1; |
| 990 | |
| 991 | // Tag used when recording this error to dropbox. Contains data_ or system_ prefix. |
| 992 | optional string tag = 2; |
| 993 | |
| 994 | // The name of the process. |
| 995 | optional string process_name = 3; |
| 996 | |
| 997 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 998 | optional sint32 pid = 4; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 999 | |
| 1000 | // 1 indicates is instant app. -1 indicates Not applicable. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1001 | optional sint32 is_instant_app = 5; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1002 | |
| 1003 | // The activity name if available. |
| 1004 | optional string activity_name = 6; |
| 1005 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1006 | // The package name if available. |
| 1007 | optional string package_name = 7; |
| 1008 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1009 | // 1 indicates in foreground. -1 indicates not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 1010 | optional sint32 is_foreground = 8; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1011 | } |
| 1012 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1013 | /* |
| 1014 | * Allows other apps to push events into statsd. |
| 1015 | * Logged from: |
| 1016 | * frameworks/base/core/java/android/util/StatsLog.java |
| 1017 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1018 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 1019 | // The uid of the application that sent this custom atom. |
| 1020 | optional int32 uid = 1; |
| 1021 | |
| 1022 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 1023 | optional int32 label = 2; |
| 1024 | |
| 1025 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 1026 | // predicates for the metrics). |
| 1027 | enum State { |
| 1028 | UNKNOWN = 0; |
| 1029 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 1030 | STOP = 2; |
| 1031 | START = 3; |
| 1032 | } |
| 1033 | optional State state = 3; |
| 1034 | } |
| 1035 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 1036 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1037 | * Logs when statsd detects an anomaly. |
| 1038 | * |
| 1039 | * Logged from: |
| 1040 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 1041 | */ |
| 1042 | message AnomalyDetected { |
| 1043 | // Uid that owns the config whose anomaly detection alert fired. |
| 1044 | optional int32 config_uid = 1; |
| 1045 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1046 | // Id of the config whose anomaly detection alert fired. |
| 1047 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1048 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 1049 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 1050 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1051 | } |
| 1052 | |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1053 | message AppStartChanged { |
| 1054 | // The uid if available. -1 means not available. |
| 1055 | optional int32 uid = 1; |
| 1056 | |
| 1057 | // The app package name. |
| 1058 | optional string pkg_name = 2; |
| 1059 | |
| 1060 | enum TransitionType { |
| 1061 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 1062 | WARM = 1; |
| 1063 | HOT = 2; |
| 1064 | COLD = 3; |
| 1065 | } |
| 1066 | // The transition type. |
| 1067 | optional TransitionType type = 3; |
| 1068 | |
| 1069 | // The activity name. |
| 1070 | optional string activity_name = 4; |
| 1071 | |
| 1072 | // The name of the calling app. Empty if not set. |
| 1073 | optional string calling_pkg_name = 5; |
| 1074 | |
| 1075 | // Whether the app is an instant app. |
| 1076 | optional bool is_instant_app = 6; |
| 1077 | |
| 1078 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1079 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1080 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 1081 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1082 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1083 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1084 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1085 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1086 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1087 | optional int32 bind_application_delay_millis = 11; |
| 1088 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1089 | |
| 1090 | // Empty if not set. |
| 1091 | optional string launch_token = 13; |
| 1092 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 1093 | // The compiler filter used when when the package was optimized. |
| 1094 | optional string package_optimization_compilation_filter = 14; |
| 1095 | |
| 1096 | // The reason why the package was optimized. |
| 1097 | optional string package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1098 | } |
| 1099 | |
| 1100 | message AppStartCancelChanged { |
| 1101 | // The uid if available. -1 means not available. |
| 1102 | optional int32 uid = 1; |
| 1103 | |
| 1104 | // The app package name. |
| 1105 | optional string pkg_name = 2; |
| 1106 | |
| 1107 | enum TransitionType { |
| 1108 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 1109 | WARM = 1; |
| 1110 | HOT = 2; |
| 1111 | COLD = 3; |
| 1112 | } |
| 1113 | // The transition type. |
| 1114 | optional TransitionType type = 3; |
| 1115 | |
| 1116 | // The activity name. |
| 1117 | optional string activity_name = 4; |
| 1118 | } |
| 1119 | |
| 1120 | message AppStartFullyDrawnChanged { |
| 1121 | // The uid if available. -1 means not available. |
| 1122 | optional int32 uid = 1; |
| 1123 | |
| 1124 | // The app package name. |
| 1125 | optional string pkg_name = 2; |
| 1126 | |
| 1127 | enum TransitionType { |
| 1128 | APP_START_TRANSITION_TYPE_UNKNOWN = 0; |
| 1129 | WITH_BUNDLE = 1; |
| 1130 | WITHOUT_BUNDLE = 2; |
| 1131 | } |
| 1132 | // The transition type. |
| 1133 | optional TransitionType type = 3; |
| 1134 | |
| 1135 | // The activity name. |
| 1136 | optional string activity_name = 4; |
| 1137 | |
| 1138 | optional bool transition_process_running = 5; |
| 1139 | |
| 1140 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1141 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 1142 | } |
| 1143 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 1144 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1145 | * Logs a picture-in-picture action |
| 1146 | * Logged from: |
| 1147 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1148 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 1149 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 1150 | */ |
| 1151 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1152 | // -1 if it is not available |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1153 | optional int32 uid = 1; |
| 1154 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1155 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1156 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1157 | enum State { |
| 1158 | ENTERED = 1; |
| 1159 | EXPANDED_TO_FULL_SCREEN = 2; |
| 1160 | MINIMIZED = 3; |
| 1161 | DISMISSED = 4; |
| 1162 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 1163 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 1164 | } |
| 1165 | |
| 1166 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1167 | * Logs overlay action |
| 1168 | * Logged from: |
| 1169 | * services/core/java/com/android/server/wm/Session.java |
| 1170 | */ |
| 1171 | message OverlayStateChanged { |
| 1172 | optional int32 uid = 1; |
| 1173 | |
| 1174 | optional string package_name = 2; |
| 1175 | |
| 1176 | optional bool using_alert_window = 3; |
| 1177 | |
| 1178 | enum State { |
| 1179 | ENTERED = 1; |
| 1180 | EXITED = 2; |
| 1181 | } |
| 1182 | optional State state = 4; |
| 1183 | } |
| 1184 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 1185 | /* |
| 1186 | * Logs foreground service starts and stops. |
| 1187 | * Note that this is not when a service starts or stops, but when it is |
| 1188 | * considered foreground. |
| 1189 | * Logged from |
| 1190 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 1191 | */ |
| 1192 | message ForegroundServiceStateChanged { |
| 1193 | optional int32 uid = 1; |
| 1194 | // package_name + "/" + class_name |
| 1195 | optional string short_name = 2; |
| 1196 | |
| 1197 | enum State { |
| 1198 | ENTER = 1; |
| 1199 | EXIT = 2; |
| 1200 | } |
| 1201 | optional State state = 3; |
| 1202 | } |
| 1203 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 1204 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1205 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 1206 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 1207 | * attributed back to the parent (host) uid. One example is Chrome. |
| 1208 | * |
| 1209 | * Logged from: |
| 1210 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1211 | */ |
| 1212 | message IsolatedUidChanged { |
| 1213 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
| 1214 | optional int32 parent_uid = 1; |
| 1215 | |
| 1216 | optional int32 isolated_uid = 2; |
| 1217 | |
| 1218 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 1219 | enum Event { |
| 1220 | REMOVED = 0; |
| 1221 | CREATED = 1; |
| 1222 | } |
| 1223 | optional Event event = 3; |
| 1224 | } |
| 1225 | |
| 1226 | /* |
| 1227 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 1228 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 1229 | * and processed by WakeupController.cpp. |
| 1230 | */ |
| 1231 | message PacketWakeupOccurred { |
| 1232 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 1233 | // delivered nowhere. |
| 1234 | optional int32 uid = 1; |
| 1235 | // The interface name on which the packet was received. |
| 1236 | optional string iface = 2; |
| 1237 | // The ethertype value of the packet. |
| 1238 | optional int32 ethertype = 3; |
| 1239 | // String representation of the destination MAC address of the packet. |
| 1240 | optional string destination_hardware_address = 4; |
| 1241 | // String representation of the source address of the packet if this was an IP packet. |
| 1242 | optional string source_ip = 5; |
| 1243 | // String representation of the destination address of the packet if this was an IP packet. |
| 1244 | optional string destination_ip = 6; |
| 1245 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 1246 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 1247 | // families. |
| 1248 | optional int32 ip_next_header = 7; |
| 1249 | // The source port if this was a TCP or UDP packet. |
| 1250 | optional int32 source_port = 8; |
| 1251 | // The destination port if this was a TCP or UDP packet. |
| 1252 | optional int32 destination_port = 9; |
| 1253 | } |
| 1254 | |
| 1255 | /* |
| 1256 | * Logs the memory stats for an app on startup. |
| 1257 | * Logged from: |
| 1258 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1259 | */ |
| 1260 | message AppStartMemoryStateCaptured { |
| 1261 | // The uid if available. -1 means not available. |
| 1262 | optional int32 uid = 1; |
| 1263 | |
| 1264 | // The process name. |
| 1265 | optional string process_name = 2; |
| 1266 | |
| 1267 | // The activity name. |
| 1268 | optional string activity_name = 3; |
| 1269 | |
| 1270 | // # of page-faults |
| 1271 | optional int64 pgfault = 4; |
| 1272 | |
| 1273 | // # of major page-faults |
| 1274 | optional int64 pgmajfault = 5; |
| 1275 | |
| 1276 | // RSS |
| 1277 | optional int64 rss_in_bytes = 6; |
| 1278 | |
| 1279 | // CACHE |
| 1280 | optional int64 cache_in_bytes = 7; |
| 1281 | |
| 1282 | // SWAP |
| 1283 | optional int64 swap_in_bytes = 8; |
| 1284 | } |
| 1285 | |
| 1286 | /* |
| 1287 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 1288 | * for LMK event. |
| 1289 | * Logged from: |
| 1290 | * system/core/lmkd/lmkd.c |
| 1291 | */ |
| 1292 | message LmkStateChanged { |
| 1293 | enum State { |
| 1294 | UNKNOWN = 0; |
| 1295 | START = 1; |
| 1296 | STOP = 2; |
| 1297 | } |
| 1298 | optional State state = 1; |
| 1299 | } |
| 1300 | |
| 1301 | /* |
| 1302 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 1303 | * Logged from: |
| 1304 | * system/core/lmkd/lmkd.c |
| 1305 | */ |
| 1306 | message LmkKillOccurred { |
| 1307 | // The uid if available. -1 means not available. |
| 1308 | optional int32 uid = 1; |
| 1309 | |
| 1310 | // The process name. |
| 1311 | optional string process_name = 2; |
| 1312 | |
| 1313 | // oom adj score. |
| 1314 | optional int32 oom_score = 3; |
| 1315 | |
| 1316 | // # of page-faults |
| 1317 | optional int64 pgfault = 4; |
| 1318 | |
| 1319 | // # of major page-faults |
| 1320 | optional int64 pgmajfault = 5; |
| 1321 | |
| 1322 | // RSS |
| 1323 | optional int64 rss_in_bytes = 6; |
| 1324 | |
| 1325 | // CACHE |
| 1326 | optional int64 cache_in_bytes = 7; |
| 1327 | |
| 1328 | // SWAP |
| 1329 | optional int64 swap_in_bytes = 8; |
| 1330 | } |
| 1331 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 1332 | /* |
| 1333 | * Logs when the ActivityManagerService detects that an app died. |
| 1334 | * |
| 1335 | * Logged from: |
| 1336 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 1337 | */ |
| 1338 | message AppDied { |
| 1339 | // timestamp(elapsedRealtime) of record creation |
| 1340 | optional uint64 timestamp_millis = 1; |
| 1341 | } |
| 1342 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1343 | ////////////////////////////////////////////////////////////////////// |
| 1344 | // Pulled atoms below this line // |
| 1345 | ////////////////////////////////////////////////////////////////////// |
| 1346 | |
| 1347 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1348 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 1349 | * |
| 1350 | * Pulled from: |
| 1351 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1352 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1353 | message WifiBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1354 | optional int32 uid = 1; |
| 1355 | |
| 1356 | optional int64 rx_bytes = 2; |
| 1357 | |
| 1358 | optional int64 rx_packets = 3; |
| 1359 | |
| 1360 | optional int64 tx_bytes = 4; |
| 1361 | |
| 1362 | optional int64 tx_packets = 5; |
| 1363 | } |
| 1364 | |
| 1365 | /** |
| 1366 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 1367 | * |
| 1368 | * Pulled from: |
| 1369 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 1370 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1371 | message WifiBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1372 | optional int32 uid = 1; |
| 1373 | |
| 1374 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1375 | optional int32 is_foreground = 2; |
| 1376 | |
| 1377 | optional int64 rx_bytes = 3; |
| 1378 | |
| 1379 | optional int64 rx_packets = 4; |
| 1380 | |
| 1381 | optional int64 tx_bytes = 5; |
| 1382 | |
| 1383 | optional int64 tx_packets = 6; |
| 1384 | } |
| 1385 | |
| 1386 | /** |
| 1387 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 1388 | * |
| 1389 | * Pulled from: |
| 1390 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1391 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1392 | message MobileBytesTransfer { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1393 | optional int32 uid = 1; |
| 1394 | |
| 1395 | optional int64 rx_bytes = 2; |
| 1396 | |
| 1397 | optional int64 rx_packets = 3; |
| 1398 | |
| 1399 | optional int64 tx_bytes = 4; |
| 1400 | |
| 1401 | optional int64 tx_packets = 5; |
| 1402 | } |
| 1403 | |
| 1404 | /** |
| 1405 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 1406 | * |
| 1407 | * Pulled from: |
| 1408 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 1409 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1410 | message MobileBytesTransferByFgBg { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1411 | optional int32 uid = 1; |
| 1412 | |
| 1413 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 1414 | optional int32 is_foreground = 2; |
| 1415 | |
| 1416 | optional int64 rx_bytes = 3; |
| 1417 | |
| 1418 | optional int64 rx_packets = 4; |
| 1419 | |
| 1420 | optional int64 tx_bytes = 5; |
| 1421 | |
| 1422 | optional int64 tx_packets = 6; |
| 1423 | } |
| 1424 | |
| 1425 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1426 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 1427 | * |
| 1428 | * Pulled from: |
| 1429 | * StatsCompanionService |
| 1430 | */ |
| 1431 | message BluetoothBytesTransfer { |
| 1432 | optional int32 uid = 1; |
| 1433 | |
| 1434 | optional int64 rx_bytes = 2; |
| 1435 | |
| 1436 | optional int64 tx_bytes = 3; |
| 1437 | } |
| 1438 | |
| 1439 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1440 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 1441 | * android/internal/os/KernelWakelockStats.java |
| 1442 | * |
| 1443 | * Pulled from: |
| 1444 | * StatsCompanionService using KernelWakelockReader. |
| 1445 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1446 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 1447 | optional string name = 1; |
| 1448 | |
| 1449 | optional int32 count = 2; |
| 1450 | |
| 1451 | optional int32 version = 3; |
| 1452 | |
| 1453 | optional int64 time = 4; |
| 1454 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1455 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1456 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1457 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 1458 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1459 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 1460 | * hardware/interfaces/power/1.1/types.hal |
| 1461 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1462 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1463 | // Subsystem name |
| 1464 | optional string subsystem_name = 1; |
| 1465 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 1466 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 1467 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1468 | // The number of times it entered, or voted for entering the sleep state |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 1469 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 1470 | // The length of time spent in, or spent voting for, the sleep state |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1471 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 1472 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1473 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1474 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1475 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 1476 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 1477 | * starts from highest to lowest. The value should be monotonically |
| 1478 | * increasing since boot. However, if there is a cpu |
| 1479 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1480 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1481 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1482 | optional uint32 cluster = 1; |
| 1483 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1484 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 1485 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1486 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1487 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1488 | * Pulls Cpu Time Per Uid. |
| 1489 | * Note that isolated process uid time should be attributed to host uids. |
| 1490 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1491 | message CpuTimePerUid { |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame^] | 1492 | optional int32 uid = 1; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1493 | optional uint64 user_time_millis = 2; |
| 1494 | optional uint64 sys_time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1495 | } |
| 1496 | |
| 1497 | /** |
| 1498 | * Pulls Cpu Time Per Uid per frequency. |
| 1499 | * Note that isolated process uid time should be attributed to host uids. |
| 1500 | * For each uid, we order the time by descending frequencies. |
| 1501 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1502 | message CpuTimePerUidFreq { |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame^] | 1503 | optional int32 uid = 1; |
| 1504 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1505 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 1506 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 1507 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1508 | /** |
| 1509 | * Pulls Wifi Controller Activity Energy Info |
| 1510 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1511 | message WifiActivityEnergyInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1512 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1513 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1514 | // stack reported state |
| 1515 | // TODO: replace this with proto enum |
| 1516 | optional int32 stack_state = 2; |
| 1517 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1518 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1519 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1520 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1521 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1522 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1523 | // product of current(mA), voltage(V) and time(ms) |
| 1524 | optional uint64 controller_energy_used = 6; |
| 1525 | } |
| 1526 | |
| 1527 | /** |
| 1528 | * Pulls Modem Activity Energy Info |
| 1529 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 1530 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1531 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1532 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1533 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1534 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1535 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1536 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1537 | /** |
| 1538 | * Tx power index |
| 1539 | * index 0 = tx_power < 0dBm |
| 1540 | * index 1 = 0dBm < tx_power < 5dBm |
| 1541 | * index 2 = 5dBm < tx_power < 15dBm |
| 1542 | * index 3 = 15dBm < tx_power < 20dBm |
| 1543 | * index 4 = tx_power > 20dBm |
| 1544 | */ |
| 1545 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1546 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1547 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1548 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1549 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1550 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1551 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1552 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1553 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1554 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1555 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1556 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1557 | // product of current(mA), voltage(V) and time(ms) |
| 1558 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 1559 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1560 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1561 | /** |
| 1562 | * Pulls Bluetooth Activity Energy Info |
| 1563 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 1564 | */ |
| 1565 | message BluetoothActivityInfo { |
| 1566 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1567 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1568 | // bluetooth stack state |
| 1569 | optional int32 bluetooth_stack_state = 2; |
| 1570 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1571 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1572 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1573 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1574 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1575 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1576 | // product of current(mA), voltage(V) and time(ms) |
| 1577 | optional uint64 energy_used = 6; |
| 1578 | } |
| 1579 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 1580 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1581 | * Logs the memory stats for a process. |
| 1582 | */ |
| 1583 | message ProcessMemoryState { |
| 1584 | // The uid if available. -1 means not available. |
| 1585 | optional int32 uid = 1; |
| 1586 | |
| 1587 | // The process name. |
| 1588 | optional string process_name = 2; |
| 1589 | |
| 1590 | // oom adj score. |
| 1591 | optional int32 oom_score = 3; |
| 1592 | |
| 1593 | // # of page-faults |
| 1594 | optional int64 pgfault = 4; |
| 1595 | |
| 1596 | // # of major page-faults |
| 1597 | optional int64 pgmajfault = 5; |
| 1598 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 1599 | // RSS |
| 1600 | optional int64 rss_in_bytes = 6; |
| 1601 | |
| 1602 | // CACHE |
| 1603 | optional int64 cache_in_bytes = 7; |
| 1604 | |
| 1605 | // SWAP |
| 1606 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 1607 | } |
| 1608 | |
| 1609 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1610 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1611 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1612 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1613 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1614 | } |
| 1615 | |
| 1616 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1617 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1618 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 1619 | message SystemUptime { |
| 1620 | // Milliseconds since the system was booted. |
| 1621 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 1622 | // for external input). |
| 1623 | // It is not affected by clock scaling, idle, or other power saving mechanisms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1624 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1625 | } |
| 1626 | |
| 1627 | /* |
| 1628 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 1629 | * active: X (X is # cores) |
| 1630 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 1631 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 1632 | * ... |
| 1633 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 1634 | * The file contains a monotonically increasing count of time for a single boot. |
| 1635 | */ |
| 1636 | message CpuActiveTime { |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame^] | 1637 | optional int32 uid = 1; |
| 1638 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 1639 | } |
| 1640 | |
| 1641 | /** |
| 1642 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 1643 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 1644 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1645 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 1646 | * ... |
| 1647 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 1648 | * The file contains a monotonically increasing count of time for a single boot. |
| 1649 | */ |
| 1650 | message CpuClusterTime { |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame^] | 1651 | optional int32 uid = 1; |
| 1652 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 1653 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 1654 | } |
| 1655 | |
| 1656 | /* |
| 1657 | * Pulls free disk space, for data, system partition and temporary directory. |
| 1658 | */ |
| 1659 | message DiskSpace { |
| 1660 | // available bytes in data partition |
| 1661 | optional uint64 data_available_bytes = 1; |
| 1662 | // available bytes in system partition |
| 1663 | optional uint64 system_available_bytes = 2; |
| 1664 | // available bytes in download cache or temp directories |
| 1665 | optional uint64 temp_available_bytes = 3; |
| 1666 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1667 | |
| 1668 | /** |
| 1669 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1670 | * Pulled from: |
| 1671 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1672 | */ |
| 1673 | message RemainingBatteryCapacity { |
| 1674 | optional int32 charge_uAh = 1; |
| 1675 | } |
| 1676 | |
| 1677 | /** |
| 1678 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1679 | * Pulled from: |
| 1680 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 1681 | */ |
| 1682 | message FullBatteryCapacity { |
| 1683 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 1684 | } |
| 1685 | |
| 1686 | /** |
| 1687 | * Pulls the temperature of various parts of the device, in Celsius. |
| 1688 | * |
| 1689 | * Pulled from: |
| 1690 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 1691 | */ |
| 1692 | message Temperature { |
| 1693 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 1694 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 1695 | |
| 1696 | // The name of the temperature source. Eg. CPU0 |
| 1697 | optional string sensor_name = 2; |
| 1698 | |
| 1699 | // Temperature in degrees C. |
| 1700 | optional float temperature_C = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 1701 | } |