Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 1 | // |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 2 | // Copyright (C) 2017 The Android Open Source Project |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 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 | // ========================================================== |
| 18 | // Build the library for use on the host |
| 19 | // ========================================================== |
| 20 | cc_library_host_shared { |
| 21 | name: "libstats_proto_host", |
| 22 | srcs: [ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 23 | "src/atoms.proto", |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 24 | "src/atom_field_options.proto", |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 25 | ], |
| 26 | |
| 27 | shared_libs: [ |
| 28 | "libplatformprotos", |
| 29 | ], |
| 30 | |
| 31 | proto: { |
| 32 | type: "full", |
| 33 | export_proto_headers: true, |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 34 | include_dirs: [ |
| 35 | "external/protobuf/src", |
| 36 | ], |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 37 | }, |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 38 | |
| 39 | export_shared_lib_headers: [ |
| 40 | "libplatformprotos", |
| 41 | ] |
| 42 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 43 | } |
| 44 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 45 | cc_defaults { |
| 46 | name: "statsd_defaults", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 47 | |
| 48 | srcs: [ |
Chenjie Yu | c7939cb | 2019-02-04 17:25:45 -0800 | [diff] [blame] | 49 | "src/active_config_list.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 50 | "src/anomaly/AlarmMonitor.cpp", |
| 51 | "src/anomaly/AlarmTracker.cpp", |
| 52 | "src/anomaly/AnomalyTracker.cpp", |
| 53 | "src/anomaly/DurationAnomalyTracker.cpp", |
| 54 | "src/anomaly/subscriber_util.cpp", |
| 55 | "src/condition/CombinationConditionTracker.cpp", |
| 56 | "src/condition/condition_util.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 57 | "src/condition/ConditionWizard.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 58 | "src/condition/SimpleConditionTracker.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 59 | "src/config/ConfigKey.cpp", |
| 60 | "src/config/ConfigListener.cpp", |
| 61 | "src/config/ConfigManager.cpp", |
Jonathan Nguyen | a0e6de1 | 2020-01-28 18:33:55 -0800 | [diff] [blame] | 62 | "src/experiment_ids.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 63 | "src/external/Perfetto.cpp", |
Tej Singh | 6a5c943 | 2019-10-11 11:07:06 -0700 | [diff] [blame] | 64 | "src/external/PullResultReceiver.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 65 | "src/external/puller_util.cpp", |
Tej Singh | a0c89dd | 2019-01-25 16:39:18 -0800 | [diff] [blame] | 66 | "src/external/StatsCallbackPuller.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 67 | "src/external/StatsPuller.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 68 | "src/external/StatsPullerManager.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 69 | "src/external/TrainInfoPuller.cpp", |
| 70 | "src/FieldValue.cpp", |
| 71 | "src/guardrail/StatsdStats.cpp", |
| 72 | "src/hash.cpp", |
| 73 | "src/HashableDimensionKey.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 74 | "src/logd/LogEvent.cpp", |
Yao Chen | 0f86186 | 2019-03-27 11:51:15 -0700 | [diff] [blame] | 75 | "src/logd/LogEventQueue.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 76 | "src/matchers/CombinationLogMatchingTracker.cpp", |
| 77 | "src/matchers/EventMatcherWizard.cpp", |
| 78 | "src/matchers/matcher_util.cpp", |
| 79 | "src/matchers/SimpleLogMatchingTracker.cpp", |
Jeffrey Huang | b8f5403 | 2020-03-23 13:42:42 -0700 | [diff] [blame] | 80 | "src/metadata_util.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 81 | "src/metrics/CountMetricProducer.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 82 | "src/metrics/duration_helper/MaxDurationTracker.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 83 | "src/metrics/duration_helper/OringDurationTracker.cpp", |
| 84 | "src/metrics/DurationMetricProducer.cpp", |
| 85 | "src/metrics/EventMetricProducer.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 86 | "src/metrics/GaugeMetricProducer.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 87 | "src/metrics/MetricProducer.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 88 | "src/metrics/metrics_manager_util.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 89 | "src/metrics/MetricsManager.cpp", |
| 90 | "src/metrics/ValueMetricProducer.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 91 | "src/packages/UidMap.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 92 | "src/shell/shell_config.proto", |
| 93 | "src/shell/ShellSubscriber.cpp", |
| 94 | "src/socket/StatsSocketListener.cpp", |
tsaichristine | 1097864 | 2019-09-10 14:12:49 -0700 | [diff] [blame] | 95 | "src/state/StateManager.cpp", |
| 96 | "src/state/StateTracker.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 97 | "src/stats_log_util.cpp", |
| 98 | "src/statscompanion_util.cpp", |
| 99 | "src/statsd_config.proto", |
Jeffrey Huang | 8a617e0 | 2020-03-19 15:38:43 -0700 | [diff] [blame] | 100 | "src/statsd_metadata.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 101 | "src/StatsLogProcessor.cpp", |
| 102 | "src/StatsService.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 103 | "src/storage/StorageManager.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 104 | "src/subscriber/IncidentdReporter.cpp", |
| 105 | "src/subscriber/SubscriberReporter.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 106 | "src/uid_data.proto", |
Tej Singh | e678cb7 | 2020-04-14 16:23:30 -0700 | [diff] [blame] | 107 | "src/utils/MultiConditionTrigger.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 108 | ], |
| 109 | |
| 110 | local_include_dirs: [ |
| 111 | "src", |
| 112 | ], |
| 113 | |
| 114 | static_libs: [ |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 115 | "libbase", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 116 | "libcutils", |
Tej Singh | 1d4b4653 | 2020-04-06 13:26:29 -0700 | [diff] [blame] | 117 | "libgtest_prod", |
Jonathan Nguyen | 8896f8d | 2019-12-20 15:10:13 -0800 | [diff] [blame] | 118 | "libprotoutil", |
Howard Ro | e5edf8c | 2020-02-05 18:12:14 -0800 | [diff] [blame] | 119 | "libstatsmetadata", |
Jeffrey Huang | 74fc435 | 2020-03-06 15:18:33 -0800 | [diff] [blame] | 120 | "libstatslog_statsd", |
Jonathan Nguyen | 8896f8d | 2019-12-20 15:10:13 -0800 | [diff] [blame] | 121 | "libsysutils", |
Howard Ro | 47807e2 | 2020-02-06 23:17:33 -0800 | [diff] [blame] | 122 | "libutils", |
Tej Singh | 1d4b4653 | 2020-04-06 13:26:29 -0700 | [diff] [blame] | 123 | "statsd-aidl-ndk_platform", |
Jonathan Nguyen | 8896f8d | 2019-12-20 15:10:13 -0800 | [diff] [blame] | 124 | ], |
| 125 | shared_libs: [ |
Ruchir Rastogi | e449b0c | 2020-02-10 17:40:09 -0800 | [diff] [blame] | 126 | "libbinder_ndk", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 127 | "libincident", |
Howard Ro | e5edf8c | 2020-02-05 18:12:14 -0800 | [diff] [blame] | 128 | "liblog", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 129 | ], |
| 130 | } |
| 131 | |
Muhammad Qureshi | c8e2266 | 2019-11-20 17:18:03 -0800 | [diff] [blame] | 132 | // ================ |
| 133 | // libstatsmetadata |
| 134 | // ================ |
| 135 | |
| 136 | genrule { |
| 137 | name: "atoms_info.h", |
| 138 | tools: ["stats-log-api-gen"], |
| 139 | cmd: "$(location stats-log-api-gen) --atomsInfoHeader $(genDir)/atoms_info.h", |
| 140 | out: [ |
| 141 | "atoms_info.h", |
| 142 | ], |
| 143 | } |
| 144 | |
| 145 | genrule { |
| 146 | name: "atoms_info.cpp", |
| 147 | tools: ["stats-log-api-gen"], |
| 148 | cmd: "$(location stats-log-api-gen) --atomsInfoCpp $(genDir)/atoms_info.cpp", |
| 149 | out: [ |
| 150 | "atoms_info.cpp", |
| 151 | ], |
| 152 | } |
| 153 | |
Howard Ro | e5edf8c | 2020-02-05 18:12:14 -0800 | [diff] [blame] | 154 | cc_library_static { |
Muhammad Qureshi | c8e2266 | 2019-11-20 17:18:03 -0800 | [diff] [blame] | 155 | name: "libstatsmetadata", |
| 156 | host_supported: true, |
| 157 | generated_sources: [ |
| 158 | "atoms_info.cpp", |
| 159 | ], |
| 160 | generated_headers: [ |
| 161 | "atoms_info.h", |
| 162 | ], |
| 163 | cflags: [ |
| 164 | "-Wall", |
| 165 | "-Werror", |
| 166 | ], |
| 167 | export_generated_headers: [ |
| 168 | "atoms_info.h", |
| 169 | ], |
Jeffrey Huang | 52e9002 | 2020-02-14 10:13:44 -0800 | [diff] [blame] | 170 | apex_available: [ |
| 171 | //TODO(b/149782403): Remove this once statsd no longer links against libstatsmetadata |
| 172 | "com.android.os.statsd", |
| 173 | "test_com.android.os.statsd", |
| 174 | ], |
Muhammad Qureshi | c8e2266 | 2019-11-20 17:18:03 -0800 | [diff] [blame] | 175 | } |
| 176 | |
Jeffrey Huang | 74fc435 | 2020-03-06 15:18:33 -0800 | [diff] [blame] | 177 | genrule { |
| 178 | name: "statslog_statsd.h", |
| 179 | tools: ["stats-log-api-gen"], |
| 180 | cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_statsd.h --module statsd --namespace android,os,statsd,util", |
| 181 | out: [ |
| 182 | "statslog_statsd.h", |
| 183 | ], |
| 184 | } |
| 185 | |
| 186 | genrule { |
| 187 | name: "statslog_statsd.cpp", |
| 188 | tools: ["stats-log-api-gen"], |
| 189 | cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_statsd.cpp --module statsd --namespace android,os,statsd,util --importHeader statslog_statsd.h", |
| 190 | out: [ |
| 191 | "statslog_statsd.cpp", |
| 192 | ], |
| 193 | } |
| 194 | |
Jeffrey Huang | 3eb84d4 | 2020-03-17 10:31:22 -0700 | [diff] [blame] | 195 | genrule { |
| 196 | name: "statslog_statsdtest.h", |
| 197 | tools: ["stats-log-api-gen"], |
| 198 | cmd: "$(location stats-log-api-gen) --header $(genDir)/statslog_statsdtest.h --module statsdtest --namespace android,os,statsd,util", |
| 199 | out: [ |
| 200 | "statslog_statsdtest.h", |
| 201 | ], |
| 202 | } |
| 203 | |
| 204 | genrule { |
| 205 | name: "statslog_statsdtest.cpp", |
| 206 | tools: ["stats-log-api-gen"], |
| 207 | cmd: "$(location stats-log-api-gen) --cpp $(genDir)/statslog_statsdtest.cpp --module statsdtest --namespace android,os,statsd,util --importHeader statslog_statsdtest.h", |
| 208 | out: [ |
| 209 | "statslog_statsdtest.cpp", |
| 210 | ], |
| 211 | } |
| 212 | |
| 213 | cc_library_static { |
| 214 | name: "libstatslog_statsdtest", |
| 215 | generated_sources: ["statslog_statsdtest.cpp"], |
| 216 | generated_headers: ["statslog_statsdtest.h"], |
| 217 | export_generated_headers: ["statslog_statsdtest.h"], |
| 218 | shared_libs: [ |
| 219 | "libstatssocket", |
| 220 | ] |
| 221 | } |
| 222 | |
Jeffrey Huang | 74fc435 | 2020-03-06 15:18:33 -0800 | [diff] [blame] | 223 | cc_library_static { |
| 224 | name: "libstatslog_statsd", |
| 225 | generated_sources: ["statslog_statsd.cpp"], |
| 226 | generated_headers: ["statslog_statsd.h"], |
| 227 | export_generated_headers: ["statslog_statsd.h"], |
| 228 | apex_available: [ |
| 229 | "com.android.os.statsd", |
| 230 | "test_com.android.os.statsd", |
| 231 | ], |
| 232 | shared_libs: [ |
| 233 | "libstatssocket", |
| 234 | ] |
| 235 | } |
Muhammad Qureshi | c8e2266 | 2019-11-20 17:18:03 -0800 | [diff] [blame] | 236 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 237 | // ========= |
| 238 | // statsd |
| 239 | // ========= |
| 240 | |
| 241 | cc_binary { |
| 242 | name: "statsd", |
| 243 | defaults: ["statsd_defaults"], |
| 244 | |
| 245 | srcs: ["src/main.cpp"], |
| 246 | |
| 247 | cflags: [ |
| 248 | "-Wall", |
| 249 | "-Wextra", |
| 250 | "-Werror", |
| 251 | "-Wno-unused-parameter", |
| 252 | // optimize for size (protobuf glop can get big) |
| 253 | "-Os", |
| 254 | // "-g", |
| 255 | // "-O0", |
| 256 | ], |
| 257 | |
| 258 | product_variables: { |
| 259 | eng: { |
| 260 | // Enable sanitizer ONLY on eng builds |
| 261 | //sanitize: { |
| 262 | // address: true, |
| 263 | //}, |
| 264 | }, |
| 265 | debuggable: { |
| 266 | // Add a flag to enable stats log printing from statsd on debug builds. |
| 267 | cflags: ["-DVERY_VERBOSE_PRINTING"], |
| 268 | }, |
| 269 | }, |
| 270 | |
| 271 | proto: { |
| 272 | type: "lite", |
Tej Singh | 1d4b4653 | 2020-04-06 13:26:29 -0700 | [diff] [blame] | 273 | static: true, |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 274 | }, |
Tej Singh | 1d4b4653 | 2020-04-06 13:26:29 -0700 | [diff] [blame] | 275 | stl: "libc++_static", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 276 | |
Tej Singh | b3915ea | 2020-03-05 14:33:15 -0800 | [diff] [blame] | 277 | shared_libs: [ |
Tej Singh | b3915ea | 2020-03-05 14:33:15 -0800 | [diff] [blame] | 278 | "libstatssocket", |
| 279 | ], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 280 | |
Howard Ro | adc510f | 2020-02-20 04:57:00 +0000 | [diff] [blame] | 281 | apex_available: [ |
| 282 | "com.android.os.statsd", |
| 283 | "test_com.android.os.statsd", |
| 284 | ], |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 285 | } |
| 286 | |
| 287 | // ============== |
| 288 | // statsd_test |
| 289 | // ============== |
| 290 | |
| 291 | cc_test { |
| 292 | name: "statsd_test", |
| 293 | defaults: ["statsd_defaults"], |
Jeffrey Huang | c6b2830 | 2020-04-15 11:16:20 -0700 | [diff] [blame] | 294 | test_suites: ["device-tests", "mts"], |
Chen Zhu | 253d4f3 | 2020-05-19 17:13:09 -0700 | [diff] [blame] | 295 | test_config: "statsd_test.xml", |
Jeffrey Huang | c6b2830 | 2020-04-15 11:16:20 -0700 | [diff] [blame] | 296 | |
Jeffrey Huang | 9c30a95 | 2020-04-17 15:33:32 -0700 | [diff] [blame] | 297 | //TODO(b/153588990): Remove when the build system properly separates |
Jeffrey Huang | c6b2830 | 2020-04-15 11:16:20 -0700 | [diff] [blame] | 298 | //32bit and 64bit architectures. |
Jeffrey Huang | fe283e1 | 2020-04-20 14:16:49 -0700 | [diff] [blame] | 299 | compile_multilib: "both", |
| 300 | multilib: { |
| 301 | lib64: { |
| 302 | suffix: "64", |
Chen Zhu | 253d4f3 | 2020-05-19 17:13:09 -0700 | [diff] [blame] | 303 | }, |
| 304 | lib32: { |
| 305 | suffix: "32", |
| 306 | }, |
Jeffrey Huang | fe283e1 | 2020-04-20 14:16:49 -0700 | [diff] [blame] | 307 | }, |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 308 | |
| 309 | cflags: [ |
| 310 | "-Wall", |
| 311 | "-Werror", |
| 312 | "-Wno-missing-field-initializers", |
| 313 | "-Wno-unused-variable", |
| 314 | "-Wno-unused-function", |
| 315 | "-Wno-unused-parameter", |
| 316 | ], |
| 317 | |
Tej Singh | 5d823b3 | 2019-05-21 20:13:21 -0700 | [diff] [blame] | 318 | require_root: true, |
| 319 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 320 | srcs: [ |
Colin Cross | 3f51ab5 | 2018-10-26 23:28:02 -0700 | [diff] [blame] | 321 | // atom_field_options.proto needs field_options.proto, but that is |
| 322 | // not included in libprotobuf-cpp-lite, so compile it here. |
| 323 | ":libprotobuf-internal-protos", |
| 324 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 325 | "src/atom_field_options.proto", |
| 326 | "src/atoms.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 327 | "src/shell/shell_data.proto", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 328 | "src/stats_log.proto", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 329 | "tests/AlarmMonitor_test.cpp", |
| 330 | "tests/anomaly/AlarmTracker_test.cpp", |
| 331 | "tests/anomaly/AnomalyTracker_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 332 | "tests/condition/CombinationConditionTracker_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 333 | "tests/condition/ConditionTimer_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 334 | "tests/condition/SimpleConditionTracker_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 335 | "tests/ConfigManager_test.cpp", |
| 336 | "tests/e2e/Alarm_e2e_test.cpp", |
| 337 | "tests/e2e/Anomaly_count_e2e_test.cpp", |
| 338 | "tests/e2e/Anomaly_duration_sum_e2e_test.cpp", |
| 339 | "tests/e2e/Attribution_e2e_test.cpp", |
| 340 | "tests/e2e/ConfigTtl_e2e_test.cpp", |
tsaichristine | d21aacf | 2019-10-07 14:47:38 -0700 | [diff] [blame] | 341 | "tests/e2e/CountMetric_e2e_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 342 | "tests/e2e/DurationMetric_e2e_test.cpp", |
| 343 | "tests/e2e/GaugeMetric_e2e_pull_test.cpp", |
| 344 | "tests/e2e/GaugeMetric_e2e_push_test.cpp", |
| 345 | "tests/e2e/MetricActivation_e2e_test.cpp", |
| 346 | "tests/e2e/MetricConditionLink_e2e_test.cpp", |
| 347 | "tests/e2e/PartialBucket_e2e_test.cpp", |
| 348 | "tests/e2e/ValueMetric_pull_e2e_test.cpp", |
| 349 | "tests/e2e/WakelockDuration_e2e_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 350 | "tests/external/puller_util_test.cpp", |
Tej Singh | 8981763 | 2019-12-09 16:58:08 -0800 | [diff] [blame] | 351 | "tests/external/StatsCallbackPuller_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 352 | "tests/external/StatsPuller_test.cpp", |
Tej Singh | 3be093b | 2020-03-04 20:08:38 -0800 | [diff] [blame] | 353 | "tests/external/StatsPullerManager_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 354 | "tests/FieldValue_test.cpp", |
| 355 | "tests/guardrail/StatsdStats_test.cpp", |
tsaichristine | 1449fa4 | 2020-01-02 12:12:05 -0800 | [diff] [blame] | 356 | "tests/HashableDimensionKey_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 357 | "tests/indexed_priority_queue_test.cpp", |
| 358 | "tests/log_event/LogEventQueue_test.cpp", |
| 359 | "tests/LogEntryMatcher_test.cpp", |
| 360 | "tests/LogEvent_test.cpp", |
Jeffrey Huang | 475677e | 2020-03-30 19:52:07 -0700 | [diff] [blame] | 361 | "tests/metadata_util_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 362 | "tests/metrics/CountMetricProducer_test.cpp", |
| 363 | "tests/metrics/DurationMetricProducer_test.cpp", |
| 364 | "tests/metrics/EventMetricProducer_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 365 | "tests/metrics/GaugeMetricProducer_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 366 | "tests/metrics/MaxDurationTracker_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 367 | "tests/metrics/metrics_test_helper.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 368 | "tests/metrics/OringDurationTracker_test.cpp", |
| 369 | "tests/metrics/ValueMetricProducer_test.cpp", |
| 370 | "tests/MetricsManager_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 371 | "tests/shell/ShellSubscriber_test.cpp", |
tsaichristine | 1097864 | 2019-09-10 14:12:49 -0700 | [diff] [blame] | 372 | "tests/state/StateTracker_test.cpp", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 373 | "tests/statsd_test_util.cpp", |
| 374 | "tests/StatsLogProcessor_test.cpp", |
| 375 | "tests/StatsService_test.cpp", |
| 376 | "tests/storage/StorageManager_test.cpp", |
| 377 | "tests/UidMap_test.cpp", |
Tej Singh | e678cb7 | 2020-04-14 16:23:30 -0700 | [diff] [blame] | 378 | "tests/utils/MultiConditionTrigger_test.cpp", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 379 | ], |
| 380 | |
| 381 | static_libs: [ |
| 382 | "libgmock", |
| 383 | "libplatformprotos", |
Jeffrey Huang | 3eb84d4 | 2020-03-17 10:31:22 -0700 | [diff] [blame] | 384 | "libstatslog_statsdtest", |
Tej Singh | eb7d8f4 | 2020-01-29 15:59:35 -0800 | [diff] [blame] | 385 | "libstatssocket_private", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 386 | ], |
| 387 | |
| 388 | proto: { |
Colin Cross | 3f51ab5 | 2018-10-26 23:28:02 -0700 | [diff] [blame] | 389 | type: "lite", |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 390 | include_dirs: ["external/protobuf/src"], |
| 391 | }, |
| 392 | |
Colin Cross | bc2dc31 | 2018-10-26 22:34:06 -0700 | [diff] [blame] | 393 | } |
| 394 | |
| 395 | //############################# |
| 396 | // statsd micro benchmark |
| 397 | //############################# |
| 398 | |
tsaichristine | 6314325 | 2020-03-20 17:03:49 -0700 | [diff] [blame] | 399 | cc_benchmark { |
| 400 | name: "statsd_benchmark", |
| 401 | defaults: ["statsd_defaults"], |
| 402 | |
| 403 | srcs: [ |
| 404 | // atom_field_options.proto needs field_options.proto, but that is |
| 405 | // not included in libprotobuf-cpp-lite, so compile it here. |
| 406 | ":libprotobuf-internal-protos", |
| 407 | |
| 408 | "benchmark/duration_metric_benchmark.cpp", |
| 409 | "benchmark/filter_value_benchmark.cpp", |
| 410 | "benchmark/get_dimensions_for_condition_benchmark.cpp", |
| 411 | "benchmark/hello_world_benchmark.cpp", |
| 412 | "benchmark/log_event_benchmark.cpp", |
| 413 | "benchmark/main.cpp", |
| 414 | "benchmark/metric_util.cpp", |
| 415 | "benchmark/stats_write_benchmark.cpp", |
| 416 | "src/atom_field_options.proto", |
| 417 | "src/atoms.proto", |
| 418 | "src/stats_log.proto", |
| 419 | ], |
| 420 | |
| 421 | proto: { |
| 422 | type: "lite", |
| 423 | include_dirs: ["external/protobuf/src"], |
| 424 | }, |
| 425 | |
| 426 | cflags: [ |
| 427 | "-Wall", |
| 428 | "-Werror", |
| 429 | "-Wno-unused-parameter", |
| 430 | "-Wno-unused-variable", |
| 431 | "-Wno-unused-function", |
| 432 | |
| 433 | // Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374 |
| 434 | "-Wno-varargs", |
| 435 | ], |
| 436 | |
| 437 | static_libs: [ |
| 438 | "libplatformprotos", |
| 439 | "libstatssocket_private", |
| 440 | ], |
| 441 | |
| 442 | shared_libs: [ |
| 443 | "libgtest_prod", |
| 444 | "libprotobuf-cpp-lite", |
| 445 | "libstatslog", |
| 446 | ], |
| 447 | } |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 448 | |
gopinath | a9864fd | 2018-08-22 16:45:57 -0700 | [diff] [blame] | 449 | // ==== java proto device library (for test only) ============================== |
| 450 | java_library { |
| 451 | name: "statsdprotolite", |
Anton Hansson | 791551a | 2019-12-19 10:17:46 +0000 | [diff] [blame] | 452 | sdk_version: "core_current", |
gopinath | a9864fd | 2018-08-22 16:45:57 -0700 | [diff] [blame] | 453 | proto: { |
| 454 | type: "lite", |
| 455 | include_dirs: ["external/protobuf/src"], |
| 456 | }, |
| 457 | |
| 458 | srcs: [ |
gopinath | a9864fd | 2018-08-22 16:45:57 -0700 | [diff] [blame] | 459 | "src/atoms.proto", |
Yao Chen | 35cb8d6 | 2019-01-03 16:49:14 -0800 | [diff] [blame] | 460 | "src/shell/shell_config.proto", |
| 461 | "src/shell/shell_data.proto", |
Ruchir Rastogi | 23d60f9 | 2019-09-16 15:23:56 -0700 | [diff] [blame] | 462 | "src/stats_log.proto", |
| 463 | "src/statsd_config.proto", |
gopinath | a9864fd | 2018-08-22 16:45:57 -0700 | [diff] [blame] | 464 | ], |
| 465 | |
| 466 | static_libs: [ |
| 467 | "platformprotoslite", |
| 468 | ], |
| 469 | // Protos have lots of MissingOverride and similar. |
| 470 | errorprone: { |
| 471 | javacflags: ["-XepDisableAllChecks"], |
| 472 | }, |
| 473 | } |
Harry Zhang | fe16c8f | 2019-02-26 10:47:04 -0800 | [diff] [blame] | 474 | |
| 475 | // Filegroup for statsd config proto definition. |
| 476 | filegroup { |
| 477 | name: "statsd-config-proto-def", |
| 478 | srcs: ["src/statsd_config.proto"], |
| 479 | } |