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 \ |
Chenjie Yu | b038b70 | 2017-12-18 15:15:34 -0800 | [diff] [blame] | 37 | src/external/StatsPuller.cpp \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 38 | src/external/StatsCompanionServicePuller.cpp \ |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 39 | src/external/SubsystemSleepStatePuller.cpp \ |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 40 | src/external/CpuTimePerUidPuller.cpp \ |
| 41 | src/external/CpuTimePerUidFreqPuller.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 42 | src/external/StatsPullerManagerImpl.cpp \ |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 43 | src/logd/LogEvent.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 44 | src/logd/LogListener.cpp \ |
| 45 | src/logd/LogReader.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 46 | src/matchers/CombinationLogMatchingTracker.cpp \ |
| 47 | src/matchers/matcher_util.cpp \ |
| 48 | src/matchers/SimpleLogMatchingTracker.cpp \ |
Yao Chen | b704177 | 2017-10-20 16:59:25 -0700 | [diff] [blame] | 49 | src/metrics/MetricProducer.cpp \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 50 | src/metrics/EventMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 51 | src/metrics/CountMetricProducer.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 52 | src/metrics/DurationMetricProducer.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 53 | src/metrics/duration_helper/OringDurationTracker.cpp \ |
| 54 | src/metrics/duration_helper/MaxDurationTracker.cpp \ |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 55 | src/metrics/ValueMetricProducer.cpp \ |
Yangster | 1d4d686 | 2017-10-31 12:58:51 -0700 | [diff] [blame] | 56 | src/metrics/GaugeMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 57 | src/metrics/MetricsManager.cpp \ |
| 58 | src/metrics/metrics_manager_util.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 59 | src/packages/UidMap.cpp \ |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 60 | src/storage/StorageManager.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 61 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 62 | src/StatsService.cpp \ |
Yao Chen | d5aa01b3 | 2017-12-19 16:46:36 -0800 | [diff] [blame] | 63 | src/HashableDimensionKey.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 64 | src/guardrail/MemoryLeakTrackUtil.cpp \ |
| 65 | src/guardrail/StatsdStats.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 66 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 67 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 68 | $(LOCAL_PATH)/src \ |
| 69 | $(LOCAL_PATH)/../../libs/services/include |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 70 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 71 | statsd_common_aidl_includes := \ |
| 72 | $(LOCAL_PATH)/../../core/java |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 73 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 74 | statsd_common_static_libraries := \ |
| 75 | libplatformprotos |
| 76 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 77 | statsd_common_shared_libraries := \ |
| 78 | libbase \ |
| 79 | libbinder \ |
| 80 | libcutils \ |
| 81 | libincident \ |
| 82 | liblog \ |
| 83 | libselinux \ |
| 84 | libutils \ |
| 85 | libservices \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 86 | libprotoutil \ |
| 87 | libstatslog \ |
| 88 | libhardware \ |
| 89 | libhardware_legacy \ |
| 90 | libhidlbase \ |
| 91 | libhidltransport \ |
| 92 | libhwbinder \ |
| 93 | android.hardware.power@1.0 \ |
Yao Chen | 8d9989b | 2017-11-18 18:54:50 -0800 | [diff] [blame] | 94 | android.hardware.power@1.1 \ |
| 95 | libmemunreachable |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 96 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 97 | # ========= |
| 98 | # statsd |
| 99 | # ========= |
| 100 | |
| 101 | include $(CLEAR_VARS) |
| 102 | |
| 103 | LOCAL_MODULE := statsd |
| 104 | |
| 105 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 106 | $(statsd_common_src) \ |
| 107 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 108 | |
| 109 | LOCAL_CFLAGS += \ |
| 110 | -Wall \ |
| 111 | -Werror \ |
| 112 | -Wno-missing-field-initializers \ |
| 113 | -Wno-unused-variable \ |
| 114 | -Wno-unused-function \ |
| 115 | -Wno-unused-parameter |
| 116 | |
| 117 | ifeq (debug,) |
| 118 | LOCAL_CFLAGS += \ |
| 119 | -g -O0 |
| 120 | else |
| 121 | # optimize for size (protobuf glop can get big) |
| 122 | LOCAL_CFLAGS += \ |
| 123 | -Os |
| 124 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 125 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 126 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 127 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 128 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 129 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 130 | LOCAL_STATIC_LIBRARIES := $(statsd_common_static_libraries) |
| 131 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 132 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 133 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 134 | |
| 135 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 136 | |
Yao Chen | 5f3dc87 | 2018-01-19 00:12:18 +0000 | [diff] [blame] | 137 | #LOCAL_INIT_RC := statsd.rc |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 138 | |
| 139 | include $(BUILD_EXECUTABLE) |
| 140 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 141 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 142 | # ============== |
| 143 | # statsd_test |
| 144 | # ============== |
| 145 | |
| 146 | include $(CLEAR_VARS) |
| 147 | |
| 148 | LOCAL_MODULE := statsd_test |
| 149 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 150 | LOCAL_MODULE_TAGS := tests |
| 151 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 152 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 153 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 154 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 155 | LOCAL_CFLAGS += \ |
| 156 | -Wall \ |
| 157 | -Werror \ |
| 158 | -Wno-missing-field-initializers \ |
| 159 | -Wno-unused-variable \ |
| 160 | -Wno-unused-function \ |
| 161 | -Wno-unused-parameter |
| 162 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 163 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 164 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 165 | tests/AnomalyMonitor_test.cpp \ |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 166 | tests/anomaly/AnomalyTracker_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 167 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 168 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 169 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 170 | tests/LogReader_test.cpp \ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 171 | tests/LogEvent_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 172 | tests/MetricsManager_test.cpp \ |
David Chen | d9269e2 | 2017-12-05 13:43:51 -0800 | [diff] [blame] | 173 | tests/StatsLogProcessor_test.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 174 | tests/UidMap_test.cpp \ |
Yao Chen | 967b205 | 2017-11-07 16:36:43 -0800 | [diff] [blame] | 175 | tests/condition/CombinationConditionTracker_test.cpp \ |
| 176 | tests/condition/SimpleConditionTracker_test.cpp \ |
Yao Chen | 93fe3a3 | 2017-11-02 13:52:59 -0700 | [diff] [blame] | 177 | tests/metrics/OringDurationTracker_test.cpp \ |
| 178 | tests/metrics/MaxDurationTracker_test.cpp \ |
| 179 | tests/metrics/CountMetricProducer_test.cpp \ |
Yangster | f2bee6f | 2017-11-29 12:01:05 -0800 | [diff] [blame] | 180 | tests/metrics/DurationMetricProducer_test.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 181 | tests/metrics/EventMetricProducer_test.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame] | 182 | tests/metrics/ValueMetricProducer_test.cpp \ |
Chenjie Yu | d9dfda7 | 2017-12-11 17:41:20 -0800 | [diff] [blame] | 183 | tests/metrics/GaugeMetricProducer_test.cpp \ |
Yao Chen | d5aa01b3 | 2017-12-19 16:46:36 -0800 | [diff] [blame] | 184 | tests/guardrail/StatsdStats_test.cpp \ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 185 | tests/metrics/metrics_test_helper.cpp \ |
| 186 | tests/statsd_test_util.cpp \ |
| 187 | tests/e2e/WakelockDuration_e2e_test.cpp \ |
Yangster-mac | b5bc741 | 2018-01-06 23:17:45 -0800 | [diff] [blame] | 188 | tests/e2e/MetricConditionLink_e2e_test.cpp \ |
Yangster-mac | 87718e2 | 2018-01-11 16:16:26 -0800 | [diff] [blame] | 189 | tests/e2e/Attribution_e2e_test.cpp \ |
| 190 | tests/e2e/GaugeMetric_e2e_test.cpp |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 191 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 192 | LOCAL_STATIC_LIBRARIES := \ |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 193 | $(statsd_common_static_libraries) \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 194 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 195 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 196 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 197 | |
| 198 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 199 | |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 200 | include $(BUILD_NATIVE_TEST) |
| 201 | |
Yao Chen | 459dee6 | 2018-01-10 16:47:05 -0800 | [diff] [blame] | 202 | ############################## |
| 203 | # stats proto static java lib |
| 204 | ############################## |
| 205 | |
| 206 | include $(CLEAR_VARS) |
| 207 | LOCAL_MODULE := statsdprotolite |
| 208 | |
| 209 | LOCAL_SRC_FILES := \ |
| 210 | src/stats_log.proto \ |
| 211 | src/statsd_config.proto \ |
| 212 | src/atoms.proto |
| 213 | |
| 214 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 215 | |
| 216 | LOCAL_STATIC_JAVA_LIBRARIES := \ |
| 217 | platformprotoslite |
| 218 | |
| 219 | include $(BUILD_STATIC_JAVA_LIBRARY) |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 220 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 221 | statsd_common_src:= |
| 222 | statsd_common_aidl_includes:= |
| 223 | statsd_common_c_includes:= |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 224 | statsd_common_static_libraries:= |
| 225 | statsd_common_shared_libraries:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 226 | |
Yao Chen | 1ff4f43 | 2017-11-16 17:01:40 -0800 | [diff] [blame] | 227 | |
| 228 | ############################## |
| 229 | |
Yao Chen | 459dee6 | 2018-01-10 16:47:05 -0800 | [diff] [blame] | 230 | include $(call all-makefiles-under,$(LOCAL_PATH)) |