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 \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 56 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 57 | src/StatsService.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 58 | src/stats_util.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 59 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 60 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 61 | $(LOCAL_PATH)/src \ |
| 62 | $(LOCAL_PATH)/../../libs/services/include |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 63 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 64 | statsd_common_aidl_includes := \ |
| 65 | $(LOCAL_PATH)/../../core/java |
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_shared_libraries := \ |
| 68 | libbase \ |
| 69 | libbinder \ |
| 70 | libcutils \ |
| 71 | libincident \ |
| 72 | liblog \ |
| 73 | libselinux \ |
| 74 | libutils \ |
| 75 | libservices \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 76 | libandroidfw \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 77 | libprotoutil \ |
| 78 | libstatslog \ |
| 79 | libhardware \ |
| 80 | libhardware_legacy \ |
| 81 | libhidlbase \ |
| 82 | libhidltransport \ |
| 83 | libhwbinder \ |
| 84 | android.hardware.power@1.0 \ |
| 85 | android.hardware.power@1.1 |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 86 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 87 | # ========= |
| 88 | # statsd |
| 89 | # ========= |
| 90 | |
| 91 | include $(CLEAR_VARS) |
| 92 | |
| 93 | LOCAL_MODULE := statsd |
| 94 | |
| 95 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 96 | $(statsd_common_src) \ |
| 97 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 98 | |
| 99 | LOCAL_CFLAGS += \ |
| 100 | -Wall \ |
| 101 | -Werror \ |
| 102 | -Wno-missing-field-initializers \ |
| 103 | -Wno-unused-variable \ |
| 104 | -Wno-unused-function \ |
| 105 | -Wno-unused-parameter |
| 106 | |
| 107 | ifeq (debug,) |
| 108 | LOCAL_CFLAGS += \ |
| 109 | -g -O0 |
| 110 | else |
| 111 | # optimize for size (protobuf glop can get big) |
| 112 | LOCAL_CFLAGS += \ |
| 113 | -Os |
| 114 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 115 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 116 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 117 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 118 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 119 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 120 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 121 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 122 | |
| 123 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 124 | |
| 125 | #LOCAL_INIT_RC := statsd.rc |
| 126 | |
| 127 | include $(BUILD_EXECUTABLE) |
| 128 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 129 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 130 | # ============== |
| 131 | # statsd_test |
| 132 | # ============== |
| 133 | |
| 134 | include $(CLEAR_VARS) |
| 135 | |
| 136 | LOCAL_MODULE := statsd_test |
| 137 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 138 | LOCAL_MODULE_TAGS := tests |
| 139 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 140 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 141 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 142 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 143 | LOCAL_CFLAGS += \ |
| 144 | -Wall \ |
| 145 | -Werror \ |
| 146 | -Wno-missing-field-initializers \ |
| 147 | -Wno-unused-variable \ |
| 148 | -Wno-unused-function \ |
| 149 | -Wno-unused-parameter |
| 150 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 151 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 152 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 153 | tests/AnomalyMonitor_test.cpp \ |
Yang Lu | 3eba621 | 2017-10-25 19:54:45 -0700 | [diff] [blame] | 154 | tests/anomaly/AnomalyTracker_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 155 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 156 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 157 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 158 | tests/LogReader_test.cpp \ |
| 159 | tests/MetricsManager_test.cpp \ |
Yao Chen | 5154a37 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 160 | tests/UidMap_test.cpp \ |
Yao Chen | 967b205 | 2017-11-07 16:36:43 -0800 | [diff] [blame] | 161 | tests/condition/CombinationConditionTracker_test.cpp \ |
| 162 | tests/condition/SimpleConditionTracker_test.cpp \ |
Yao Chen | 93fe3a3 | 2017-11-02 13:52:59 -0700 | [diff] [blame] | 163 | tests/metrics/OringDurationTracker_test.cpp \ |
| 164 | tests/metrics/MaxDurationTracker_test.cpp \ |
| 165 | tests/metrics/CountMetricProducer_test.cpp \ |
Chenjie Yu | 6736c89 | 2017-11-09 10:50:09 -0800 | [diff] [blame] | 166 | tests/metrics/EventMetricProducer_test.cpp \ |
| 167 | tests/metrics/ValueMetricProducer_test.cpp |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 168 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 169 | LOCAL_STATIC_LIBRARIES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 170 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 171 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 172 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 173 | |
| 174 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 175 | |
| 176 | statsd_common_src:= |
| 177 | statsd_common_aidl_includes:= |
| 178 | statsd_common_c_includes:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 179 | |
| 180 | include $(BUILD_NATIVE_TEST) |
Yao Chen | 1ff4f43 | 2017-11-16 17:01:40 -0800 | [diff] [blame^] | 181 | |
| 182 | ############################## |
| 183 | |
| 184 | include $(call all-makefiles-under,$(LOCAL_PATH)) |