blob: ce27ce6853e81b508113b1cb5b95358d58bf14c8 [file] [log] [blame]
Chenjie Yu1a317ba2017-10-05 16:05:32 -07001/*
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
Chenjie Yu80f91122018-01-31 20:24:50 -080017#define DEBUG false
Joe Onorato9fc9edf2017-10-15 20:08:52 -070018#include "Log.h"
Chenjie Yu1a317ba2017-10-05 16:05:32 -070019
Alec Mouri1dc5f1e2019-09-18 21:13:01 -070020#include "StatsPullerManager.h"
21
Tej Singh6a5c9432019-10-11 11:07:06 -070022#include <android/os/IPullAtomCallback.h>
Chenjie Yu1a317ba2017-10-05 16:05:32 -070023#include <android/os/IStatsCompanionService.h>
Tej Singha0c89dd2019-01-25 16:39:18 -080024#include <android/os/IStatsPullerCallback.h>
David Chen1481fe12017-10-16 13:16:34 -070025#include <cutils/log.h>
Chenjie Yu1a0a9412018-03-28 10:07:22 -070026#include <math.h>
Chenjie Yu3b3adcd2018-04-18 16:25:36 -070027#include <stdint.h>
Alec Mouri1dc5f1e2019-09-18 21:13:01 -070028
David Chen1481fe12017-10-16 13:16:34 -070029#include <algorithm>
Alec Mouri1dc5f1e2019-09-18 21:13:01 -070030#include <iostream>
31
Chenjie Yu1a0a9412018-03-28 10:07:22 -070032#include "../StatsService.h"
Chenjie Yuaa5b2012018-03-21 13:53:15 -070033#include "../logd/LogEvent.h"
34#include "../stats_log_util.h"
35#include "../statscompanion_util.h"
Mark Tabry9dc13572019-11-06 13:42:30 -080036#include "CarStatsPuller.h"
Yiwei Zhang7e633032019-03-01 17:25:27 -080037#include "GpuStatsPuller.h"
Bookatz92da2832018-11-01 18:10:03 -070038#include "PowerStatsPuller.h"
Tej Singh40298312018-02-16 00:15:09 -080039#include "ResourceHealthManagerPuller.h"
Tej Singha0c89dd2019-01-25 16:39:18 -080040#include "StatsCallbackPuller.h"
Tej Singh6a5c9432019-10-11 11:07:06 -070041#include "StatsCallbackPullerDeprecated.h"
Chenjie Yu97dbb202019-02-13 16:42:04 -080042#include "StatsCompanionServicePuller.h"
Tej Singhbf972d92018-01-10 20:51:13 -080043#include "SubsystemSleepStatePuller.h"
Alec Mouri1dc5f1e2019-09-18 21:13:01 -070044#include "SurfaceflingerStatsPuller.h"
Chenjie Yu97dbb202019-02-13 16:42:04 -080045#include "TrainInfoPuller.h"
Chenjie Yu5305e1d2017-10-31 13:49:36 -070046#include "statslog.h"
David Chen1481fe12017-10-16 13:16:34 -070047
Yao Chen93fe3a32017-11-02 13:52:59 -070048using std::make_shared;
Chenjie Yu5305e1d2017-10-31 13:49:36 -070049using std::map;
Yao Chen93fe3a32017-11-02 13:52:59 -070050using std::shared_ptr;
Chenjie Yub3dda412017-10-24 13:41:59 -070051using std::string;
52using std::vector;
Chenjie Yu6736c892017-11-09 10:50:09 -080053using std::list;
Chenjie Yu1a317ba2017-10-05 16:05:32 -070054
55namespace android {
56namespace os {
57namespace statsd {
58
Chenjie Yu3b3adcd2018-04-18 16:25:36 -070059// Values smaller than this may require to update the alarm.
60const int64_t NO_ALARM_UPDATE = INT64_MAX;
61
Tej Singh6a5c9432019-10-11 11:07:06 -070062std::map<PullerKey, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
Chenjie Yufeba3092018-02-08 14:33:37 -080063 // wifi_bytes_transfer
Tej Singh6a5c9432019-10-11 11:07:06 -070064 {{.atomTag = android::util::WIFI_BYTES_TRANSFER},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080065 {.additiveFields = {2, 3, 4, 5},
66 .puller = new StatsCompanionServicePuller(android::util::WIFI_BYTES_TRANSFER)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080067 // wifi_bytes_transfer_by_fg_bg
Tej Singh6a5c9432019-10-11 11:07:06 -070068 {{.atomTag = android::util::WIFI_BYTES_TRANSFER_BY_FG_BG},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080069 {.additiveFields = {3, 4, 5, 6},
70 .puller = new StatsCompanionServicePuller(android::util::WIFI_BYTES_TRANSFER_BY_FG_BG)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080071 // mobile_bytes_transfer
Tej Singh6a5c9432019-10-11 11:07:06 -070072 {{.atomTag = android::util::MOBILE_BYTES_TRANSFER},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080073 {.additiveFields = {2, 3, 4, 5},
74 .puller = new StatsCompanionServicePuller(android::util::MOBILE_BYTES_TRANSFER)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080075 // mobile_bytes_transfer_by_fg_bg
Tej Singh6a5c9432019-10-11 11:07:06 -070076 {{.atomTag = android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080077 {.additiveFields = {3, 4, 5, 6},
78 .puller =
79 new StatsCompanionServicePuller(android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080080 // bluetooth_bytes_transfer
Tej Singh6a5c9432019-10-11 11:07:06 -070081 {{.atomTag = android::util::BLUETOOTH_BYTES_TRANSFER},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080082 {.additiveFields = {2, 3},
83 .puller = new StatsCompanionServicePuller(android::util::BLUETOOTH_BYTES_TRANSFER)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080084 // kernel_wakelock
Tej Singh6a5c9432019-10-11 11:07:06 -070085 {{.atomTag = android::util::KERNEL_WAKELOCK},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080086 {.puller = new StatsCompanionServicePuller(android::util::KERNEL_WAKELOCK)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080087 // subsystem_sleep_state
Tej Singh6a5c9432019-10-11 11:07:06 -070088 {{.atomTag = android::util::SUBSYSTEM_SLEEP_STATE},
89 {.puller = new SubsystemSleepStatePuller()}},
Bookatz92da2832018-11-01 18:10:03 -070090 // on_device_power_measurement
Tej Singh6a5c9432019-10-11 11:07:06 -070091 {{.atomTag = android::util::ON_DEVICE_POWER_MEASUREMENT},
92 {.puller = new PowerStatsPuller()}},
Chenjie Yufeba3092018-02-08 14:33:37 -080093 // cpu_time_per_freq
Tej Singh6a5c9432019-10-11 11:07:06 -070094 {{.atomTag = android::util::CPU_TIME_PER_FREQ},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080095 {.additiveFields = {3},
96 .puller = new StatsCompanionServicePuller(android::util::CPU_TIME_PER_FREQ)}},
Chenjie Yufeba3092018-02-08 14:33:37 -080097 // cpu_time_per_uid
Tej Singh6a5c9432019-10-11 11:07:06 -070098 {{.atomTag = android::util::CPU_TIME_PER_UID},
Chenjie Yu0bd73db2018-12-16 07:37:04 -080099 {.additiveFields = {2, 3},
100 .puller = new StatsCompanionServicePuller(android::util::CPU_TIME_PER_UID)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800101 // cpu_time_per_uid_freq
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700102 // the throttling is 3sec, handled in
103 // frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader
Tej Singh6a5c9432019-10-11 11:07:06 -0700104 {{.atomTag = android::util::CPU_TIME_PER_UID_FREQ},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800105 {.additiveFields = {4},
106 .puller = new StatsCompanionServicePuller(android::util::CPU_TIME_PER_UID_FREQ)}},
Chenjie Yuec676612018-03-07 09:19:17 -0800107 // cpu_active_time
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700108 // the throttling is 3sec, handled in
109 // frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader
Tej Singh6a5c9432019-10-11 11:07:06 -0700110 {{.atomTag = android::util::CPU_ACTIVE_TIME},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800111 {.additiveFields = {2},
112 .puller = new StatsCompanionServicePuller(android::util::CPU_ACTIVE_TIME)}},
Chenjie Yuec676612018-03-07 09:19:17 -0800113 // cpu_cluster_time
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700114 // the throttling is 3sec, handled in
115 // frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader
Tej Singh6a5c9432019-10-11 11:07:06 -0700116 {{.atomTag = android::util::CPU_CLUSTER_TIME},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800117 {.additiveFields = {3},
118 .puller = new StatsCompanionServicePuller(android::util::CPU_CLUSTER_TIME)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800119 // wifi_activity_energy_info
Tej Singh6a5c9432019-10-11 11:07:06 -0700120 {{.atomTag = android::util::WIFI_ACTIVITY_INFO},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800121 {.puller = new StatsCompanionServicePuller(android::util::WIFI_ACTIVITY_INFO)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800122 // modem_activity_info
Tej Singh6a5c9432019-10-11 11:07:06 -0700123 {{.atomTag = android::util::MODEM_ACTIVITY_INFO},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800124 {.puller = new StatsCompanionServicePuller(android::util::MODEM_ACTIVITY_INFO)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800125 // bluetooth_activity_info
Tej Singh6a5c9432019-10-11 11:07:06 -0700126 {{.atomTag = android::util::BLUETOOTH_ACTIVITY_INFO},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800127 {.puller = new StatsCompanionServicePuller(android::util::BLUETOOTH_ACTIVITY_INFO)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800128 // system_elapsed_realtime
Tej Singh6a5c9432019-10-11 11:07:06 -0700129 {{.atomTag = android::util::SYSTEM_ELAPSED_REALTIME},
Nick Desaulniers691e1a02019-10-10 13:08:34 -0700130 {.coolDownNs = NS_PER_SEC,
131 .puller = new StatsCompanionServicePuller(android::util::SYSTEM_ELAPSED_REALTIME),
132 .pullTimeoutNs = NS_PER_SEC / 2,
133 }},
Chenjie Yufeba3092018-02-08 14:33:37 -0800134 // system_uptime
Tej Singh6a5c9432019-10-11 11:07:06 -0700135 {{.atomTag = android::util::SYSTEM_UPTIME},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800136 {.puller = new StatsCompanionServicePuller(android::util::SYSTEM_UPTIME)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800137 // remaining_battery_capacity
Tej Singh6a5c9432019-10-11 11:07:06 -0700138 {{.atomTag = android::util::REMAINING_BATTERY_CAPACITY},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800139 {.puller = new ResourceHealthManagerPuller(android::util::REMAINING_BATTERY_CAPACITY)}},
Chenjie Yufeba3092018-02-08 14:33:37 -0800140 // full_battery_capacity
Tej Singh6a5c9432019-10-11 11:07:06 -0700141 {{.atomTag = android::util::FULL_BATTERY_CAPACITY},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800142 {.puller = new ResourceHealthManagerPuller(android::util::FULL_BATTERY_CAPACITY)}},
Bookatz17f0d8a2018-09-13 12:56:32 -0700143 // battery_voltage
Tej Singh6a5c9432019-10-11 11:07:06 -0700144 {{.atomTag = android::util::BATTERY_VOLTAGE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800145 {.puller = new ResourceHealthManagerPuller(android::util::BATTERY_VOLTAGE)}},
Maggie White8735b852019-01-18 11:40:49 -0800146 // battery_level
Tej Singh6a5c9432019-10-11 11:07:06 -0700147 {{.atomTag = android::util::BATTERY_LEVEL},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800148 {.puller = new ResourceHealthManagerPuller(android::util::BATTERY_LEVEL)}},
Maggie White8735b852019-01-18 11:40:49 -0800149 // battery_cycle_count
Tej Singh6a5c9432019-10-11 11:07:06 -0700150 {{.atomTag = android::util::BATTERY_CYCLE_COUNT},
Maggie White8735b852019-01-18 11:40:49 -0800151 {.puller = new ResourceHealthManagerPuller(android::util::BATTERY_CYCLE_COUNT)}},
Rajeev Kumar22d92b72018-02-07 18:38:36 -0800152 // process_memory_state
Tej Singh6a5c9432019-10-11 11:07:06 -0700153 {{.atomTag = android::util::PROCESS_MEMORY_STATE},
Rafal Slawik203c3db2019-09-25 19:53:01 +0100154 {.additiveFields = {4, 5, 6, 7, 8},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800155 .puller = new StatsCompanionServicePuller(android::util::PROCESS_MEMORY_STATE)}},
Rafal Slawikd4e87572019-03-12 13:08:38 +0000156 // process_memory_high_water_mark
Tej Singh6a5c9432019-10-11 11:07:06 -0700157 {{.atomTag = android::util::PROCESS_MEMORY_HIGH_WATER_MARK},
Rafal Slawik203c3db2019-09-25 19:53:01 +0100158 {.puller =
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800159 new StatsCompanionServicePuller(android::util::PROCESS_MEMORY_HIGH_WATER_MARK)}},
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100160 // process_memory_snapshot
Tej Singh6a5c9432019-10-11 11:07:06 -0700161 {{.atomTag = android::util::PROCESS_MEMORY_SNAPSHOT},
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100162 {.puller = new StatsCompanionServicePuller(android::util::PROCESS_MEMORY_SNAPSHOT)}},
Rafal Slawikd4e87572019-03-12 13:08:38 +0000163 // system_ion_heap_size
Tej Singh6a5c9432019-10-11 11:07:06 -0700164 {{.atomTag = android::util::SYSTEM_ION_HEAP_SIZE},
Rafal Slawikd4e87572019-03-12 13:08:38 +0000165 {.puller = new StatsCompanionServicePuller(android::util::SYSTEM_ION_HEAP_SIZE)}},
Rafal Slawik77987ed2019-06-17 12:28:23 +0100166 // process_system_ion_heap_size
Tej Singh6a5c9432019-10-11 11:07:06 -0700167 {{.atomTag = android::util::PROCESS_SYSTEM_ION_HEAP_SIZE},
Rafal Slawik77987ed2019-06-17 12:28:23 +0100168 {.puller = new StatsCompanionServicePuller(android::util::PROCESS_SYSTEM_ION_HEAP_SIZE)}},
Tej Singh40298312018-02-16 00:15:09 -0800169 // temperature
Tej Singh6a5c9432019-10-11 11:07:06 -0700170 {{.atomTag = android::util::TEMPERATURE},
Chenjie Yu97dbb202019-02-13 16:42:04 -0800171 {.puller = new StatsCompanionServicePuller(android::util::TEMPERATURE)}},
Maggie White442b6312019-04-05 16:26:44 -0700172 // cooling_device
Tej Singh6a5c9432019-10-11 11:07:06 -0700173 {{.atomTag = android::util::COOLING_DEVICE},
Maggie White442b6312019-04-05 16:26:44 -0700174 {.puller = new StatsCompanionServicePuller(android::util::COOLING_DEVICE)}},
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100175 // binder_calls
Tej Singh6a5c9432019-10-11 11:07:06 -0700176 {{.atomTag = android::util::BINDER_CALLS},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800177 {.additiveFields = {4, 5, 6, 8, 12},
178 .puller = new StatsCompanionServicePuller(android::util::BINDER_CALLS)}},
Olivier Gaillard6f52d152018-07-25 12:13:12 +0100179 // binder_calls_exceptions
Tej Singh6a5c9432019-10-11 11:07:06 -0700180 {{.atomTag = android::util::BINDER_CALLS_EXCEPTIONS},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800181 {.puller = new StatsCompanionServicePuller(android::util::BINDER_CALLS_EXCEPTIONS)}},
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100182 // looper_stats
Tej Singh6a5c9432019-10-11 11:07:06 -0700183 {{.atomTag = android::util::LOOPER_STATS},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800184 {.additiveFields = {5, 6, 7, 8, 9},
185 .puller = new StatsCompanionServicePuller(android::util::LOOPER_STATS)}},
Tej Singh86dc9db2018-09-06 00:39:57 +0000186 // Disk Stats
Tej Singh6a5c9432019-10-11 11:07:06 -0700187 {{.atomTag = android::util::DISK_STATS},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800188 {.puller = new StatsCompanionServicePuller(android::util::DISK_STATS)}},
Tej Singh86dc9db2018-09-06 00:39:57 +0000189 // Directory usage
Tej Singh6a5c9432019-10-11 11:07:06 -0700190 {{.atomTag = android::util::DIRECTORY_USAGE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800191 {.puller = new StatsCompanionServicePuller(android::util::DIRECTORY_USAGE)}},
Tej Singh86dc9db2018-09-06 00:39:57 +0000192 // Size of app's code, data, and cache
Tej Singh6a5c9432019-10-11 11:07:06 -0700193 {{.atomTag = android::util::APP_SIZE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800194 {.puller = new StatsCompanionServicePuller(android::util::APP_SIZE)}},
Tej Singh86dc9db2018-09-06 00:39:57 +0000195 // Size of specific categories of files. Eg. Music.
Tej Singh6a5c9432019-10-11 11:07:06 -0700196 {{.atomTag = android::util::CATEGORY_SIZE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800197 {.puller = new StatsCompanionServicePuller(android::util::CATEGORY_SIZE)}},
Kevin Chyn6ecc5702019-01-28 12:00:37 -0800198 // Number of fingerprints enrolled for each user.
Tej Singh6a5c9432019-10-11 11:07:06 -0700199 {{.atomTag = android::util::NUM_FINGERPRINTS_ENROLLED},
Kevin Chyn1741a072019-01-17 11:54:40 -0800200 {.puller = new StatsCompanionServicePuller(android::util::NUM_FINGERPRINTS_ENROLLED)}},
Kevin Chyn6ecc5702019-01-28 12:00:37 -0800201 // Number of faces enrolled for each user.
Tej Singh6a5c9432019-10-11 11:07:06 -0700202 {{.atomTag = android::util::NUM_FACES_ENROLLED},
Kevin Chyn6ecc5702019-01-28 12:00:37 -0800203 {.puller = new StatsCompanionServicePuller(android::util::NUM_FACES_ENROLLED)}},
Chenjie Yu2c0d83d2018-09-02 06:37:08 -0700204 // ProcStats.
Tej Singh6a5c9432019-10-11 11:07:06 -0700205 {{.atomTag = android::util::PROC_STATS},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800206 {.puller = new StatsCompanionServicePuller(android::util::PROC_STATS)}},
Chenjie Yub52779e2018-10-05 12:03:36 -0700207 // ProcStatsPkgProc.
Tej Singh6a5c9432019-10-11 11:07:06 -0700208 {{.atomTag = android::util::PROC_STATS_PKG_PROC},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800209 {.puller = new StatsCompanionServicePuller(android::util::PROC_STATS_PKG_PROC)}},
Tej Singhe7726dc2018-09-21 11:42:12 -0700210 // Disk I/O stats per uid.
Tej Singh6a5c9432019-10-11 11:07:06 -0700211 {{.atomTag = android::util::DISK_IO},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800212 {.additiveFields = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11},
213 .coolDownNs = 3 * NS_PER_SEC,
214 .puller = new StatsCompanionServicePuller(android::util::DISK_IO)}},
Chenjie Yuab530202018-09-26 12:39:20 -0700215 // PowerProfile constants for power model calculations.
Tej Singh6a5c9432019-10-11 11:07:06 -0700216 {{.atomTag = android::util::POWER_PROFILE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800217 {.puller = new StatsCompanionServicePuller(android::util::POWER_PROFILE)}},
Yangster-mac308ea0c2018-10-22 13:10:25 -0700218 // Process cpu stats. Min cool-down is 5 sec, inline with what AcitivityManagerService uses.
Tej Singh6a5c9432019-10-11 11:07:06 -0700219 {{.atomTag = android::util::PROCESS_CPU_TIME},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800220 {.coolDownNs = 5 * NS_PER_SEC /* min cool-down in seconds*/,
221 .puller = new StatsCompanionServicePuller(android::util::PROCESS_CPU_TIME)}},
Tej Singh6a5c9432019-10-11 11:07:06 -0700222 {{.atomTag = android::util::CPU_TIME_PER_THREAD_FREQ},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800223 {.additiveFields = {7, 9, 11, 13, 15, 17, 19, 21},
224 .puller = new StatsCompanionServicePuller(android::util::CPU_TIME_PER_THREAD_FREQ)}},
Bookatz75ee6042018-11-09 12:27:37 -0800225 // DeviceCalculatedPowerUse.
Tej Singh6a5c9432019-10-11 11:07:06 -0700226 {{.atomTag = android::util::DEVICE_CALCULATED_POWER_USE},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800227 {.puller = new StatsCompanionServicePuller(android::util::DEVICE_CALCULATED_POWER_USE)}},
Bookatz75ee6042018-11-09 12:27:37 -0800228 // DeviceCalculatedPowerBlameUid.
Tej Singh6a5c9432019-10-11 11:07:06 -0700229 {{.atomTag = android::util::DEVICE_CALCULATED_POWER_BLAME_UID},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800230 {.puller = new StatsCompanionServicePuller(
231 android::util::DEVICE_CALCULATED_POWER_BLAME_UID)}},
Bookatz75ee6042018-11-09 12:27:37 -0800232 // DeviceCalculatedPowerBlameOther.
Tej Singh6a5c9432019-10-11 11:07:06 -0700233 {{.atomTag = android::util::DEVICE_CALCULATED_POWER_BLAME_OTHER},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800234 {.puller = new StatsCompanionServicePuller(
235 android::util::DEVICE_CALCULATED_POWER_BLAME_OTHER)}},
Olivier Gaillard18d452202019-01-22 15:03:41 +0000236 // DebugElapsedClock.
Tej Singh6a5c9432019-10-11 11:07:06 -0700237 {{.atomTag = android::util::DEBUG_ELAPSED_CLOCK},
Olivier Gaillard18d452202019-01-22 15:03:41 +0000238 {.additiveFields = {1, 2, 3, 4},
239 .puller = new StatsCompanionServicePuller(android::util::DEBUG_ELAPSED_CLOCK)}},
240 // DebugFailingElapsedClock.
Tej Singh6a5c9432019-10-11 11:07:06 -0700241 {{.atomTag = android::util::DEBUG_FAILING_ELAPSED_CLOCK},
Olivier Gaillard18d452202019-01-22 15:03:41 +0000242 {.additiveFields = {1, 2, 3, 4},
243 .puller = new StatsCompanionServicePuller(android::util::DEBUG_FAILING_ELAPSED_CLOCK)}},
Bookatz366a4432018-11-20 09:42:33 -0800244 // BuildInformation.
Tej Singh6a5c9432019-10-11 11:07:06 -0700245 {{.atomTag = android::util::BUILD_INFORMATION},
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800246 {.puller = new StatsCompanionServicePuller(android::util::BUILD_INFORMATION)}},
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800247 // RoleHolder.
Tej Singh6a5c9432019-10-11 11:07:06 -0700248 {{.atomTag = android::util::ROLE_HOLDER},
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800249 {.puller = new StatsCompanionServicePuller(android::util::ROLE_HOLDER)}},
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800250 // PermissionState.
Tej Singh6a5c9432019-10-11 11:07:06 -0700251 {{.atomTag = android::util::DANGEROUS_PERMISSION_STATE},
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800252 {.puller = new StatsCompanionServicePuller(android::util::DANGEROUS_PERMISSION_STATE)}},
Chenjie Yu97dbb202019-02-13 16:42:04 -0800253 // TrainInfo.
Tej Singh6a5c9432019-10-11 11:07:06 -0700254 {{.atomTag = android::util::TRAIN_INFO}, {.puller = new TrainInfoPuller()}},
Neil Fullerdb14b482019-02-05 19:44:44 +0000255 // TimeZoneDataInfo.
Tej Singh6a5c9432019-10-11 11:07:06 -0700256 {{.atomTag = android::util::TIME_ZONE_DATA_INFO},
Neil Fullerdb14b482019-02-05 19:44:44 +0000257 {.puller = new StatsCompanionServicePuller(android::util::TIME_ZONE_DATA_INFO)}},
Carmen Agimof12dec122019-03-06 16:14:38 +0000258 // ExternalStorageInfo
Tej Singh6a5c9432019-10-11 11:07:06 -0700259 {{.atomTag = android::util::EXTERNAL_STORAGE_INFO},
Carmen Agimof12dec122019-03-06 16:14:38 +0000260 {.puller = new StatsCompanionServicePuller(android::util::EXTERNAL_STORAGE_INFO)}},
Yiwei Zhang7e633032019-03-01 17:25:27 -0800261 // GpuStatsGlobalInfo
Tej Singh6a5c9432019-10-11 11:07:06 -0700262 {{.atomTag = android::util::GPU_STATS_GLOBAL_INFO},
Yiwei Zhang7e633032019-03-01 17:25:27 -0800263 {.puller = new GpuStatsPuller(android::util::GPU_STATS_GLOBAL_INFO)}},
Yiwei Zhang4fb92892019-03-04 14:29:25 -0800264 // GpuStatsAppInfo
Tej Singh6a5c9432019-10-11 11:07:06 -0700265 {{.atomTag = android::util::GPU_STATS_APP_INFO},
Yiwei Zhang4fb92892019-03-04 14:29:25 -0800266 {.puller = new GpuStatsPuller(android::util::GPU_STATS_APP_INFO)}},
Carmen Agimofa769c152019-03-04 14:39:14 +0000267 // AppsOnExternalStorageInfo
Tej Singh6a5c9432019-10-11 11:07:06 -0700268 {{.atomTag = android::util::APPS_ON_EXTERNAL_STORAGE_INFO},
Carmen Agimofa769c152019-03-04 14:39:14 +0000269 {.puller = new StatsCompanionServicePuller(android::util::APPS_ON_EXTERNAL_STORAGE_INFO)}},
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700270 // Face Settings
Tej Singh6a5c9432019-10-11 11:07:06 -0700271 {{.atomTag = android::util::FACE_SETTINGS},
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700272 {.puller = new StatsCompanionServicePuller(android::util::FACE_SETTINGS)}},
Martijn Coenencd95d462019-04-25 17:09:45 +0200273 // App ops
Tej Singh6a5c9432019-10-11 11:07:06 -0700274 {{.atomTag = android::util::APP_OPS},
Martijn Coenencd95d462019-04-25 17:09:45 +0200275 {.puller = new StatsCompanionServicePuller(android::util::APP_OPS)}},
Alec Mouri1dc5f1e2019-09-18 21:13:01 -0700276 // SurfaceflingerStatsGlobalInfo
Tej Singh6a5c9432019-10-11 11:07:06 -0700277 {{.atomTag = android::util::SURFACEFLINGER_STATS_GLOBAL_INFO},
Alec Mouri1dc5f1e2019-09-18 21:13:01 -0700278 {.puller =
279 new SurfaceflingerStatsPuller(android::util::SURFACEFLINGER_STATS_GLOBAL_INFO)}},
Mark Tabry9dc13572019-11-06 13:42:30 -0800280 // VmsClientStats
Tej Singh6a5c9432019-10-11 11:07:06 -0700281 {{.atomTag = android::util::VMS_CLIENT_STATS},
Mark Tabry9dc13572019-11-06 13:42:30 -0800282 {.additiveFields = {5, 6, 7, 8, 9, 10},
283 .puller = new CarStatsPuller(android::util::VMS_CLIENT_STATS)}},
Chenjie Yu2c0d83d2018-09-02 06:37:08 -0700284};
Chenjie Yu80f91122018-01-31 20:24:50 -0800285
Chenjie Yue2219202018-06-08 10:07:51 -0700286StatsPullerManager::StatsPullerManager() : mNextPullTimeNs(NO_ALARM_UPDATE) {
Chenjie Yu1a317ba2017-10-05 16:05:32 -0700287}
288
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800289bool StatsPullerManager::Pull(int tagId, vector<shared_ptr<LogEvent>>* data) {
Tej Singh484524a2018-02-01 15:10:05 -0800290 VLOG("Initiating pulling %d", tagId);
Chenjie Yub3dda412017-10-24 13:41:59 -0700291
Tej Singh6a5c9432019-10-11 11:07:06 -0700292 if (kAllPullAtomInfo.find({.atomTag = tagId}) != kAllPullAtomInfo.end()) {
293 bool ret = kAllPullAtomInfo.find({.atomTag = tagId})->second.puller->Pull(data);
Tej Singh484524a2018-02-01 15:10:05 -0800294 VLOG("pulled %d items", (int)data->size());
Misha Wagner1eee2212019-01-22 11:47:11 +0000295 if (!ret) {
296 StatsdStats::getInstance().notePullFailed(tagId);
297 }
Tej Singh484524a2018-02-01 15:10:05 -0800298 return ret;
Yao Chen93fe3a32017-11-02 13:52:59 -0700299 } else {
Tej Singh484524a2018-02-01 15:10:05 -0800300 VLOG("Unknown tagId %d", tagId);
Yao Chen93fe3a32017-11-02 13:52:59 -0700301 return false; // Return early since we don't know what to pull.
302 }
303}
Chenjie Yub3dda412017-10-24 13:41:59 -0700304
Chenjie Yue2219202018-06-08 10:07:51 -0700305bool StatsPullerManager::PullerForMatcherExists(int tagId) const {
Tej Singhde473b52019-04-10 19:25:03 -0700306 // Vendor pulled atoms might be registered after we parse the config.
Tej Singh6a5c9432019-10-11 11:07:06 -0700307 return isVendorPulledAtom(tagId) ||
308 kAllPullAtomInfo.find({.atomTag = tagId}) != kAllPullAtomInfo.end();
Chenjie Yub3dda412017-10-24 13:41:59 -0700309}
310
Chenjie Yue2219202018-06-08 10:07:51 -0700311void StatsPullerManager::updateAlarmLocked() {
Chenjie Yu3b3adcd2018-04-18 16:25:36 -0700312 if (mNextPullTimeNs == NO_ALARM_UPDATE) {
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700313 VLOG("No need to set alarms. Skipping");
314 return;
315 }
316
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700317 sp<IStatsCompanionService> statsCompanionServiceCopy = mStatsCompanionService;
318 if (statsCompanionServiceCopy != nullptr) {
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700319 statsCompanionServiceCopy->setPullingAlarm(mNextPullTimeNs / 1000000);
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700320 } else {
321 VLOG("StatsCompanionService not available. Alarm not set.");
322 }
323 return;
324}
325
Chenjie Yue2219202018-06-08 10:07:51 -0700326void StatsPullerManager::SetStatsCompanionService(
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700327 sp<IStatsCompanionService> statsCompanionService) {
328 AutoMutex _l(mLock);
329 sp<IStatsCompanionService> tmpForLock = mStatsCompanionService;
330 mStatsCompanionService = statsCompanionService;
331 for (const auto& pulledAtom : kAllPullAtomInfo) {
332 pulledAtom.second.puller->SetStatsCompanionService(statsCompanionService);
333 }
334 if (mStatsCompanionService != nullptr) {
335 updateAlarmLocked();
336 }
337}
338
Chenjie Yue2219202018-06-08 10:07:51 -0700339void StatsPullerManager::RegisterReceiver(int tagId, wp<PullDataReceiver> receiver,
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700340 int64_t nextPullTimeNs, int64_t intervalNs) {
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700341 AutoMutex _l(mLock);
Chenjie Yu6736c892017-11-09 10:50:09 -0800342 auto& receivers = mReceivers[tagId];
Chenjie Yub3dda412017-10-24 13:41:59 -0700343 for (auto it = receivers.begin(); it != receivers.end(); it++) {
Chenjie Yu6736c892017-11-09 10:50:09 -0800344 if (it->receiver == receiver) {
Chenjie Yub3dda412017-10-24 13:41:59 -0700345 VLOG("Receiver already registered of %d", (int)receivers.size());
346 return;
347 }
348 }
349 ReceiverInfo receiverInfo;
350 receiverInfo.receiver = receiver;
Chenjie Yub3dda412017-10-24 13:41:59 -0700351
Chenjie Yu85ed8382017-12-14 16:48:54 -0800352 // Round it to the nearest minutes. This is the limit of alarm manager.
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700353 // In practice, we should always have larger buckets.
354 int64_t roundedIntervalNs = intervalNs / NS_PER_SEC / 60 * NS_PER_SEC * 60;
Chenjie Yu83baaa12018-03-19 10:41:35 -0700355 // Scheduled pulling should be at least 1 min apart.
356 // This can be lower in cts tests, in which case we round it to 1 min.
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700357 if (roundedIntervalNs < 60 * (int64_t)NS_PER_SEC) {
358 roundedIntervalNs = 60 * (int64_t)NS_PER_SEC;
Chenjie Yu83baaa12018-03-19 10:41:35 -0700359 }
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700360
361 receiverInfo.intervalNs = roundedIntervalNs;
362 receiverInfo.nextPullTimeNs = nextPullTimeNs;
363 receivers.push_back(receiverInfo);
364
Chenjie Yub3dda412017-10-24 13:41:59 -0700365 // There is only one alarm for all pulled events. So only set it to the smallest denom.
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700366 if (nextPullTimeNs < mNextPullTimeNs) {
367 VLOG("Updating next pull time %lld", (long long)mNextPullTimeNs);
368 mNextPullTimeNs = nextPullTimeNs;
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700369 updateAlarmLocked();
Chenjie Yub3dda412017-10-24 13:41:59 -0700370 }
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700371 VLOG("Puller for tagId %d registered of %d", tagId, (int)receivers.size());
Chenjie Yub3dda412017-10-24 13:41:59 -0700372}
373
Chenjie Yue2219202018-06-08 10:07:51 -0700374void StatsPullerManager::UnRegisterReceiver(int tagId, wp<PullDataReceiver> receiver) {
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700375 AutoMutex _l(mLock);
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700376 if (mReceivers.find(tagId) == mReceivers.end()) {
377 VLOG("Unknown pull code or no receivers: %d", tagId);
Chenjie Yub3dda412017-10-24 13:41:59 -0700378 return;
379 }
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700380 auto& receivers = mReceivers.find(tagId)->second;
Chenjie Yub3dda412017-10-24 13:41:59 -0700381 for (auto it = receivers.begin(); it != receivers.end(); it++) {
Chenjie Yu6736c892017-11-09 10:50:09 -0800382 if (receiver == it->receiver) {
Chenjie Yub3dda412017-10-24 13:41:59 -0700383 receivers.erase(it);
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700384 VLOG("Puller for tagId %d unregistered of %d", tagId, (int)receivers.size());
Chenjie Yub3dda412017-10-24 13:41:59 -0700385 return;
386 }
387 }
388}
389
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800390void StatsPullerManager::OnAlarmFired(int64_t elapsedTimeNs) {
Chenjie Yuaa5b2012018-03-21 13:53:15 -0700391 AutoMutex _l(mLock);
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800392 int64_t wallClockNs = getWallClockNs();
Chenjie Yub3dda412017-10-24 13:41:59 -0700393
Chenjie Yu3b3adcd2018-04-18 16:25:36 -0700394 int64_t minNextPullTimeNs = NO_ALARM_UPDATE;
Chenjie Yub3dda412017-10-24 13:41:59 -0700395
396 vector<pair<int, vector<ReceiverInfo*>>> needToPull =
397 vector<pair<int, vector<ReceiverInfo*>>>();
398 for (auto& pair : mReceivers) {
399 vector<ReceiverInfo*> receivers = vector<ReceiverInfo*>();
Yao Chen93fe3a32017-11-02 13:52:59 -0700400 if (pair.second.size() != 0) {
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700401 for (ReceiverInfo& receiverInfo : pair.second) {
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800402 if (receiverInfo.nextPullTimeNs <= elapsedTimeNs) {
Chenjie Yub3dda412017-10-24 13:41:59 -0700403 receivers.push_back(&receiverInfo);
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700404 } else {
405 if (receiverInfo.nextPullTimeNs < minNextPullTimeNs) {
406 minNextPullTimeNs = receiverInfo.nextPullTimeNs;
407 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700408 }
409 }
410 if (receivers.size() > 0) {
411 needToPull.push_back(make_pair(pair.first, receivers));
412 }
413 }
414 }
415
416 for (const auto& pullInfo : needToPull) {
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700417 vector<shared_ptr<LogEvent>> data;
Olivier Gaillardc5f11c42019-02-05 12:44:58 +0000418 bool pullSuccess = Pull(pullInfo.first, &data);
419 if (pullSuccess) {
420 StatsdStats::getInstance().notePullDelay(
421 pullInfo.first, getElapsedRealtimeNs() - elapsedTimeNs);
422 } else {
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800423 VLOG("pull failed at %lld, will try again later", (long long)elapsedTimeNs);
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800424 }
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800425
426 // Convention is to mark pull atom timestamp at request time.
427 // If we pull at t0, puller starts at t1, finishes at t2, and send back
428 // at t3, we mark t0 as its timestamp, which should correspond to its
429 // triggering event, such as condition change at t0.
430 // Here the triggering event is alarm fired from AlarmManager.
431 // In ValueMetricProducer and GaugeMetricProducer we do same thing
432 // when pull on condition change, etc.
433 for (auto& event : data) {
434 event->setElapsedTimestampNs(elapsedTimeNs);
435 event->setLogdWallClockTimestampNs(wallClockNs);
436 }
437
438 for (const auto& receiverInfo : pullInfo.second) {
439 sp<PullDataReceiver> receiverPtr = receiverInfo->receiver.promote();
440 if (receiverPtr != nullptr) {
Olivier Gaillard11203df2019-02-06 13:18:09 +0000441 receiverPtr->onDataPulled(data, pullSuccess, elapsedTimeNs);
Olivier Gaillardc5f11c42019-02-05 12:44:58 +0000442 // We may have just come out of a coma, compute next pull time.
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800443 int numBucketsAhead =
444 (elapsedTimeNs - receiverInfo->nextPullTimeNs) / receiverInfo->intervalNs;
445 receiverInfo->nextPullTimeNs += (numBucketsAhead + 1) * receiverInfo->intervalNs;
446 if (receiverInfo->nextPullTimeNs < minNextPullTimeNs) {
447 minNextPullTimeNs = receiverInfo->nextPullTimeNs;
Chenjie Yu6736c892017-11-09 10:50:09 -0800448 }
Chenjie Yu0bd73db2018-12-16 07:37:04 -0800449 } else {
450 VLOG("receiver already gone.");
Chenjie Yu5305e1d2017-10-31 13:49:36 -0700451 }
Chenjie Yub3dda412017-10-24 13:41:59 -0700452 }
453 }
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700454
Chenjie Yu3b3adcd2018-04-18 16:25:36 -0700455 VLOG("mNextPullTimeNs: %lld updated to %lld", (long long)mNextPullTimeNs,
456 (long long)minNextPullTimeNs);
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700457 mNextPullTimeNs = minNextPullTimeNs;
458 updateAlarmLocked();
Chenjie Yub3dda412017-10-24 13:41:59 -0700459}
460
Chenjie Yue2219202018-06-08 10:07:51 -0700461int StatsPullerManager::ForceClearPullerCache() {
Chenjie Yufa22d652018-02-05 14:37:48 -0800462 int totalCleared = 0;
Chenjie Yu80f91122018-01-31 20:24:50 -0800463 for (const auto& pulledAtom : kAllPullAtomInfo) {
464 totalCleared += pulledAtom.second.puller->ForceClearCache();
Chenjie Yue72252b2018-02-01 13:19:35 -0800465 }
Chenjie Yufa22d652018-02-05 14:37:48 -0800466 return totalCleared;
467}
468
Chenjie Yue2219202018-06-08 10:07:51 -0700469int StatsPullerManager::ClearPullerCacheIfNecessary(int64_t timestampNs) {
Chenjie Yufa22d652018-02-05 14:37:48 -0800470 int totalCleared = 0;
Chenjie Yu80f91122018-01-31 20:24:50 -0800471 for (const auto& pulledAtom : kAllPullAtomInfo) {
Chenjie Yu1a0a9412018-03-28 10:07:22 -0700472 totalCleared += pulledAtom.second.puller->ClearCacheIfNecessary(timestampNs);
Chenjie Yufa22d652018-02-05 14:37:48 -0800473 }
474 return totalCleared;
Chenjie Yue72252b2018-02-01 13:19:35 -0800475}
476
Tej Singh6a5c9432019-10-11 11:07:06 -0700477// Deprecated, remove after puller API is complete.
Tej Singha0c89dd2019-01-25 16:39:18 -0800478void StatsPullerManager::RegisterPullerCallback(int32_t atomTag,
479 const sp<IStatsPullerCallback>& callback) {
480 AutoMutex _l(mLock);
481 // Platform pullers cannot be changed.
Tej Singhde473b52019-04-10 19:25:03 -0700482 if (!isVendorPulledAtom(atomTag)) {
483 VLOG("RegisterPullerCallback: atom tag %d is not vendor pulled", atomTag);
Tej Singha0c89dd2019-01-25 16:39:18 -0800484 return;
485 }
486 VLOG("RegisterPullerCallback: adding puller for tag %d", atomTag);
487 StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/true);
Tej Singh6a5c9432019-10-11 11:07:06 -0700488 kAllPullAtomInfo[{.atomTag = atomTag}] = {
489 .puller = new StatsCallbackPullerDeprecated(atomTag, callback)};
490}
491
492void StatsPullerManager::RegisterPullAtomCallback(const int uid, const int32_t atomTag,
493 const int64_t coolDownNs, const int64_t timeoutNs,
494 const vector<int32_t>& additiveFields,
495 const sp<IPullAtomCallback>& callback) {
496 AutoMutex _l(mLock);
497 VLOG("RegisterPullerCallback: adding puller for tag %d", atomTag);
498 // TODO: linkToDeath with the callback so that we can remove it and delete the puller.
499 StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/true);
500 kAllPullAtomInfo[{.atomTag = atomTag}] = {.additiveFields = additiveFields,
501 .coolDownNs = coolDownNs,
502 .pullTimeoutNs = timeoutNs,
503 .puller = new StatsCallbackPuller(atomTag, callback)};
Tej Singha0c89dd2019-01-25 16:39:18 -0800504}
505
506void StatsPullerManager::UnregisterPullerCallback(int32_t atomTag) {
507 AutoMutex _l(mLock);
508 // Platform pullers cannot be changed.
Tej Singhde473b52019-04-10 19:25:03 -0700509 if (!isVendorPulledAtom(atomTag)) {
Tej Singha0c89dd2019-01-25 16:39:18 -0800510 return;
511 }
512 StatsdStats::getInstance().notePullerCallbackRegistrationChanged(atomTag, /*registered=*/false);
Tej Singh6a5c9432019-10-11 11:07:06 -0700513 kAllPullAtomInfo.erase({.atomTag = atomTag});
Tej Singha0c89dd2019-01-25 16:39:18 -0800514}
515
Chenjie Yu1a317ba2017-10-05 16:05:32 -0700516} // namespace statsd
517} // namespace os
518} // namespace android