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