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