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 \ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 22 | src/atoms_copy.proto \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 23 | src/anomaly/AnomalyMonitor.cpp \ |
Yangster-mac | e2cd6d5 | 2017-11-09 20:38:30 -0800 | [diff] [blame] | 24 | src/anomaly/AnomalyTracker.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 25 | src/condition/CombinationConditionTracker.cpp \ |
| 26 | src/condition/condition_util.cpp \ |
| 27 | src/condition/SimpleConditionTracker.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 28 | src/condition/ConditionWizard.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 29 | src/config/ConfigKey.cpp \ |
| 30 | src/config/ConfigListener.cpp \ |
| 31 | src/config/ConfigManager.cpp \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 32 | src/external/StatsCompanionServicePuller.cpp \ |
| 33 | src/external/ResourcePowerManagerPuller.cpp \ |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 34 | src/external/CpuTimePerUidPuller.cpp \ |
| 35 | src/external/CpuTimePerUidFreqPuller.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 36 | src/external/StatsPullerManagerImpl.cpp \ |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 37 | src/logd/LogEvent.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 38 | src/logd/LogListener.cpp \ |
| 39 | src/logd/LogReader.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 40 | src/matchers/CombinationLogMatchingTracker.cpp \ |
| 41 | src/matchers/matcher_util.cpp \ |
| 42 | src/matchers/SimpleLogMatchingTracker.cpp \ |
Yao Chen | b704177 | 2017-10-20 16:59:25 -0700 | [diff] [blame] | 43 | src/metrics/MetricProducer.cpp \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 44 | src/metrics/EventMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 45 | src/metrics/CountMetricProducer.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 46 | src/metrics/DurationMetricProducer.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 47 | src/metrics/duration_helper/OringDurationTracker.cpp \ |
| 48 | src/metrics/duration_helper/MaxDurationTracker.cpp \ |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 49 | src/metrics/ValueMetricProducer.cpp \ |
Yangster | 1d4d686 | 2017-10-31 12:58:51 -0700 | [diff] [blame] | 50 | src/metrics/GaugeMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 51 | src/metrics/MetricsManager.cpp \ |
| 52 | src/metrics/metrics_manager_util.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 53 | src/packages/UidMap.cpp \ |
| 54 | src/storage/DropboxReader.cpp \ |
| 55 | src/storage/DropboxWriter.cpp \ |
yro | 947fbce | 2017-11-15 22:50:23 -0800 | [diff] [blame] | 56 | src/storage/StorageManager.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 57 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 58 | src/StatsService.cpp \ |
Yao Chen | 8d9989b | 2017-11-18 18:54:50 -0800 | [diff] [blame] | 59 | src/stats_util.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame^] | 60 | src/guardrail/MemoryLeakTrackUtil.cpp \ |
| 61 | src/guardrail/StatsdStats.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 62 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 63 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 64 | $(LOCAL_PATH)/src \ |
| 65 | $(LOCAL_PATH)/../../libs/services/include |
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_aidl_includes := \ |
| 68 | $(LOCAL_PATH)/../../core/java |
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_shared_libraries := \ |
| 71 | libbase \ |
| 72 | libbinder \ |
| 73 | libcutils \ |
| 74 | libincident \ |
| 75 | liblog \ |
| 76 | libselinux \ |
| 77 | libutils \ |
| 78 | libservices \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 79 | libandroidfw \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 80 | libprotoutil \ |
| 81 | libstatslog \ |
| 82 | libhardware \ |
| 83 | libhardware_legacy \ |
| 84 | libhidlbase \ |
| 85 | libhidltransport \ |
| 86 | libhwbinder \ |
| 87 | android.hardware.power@1.0 \ |
Yao Chen | 8d9989b | 2017-11-18 18:54:50 -0800 | [diff] [blame] | 88 | android.hardware.power@1.1 \ |
| 89 | libmemunreachable |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 90 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 91 | # ========= |
| 92 | # statsd |
| 93 | # ========= |
| 94 | |
| 95 | include $(CLEAR_VARS) |
| 96 | |
| 97 | LOCAL_MODULE := statsd |
| 98 | |
| 99 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 100 | $(statsd_common_src) \ |
| 101 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 102 | |
| 103 | LOCAL_CFLAGS += \ |
| 104 | -Wall \ |
| 105 | -Werror \ |
| 106 | -Wno-missing-field-initializers \ |
| 107 | -Wno-unused-variable \ |
| 108 | -Wno-unused-function \ |
| 109 | -Wno-unused-parameter |
| 110 | |
| 111 | ifeq (debug,) |
| 112 | LOCAL_CFLAGS += \ |
| 113 | -g -O0 |
| 114 | else |
| 115 | # optimize for size (protobuf glop can get big) |
| 116 | LOCAL_CFLAGS += \ |
| 117 | -Os |
| 118 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 119 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 120 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 121 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 122 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 123 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 124 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 125 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 126 | |
| 127 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 128 | |
| 129 | #LOCAL_INIT_RC := statsd.rc |
| 130 | |
| 131 | include $(BUILD_EXECUTABLE) |
| 132 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 133 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 134 | # ============== |
| 135 | # statsd_test |
| 136 | # ============== |
| 137 | |
| 138 | include $(CLEAR_VARS) |
| 139 | |
| 140 | LOCAL_MODULE := statsd_test |
| 141 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 142 | LOCAL_MODULE_TAGS := tests |
| 143 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 144 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 145 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 146 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 147 | LOCAL_CFLAGS += \ |
| 148 | -Wall \ |
| 149 | -Werror \ |
| 150 | -Wno-missing-field-initializers \ |
| 151 | -Wno-unused-variable \ |
| 152 | -Wno-unused-function \ |
| 153 | -Wno-unused-parameter |
| 154 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 155 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 156 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 157 | tests/AnomalyMonitor_test.cpp \ |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 158 | tests/anomaly/AnomalyTracker_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 159 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 160 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 161 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 162 | tests/LogReader_test.cpp \ |
| 163 | tests/MetricsManager_test.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 164 | tests/UidMap_test.cpp \ |
Yao Chen | 967b205 | 2017-11-07 16:36:43 -0800 | [diff] [blame] | 165 | tests/condition/CombinationConditionTracker_test.cpp \ |
| 166 | tests/condition/SimpleConditionTracker_test.cpp \ |
Yao Chen | 93fe3a3 | 2017-11-02 13:52:59 -0700 | [diff] [blame] | 167 | tests/metrics/OringDurationTracker_test.cpp \ |
| 168 | tests/metrics/MaxDurationTracker_test.cpp \ |
| 169 | tests/metrics/CountMetricProducer_test.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 170 | tests/metrics/EventMetricProducer_test.cpp \ |
Yao Chen | b356151 | 2017-11-21 18:07:17 -0800 | [diff] [blame^] | 171 | tests/metrics/ValueMetricProducer_test.cpp \ |
| 172 | tests/guardrail/StatsdStats_test.cpp |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 173 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 174 | LOCAL_STATIC_LIBRARIES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 175 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 176 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 177 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 178 | |
| 179 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 180 | |
| 181 | statsd_common_src:= |
| 182 | statsd_common_aidl_includes:= |
| 183 | statsd_common_c_includes:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 184 | |
| 185 | include $(BUILD_NATIVE_TEST) |
Yao Chen | 1ff4f43 | 2017-11-16 17:01:40 -0800 | [diff] [blame] | 186 | |
| 187 | ############################## |
| 188 | |
| 189 | include $(call all-makefiles-under,$(LOCAL_PATH)) |