Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 1 | # Copyright (C) 2017 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | LOCAL_PATH:= $(call my-dir) |
| 16 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 17 | statsd_common_src := \ |
| 18 | ../../core/java/android/os/IStatsCompanionService.aidl \ |
| 19 | ../../core/java/android/os/IStatsManager.aidl \ |
| 20 | src/stats_log.proto \ |
| 21 | src/statsd_config.proto \ |
Yangster-mac | d19bcae4 | 2018-01-04 15:43:39 -0800 | [diff] [blame] | 22 | src/statsd_internal.proto \ |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 23 | src/atoms.proto \ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 24 | src/field_util.cpp \ |
| 25 | src/stats_log_util.cpp \ |
| 26 | src/dimension.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 27 | src/anomaly/AnomalyMonitor.cpp \ |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame] | 28 | src/anomaly/AnomalyTracker.cpp \ |
Bookatz | 857aaa5 | 2017-12-19 15:29:06 -0800 | [diff] [blame] | 29 | src/anomaly/DurationAnomalyTracker.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 30 | src/condition/CombinationConditionTracker.cpp \ |
| 31 | src/condition/condition_util.cpp \ |
| 32 | src/condition/SimpleConditionTracker.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 33 | src/condition/ConditionWizard.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 34 | src/config/ConfigKey.cpp \ |
| 35 | src/config/ConfigListener.cpp \ |
| 36 | src/config/ConfigManager.cpp \ |
Primiano Tucci | e4d4491 | 2018-01-10 12:14:50 +0000 | [diff] [blame] | 37 | src/external/Perfetto.cpp \ |
Chenjie Yu | b038b70 | 2017-12-18 15:15:34 -0800 | [diff] [blame] | 38 | src/external/StatsPuller.cpp \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 39 | src/external/StatsCompanionServicePuller.cpp \ |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 40 | src/external/SubsystemSleepStatePuller.cpp \ |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 41 | src/external/CpuTimePerUidPuller.cpp \ |
| 42 | src/external/CpuTimePerUidFreqPuller.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 43 | src/external/StatsPullerManagerImpl.cpp \ |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 44 | src/logd/LogEvent.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 45 | src/logd/LogListener.cpp \ |
| 46 | src/logd/LogReader.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 47 | src/matchers/CombinationLogMatchingTracker.cpp \ |
| 48 | src/matchers/matcher_util.cpp \ |
| 49 | src/matchers/SimpleLogMatchingTracker.cpp \ |
Yao Chen | b704177 | 2017-10-20 16:59:25 -0700 | [diff] [blame] | 50 | src/metrics/MetricProducer.cpp \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 51 | src/metrics/EventMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 52 | src/metrics/CountMetricProducer.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 53 | src/metrics/DurationMetricProducer.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 54 | src/metrics/duration_helper/OringDurationTracker.cpp \ |
| 55 | src/metrics/duration_helper/MaxDurationTracker.cpp \ |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 56 | src/metrics/ValueMetricProducer.cpp \ |
Yangster | 1d4d686 | 2017-10-31 12:58:51 -0700 | [diff] [blame] | 57 | src/metrics/GaugeMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 58 | src/metrics/MetricsManager.cpp \ |
| 59 | src/metrics/metrics_manager_util.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 60 | src/packages/UidMap.cpp \ |
Primiano Tucci | e4d4491 | 2018-01-10 12:14:50 +0000 | [diff] [blame] | 61 | src/perfetto/perfetto_config.proto \ |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 62 | src/storage/StorageManager.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 63 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 64 | src/StatsService.cpp \ |
Bookatz | c697797 | 2018-01-16 16:55:05 -0800 | [diff] [blame] | 65 | src/subscriber/SubscriberReporter.cpp \ |
Yao Chen | d5aa01b3 | 2017-12-19 16:46:36 -0800 | [diff] [blame] | 66 | src/HashableDimensionKey.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 67 | src/guardrail/MemoryLeakTrackUtil.cpp \ |
| 68 | src/guardrail/StatsdStats.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 69 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 70 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 71 | $(LOCAL_PATH)/src \ |
| 72 | $(LOCAL_PATH)/../../libs/services/include |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 73 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 74 | statsd_common_aidl_includes := \ |
| 75 | $(LOCAL_PATH)/../../core/java |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 76 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 77 | statsd_common_static_libraries := \ |
| 78 | libplatformprotos |
| 79 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 80 | statsd_common_shared_libraries := \ |
| 81 | libbase \ |
| 82 | libbinder \ |
| 83 | libcutils \ |
| 84 | libincident \ |
| 85 | liblog \ |
| 86 | libselinux \ |
| 87 | libutils \ |
| 88 | libservices \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 89 | libprotoutil \ |
| 90 | libstatslog \ |
| 91 | libhardware \ |
| 92 | libhardware_legacy \ |
| 93 | libhidlbase \ |
| 94 | libhidltransport \ |
| 95 | libhwbinder \ |
| 96 | android.hardware.power@1.0 \ |
Yao Chen | 8d9989b | 2017-11-18 18:54:50 -0800 | [diff] [blame] | 97 | android.hardware.power@1.1 \ |
| 98 | libmemunreachable |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 99 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 100 | # ========= |
| 101 | # statsd |
| 102 | # ========= |
| 103 | |
| 104 | include $(CLEAR_VARS) |
| 105 | |
| 106 | LOCAL_MODULE := statsd |
| 107 | |
| 108 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 109 | $(statsd_common_src) \ |
| 110 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 111 | |
| 112 | LOCAL_CFLAGS += \ |
| 113 | -Wall \ |
| 114 | -Werror \ |
| 115 | -Wno-missing-field-initializers \ |
| 116 | -Wno-unused-variable \ |
| 117 | -Wno-unused-function \ |
| 118 | -Wno-unused-parameter |
| 119 | |
| 120 | ifeq (debug,) |
| 121 | LOCAL_CFLAGS += \ |
| 122 | -g -O0 |
| 123 | else |
| 124 | # optimize for size (protobuf glop can get big) |
| 125 | LOCAL_CFLAGS += \ |
| 126 | -Os |
| 127 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 128 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 129 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 130 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 131 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 132 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 133 | LOCAL_STATIC_LIBRARIES := $(statsd_common_static_libraries) |
| 134 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 135 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 136 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 137 | |
| 138 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 139 | |
yro | 98a2850 | 2018-01-18 17:00:14 -0800 | [diff] [blame] | 140 | LOCAL_INIT_RC := statsd.rc |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 141 | |
| 142 | include $(BUILD_EXECUTABLE) |
| 143 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 144 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 145 | # ============== |
| 146 | # statsd_test |
| 147 | # ============== |
| 148 | |
| 149 | include $(CLEAR_VARS) |
| 150 | |
| 151 | LOCAL_MODULE := statsd_test |
| 152 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 153 | LOCAL_MODULE_TAGS := tests |
| 154 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 155 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 156 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 157 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 158 | LOCAL_CFLAGS += \ |
| 159 | -Wall \ |
| 160 | -Werror \ |
| 161 | -Wno-missing-field-initializers \ |
| 162 | -Wno-unused-variable \ |
| 163 | -Wno-unused-function \ |
| 164 | -Wno-unused-parameter |
| 165 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 166 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 167 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 168 | tests/AnomalyMonitor_test.cpp \ |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 169 | tests/anomaly/AnomalyTracker_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 170 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 171 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 172 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 173 | tests/LogReader_test.cpp \ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 174 | tests/LogEvent_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 175 | tests/MetricsManager_test.cpp \ |
David Chen | d9269e2 | 2017-12-05 13:43:51 -0800 | [diff] [blame] | 176 | tests/StatsLogProcessor_test.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 177 | tests/UidMap_test.cpp \ |
Yao Chen | 967b205 | 2017-11-07 16:36:43 -0800 | [diff] [blame] | 178 | tests/condition/CombinationConditionTracker_test.cpp \ |
| 179 | tests/condition/SimpleConditionTracker_test.cpp \ |
Yao Chen | 93fe3a3 | 2017-11-02 13:52:59 -0700 | [diff] [blame] | 180 | tests/metrics/OringDurationTracker_test.cpp \ |
| 181 | tests/metrics/MaxDurationTracker_test.cpp \ |
| 182 | tests/metrics/CountMetricProducer_test.cpp \ |
Yangster | f2bee6f | 2017-11-29 12:01:05 -0800 | [diff] [blame] | 183 | tests/metrics/DurationMetricProducer_test.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 184 | tests/metrics/EventMetricProducer_test.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 185 | tests/metrics/ValueMetricProducer_test.cpp \ |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 186 | tests/metrics/GaugeMetricProducer_test.cpp \ |
Yao Chen | d5aa01b3 | 2017-12-19 16:46:36 -0800 | [diff] [blame] | 187 | tests/guardrail/StatsdStats_test.cpp \ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 188 | tests/metrics/metrics_test_helper.cpp \ |
| 189 | tests/statsd_test_util.cpp \ |
| 190 | tests/e2e/WakelockDuration_e2e_test.cpp \ |
Yangster-mac | b5bc741 | 2018-01-06 23:17:45 -0800 | [diff] [blame] | 191 | tests/e2e/MetricConditionLink_e2e_test.cpp \ |
Yangster-mac | 87718e2 | 2018-01-11 16:16:26 -0800 | [diff] [blame] | 192 | tests/e2e/Attribution_e2e_test.cpp \ |
| 193 | tests/e2e/GaugeMetric_e2e_test.cpp |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 194 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 195 | LOCAL_STATIC_LIBRARIES := \ |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 196 | $(statsd_common_static_libraries) \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 197 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 198 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 199 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 200 | |
| 201 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 202 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 203 | include $(BUILD_NATIVE_TEST) |
| 204 | |
Yao Chen | 459dee6 | 2018-01-10 16:47:05 -0800 | [diff] [blame] | 205 | ############################## |
| 206 | # stats proto static java lib |
| 207 | ############################## |
| 208 | |
| 209 | include $(CLEAR_VARS) |
| 210 | LOCAL_MODULE := statsdprotolite |
| 211 | |
| 212 | LOCAL_SRC_FILES := \ |
| 213 | src/stats_log.proto \ |
| 214 | src/statsd_config.proto \ |
Primiano Tucci | e4d4491 | 2018-01-10 12:14:50 +0000 | [diff] [blame] | 215 | src/perfetto/perfetto_config.proto \ |
Yao Chen | 459dee6 | 2018-01-10 16:47:05 -0800 | [diff] [blame] | 216 | src/atoms.proto |
| 217 | |
| 218 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 219 | |
| 220 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| 221 | platformprotoslite |
| 222 | |
| 223 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 224 | |
Yao Chen | 48d7518 | 2018-01-23 09:40:48 -0800 | [diff] [blame] | 225 | ############################## |
| 226 | # statsd micro benchmark |
| 227 | ############################## |
| 228 | |
| 229 | include $(CLEAR_VARS) |
| 230 | LOCAL_MODULE := statsd_benchmark |
| 231 | |
| 232 | LOCAL_SRC_FILES := $(statsd_common_src) \ |
| 233 | benchmark/main.cpp \ |
| 234 | benchmark/hello_world_benchmark.cpp \ |
| 235 | benchmark/log_event_benchmark.cpp |
| 236 | |
| 237 | LOCAL_C_INCLUDES := $(statsd_common_c_includes) |
| 238 | |
| 239 | LOCAL_CFLAGS := -Wall \ |
| 240 | -Werror \ |
| 241 | -Wno-unused-parameter \ |
| 242 | -Wno-unused-variable \ |
| 243 | -Wno-unused-function \ |
| 244 | |
| 245 | # Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374 |
| 246 | LOCAL_CFLAGS += -Wno-varargs |
| 247 | |
| 248 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
| 249 | |
| 250 | LOCAL_STATIC_LIBRARIES := \ |
| 251 | $(statsd_common_static_libraries) |
| 252 | |
| 253 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 254 | libgtest_prod |
| 255 | |
| 256 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 257 | |
| 258 | LOCAL_MODULE_TAGS := eng tests |
| 259 | |
| 260 | include $(BUILD_NATIVE_BENCHMARK) |
| 261 | |
| 262 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 263 | statsd_common_src:= |
| 264 | statsd_common_aidl_includes:= |
| 265 | statsd_common_c_includes:= |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 266 | statsd_common_static_libraries:= |
| 267 | statsd_common_shared_libraries:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 268 | |
Yao Chen | 1ff4f43 | 2017-11-16 17:01:40 -0800 | [diff] [blame] | 269 | |
Yao Chen | 459dee6 | 2018-01-10 16:47:05 -0800 | [diff] [blame] | 270 | include $(call all-makefiles-under,$(LOCAL_PATH)) |