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 := \ |
yro | 31eb67b | 2017-10-24 13:33:21 -0700 | [diff] [blame] | 18 | ../../core/java/android/os/IStatsCallbacks.aidl \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 19 | ../../core/java/android/os/IStatsCompanionService.aidl \ |
| 20 | ../../core/java/android/os/IStatsManager.aidl \ |
| 21 | src/stats_log.proto \ |
| 22 | src/statsd_config.proto \ |
Yao Chen | 70b9863 | 2017-10-17 10:41:14 -0700 | [diff] [blame] | 23 | src/stats_events_copy.proto \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 24 | src/anomaly/AnomalyMonitor.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 \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 34 | src/external/StatsPullerManager.cpp \ |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 35 | src/logd/LogEvent.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 36 | src/logd/LogListener.cpp \ |
| 37 | src/logd/LogReader.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 38 | src/matchers/CombinationLogMatchingTracker.cpp \ |
| 39 | src/matchers/matcher_util.cpp \ |
| 40 | src/matchers/SimpleLogMatchingTracker.cpp \ |
| 41 | src/metrics/CountAnomalyTracker.cpp \ |
Yao Chen | b704177 | 2017-10-20 16:59:25 -0700 | [diff] [blame] | 42 | src/metrics/MetricProducer.cpp \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 43 | src/metrics/EventMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 44 | src/metrics/CountMetricProducer.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 45 | src/metrics/DurationMetricProducer.cpp \ |
Yao Chen | 5154a379 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 46 | src/metrics/duration_helper/OringDurationTracker.cpp \ |
| 47 | src/metrics/duration_helper/MaxDurationTracker.cpp \ |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 48 | src/metrics/ValueMetricProducer.cpp \ |
Yangster | 1d4d686 | 2017-10-31 12:58:51 -0700 | [diff] [blame] | 49 | src/metrics/GaugeMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 50 | src/metrics/MetricsManager.cpp \ |
| 51 | src/metrics/metrics_manager_util.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 52 | src/packages/UidMap.cpp \ |
| 53 | src/storage/DropboxReader.cpp \ |
| 54 | src/storage/DropboxWriter.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 55 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 56 | src/StatsService.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 57 | src/stats_util.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 58 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 59 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 60 | $(LOCAL_PATH)/src \ |
| 61 | $(LOCAL_PATH)/../../libs/services/include |
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_aidl_includes := \ |
| 64 | $(LOCAL_PATH)/../../core/java |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 65 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 66 | statsd_common_shared_libraries := \ |
| 67 | libbase \ |
| 68 | libbinder \ |
| 69 | libcutils \ |
| 70 | libincident \ |
| 71 | liblog \ |
| 72 | libselinux \ |
| 73 | libutils \ |
| 74 | libservices \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 75 | libandroidfw \ |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 76 | libprotoutil \ |
| 77 | libstatslog \ |
| 78 | libhardware \ |
| 79 | libhardware_legacy \ |
| 80 | libhidlbase \ |
| 81 | libhidltransport \ |
| 82 | libhwbinder \ |
| 83 | android.hardware.power@1.0 \ |
| 84 | android.hardware.power@1.1 |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 85 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 86 | # ========= |
| 87 | # statsd |
| 88 | # ========= |
| 89 | |
| 90 | include $(CLEAR_VARS) |
| 91 | |
| 92 | LOCAL_MODULE := statsd |
| 93 | |
| 94 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 95 | $(statsd_common_src) \ |
| 96 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 97 | |
| 98 | LOCAL_CFLAGS += \ |
| 99 | -Wall \ |
| 100 | -Werror \ |
| 101 | -Wno-missing-field-initializers \ |
| 102 | -Wno-unused-variable \ |
| 103 | -Wno-unused-function \ |
| 104 | -Wno-unused-parameter |
| 105 | |
| 106 | ifeq (debug,) |
| 107 | LOCAL_CFLAGS += \ |
| 108 | -g -O0 |
| 109 | else |
| 110 | # optimize for size (protobuf glop can get big) |
| 111 | LOCAL_CFLAGS += \ |
| 112 | -Os |
| 113 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 114 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 115 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 116 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 117 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 118 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame] | 119 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 120 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 121 | |
| 122 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 123 | |
| 124 | #LOCAL_INIT_RC := statsd.rc |
| 125 | |
| 126 | include $(BUILD_EXECUTABLE) |
| 127 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 128 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 129 | # ============== |
| 130 | # statsd_test |
| 131 | # ============== |
| 132 | |
| 133 | include $(CLEAR_VARS) |
| 134 | |
| 135 | LOCAL_MODULE := statsd_test |
| 136 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 137 | LOCAL_MODULE_TAGS := tests |
| 138 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 139 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 140 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 141 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 142 | LOCAL_CFLAGS += \ |
| 143 | -Wall \ |
| 144 | -Werror \ |
| 145 | -Wno-missing-field-initializers \ |
| 146 | -Wno-unused-variable \ |
| 147 | -Wno-unused-function \ |
| 148 | -Wno-unused-parameter |
| 149 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 150 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 151 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 152 | tests/AnomalyMonitor_test.cpp \ |
| 153 | tests/ConditionTracker_test.cpp \ |
| 154 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 155 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 156 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 157 | tests/LogReader_test.cpp \ |
| 158 | tests/MetricsManager_test.cpp \ |
Yao Chen | 5154a379 | 2017-10-30 22:57:06 -0700 | [diff] [blame] | 159 | tests/UidMap_test.cpp \ |
Yao Chen | 93fe3a3 | 2017-11-02 13:52:59 -0700 | [diff] [blame] | 160 | tests/metrics/OringDurationTracker_test.cpp \ |
| 161 | tests/metrics/MaxDurationTracker_test.cpp \ |
| 162 | tests/metrics/CountMetricProducer_test.cpp \ |
| 163 | tests/metrics/EventMetricProducer_test.cpp |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 164 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 165 | |
| 166 | LOCAL_STATIC_LIBRARIES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 167 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 168 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 169 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 170 | |
| 171 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 172 | |
| 173 | statsd_common_src:= |
| 174 | statsd_common_aidl_includes:= |
| 175 | statsd_common_c_includes:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 176 | |
| 177 | include $(BUILD_NATIVE_TEST) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 178 | |