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