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 \ |
| 32 | src/external/KernelWakelockPuller.cpp \ |
| 33 | src/external/StatsPullerManager.cpp \ |
Joe Onorato | c4dfae5 | 2017-10-17 23:38:21 -0700 | [diff] [blame] | 34 | src/logd/LogEvent.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 35 | src/logd/LogListener.cpp \ |
| 36 | src/logd/LogReader.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 37 | src/matchers/CombinationLogMatchingTracker.cpp \ |
| 38 | src/matchers/matcher_util.cpp \ |
| 39 | src/matchers/SimpleLogMatchingTracker.cpp \ |
| 40 | src/metrics/CountAnomalyTracker.cpp \ |
Yao Chen | b704177 | 2017-10-20 16:59:25 -0700 | [diff] [blame] | 41 | src/metrics/MetricProducer.cpp \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 42 | src/metrics/EventMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 43 | src/metrics/CountMetricProducer.cpp \ |
Yao Chen | 729093d | 2017-10-16 10:33:26 -0700 | [diff] [blame] | 44 | src/metrics/DurationMetricProducer.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 45 | src/metrics/MetricsManager.cpp \ |
| 46 | src/metrics/metrics_manager_util.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 47 | src/packages/UidMap.cpp \ |
| 48 | src/storage/DropboxReader.cpp \ |
| 49 | src/storage/DropboxWriter.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 50 | src/StatsLogProcessor.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 51 | src/StatsService.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 52 | src/stats_util.cpp |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 53 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 54 | statsd_common_c_includes := \ |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 55 | $(LOCAL_PATH)/src \ |
| 56 | $(LOCAL_PATH)/../../libs/services/include |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 57 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 58 | statsd_common_aidl_includes := \ |
| 59 | $(LOCAL_PATH)/../../core/java |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 60 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 61 | statsd_common_shared_libraries := \ |
| 62 | libbase \ |
| 63 | libbinder \ |
| 64 | libcutils \ |
| 65 | libincident \ |
| 66 | liblog \ |
| 67 | libselinux \ |
| 68 | libutils \ |
| 69 | libservices \ |
Yao Chen | 5110bed | 2017-10-23 12:50:02 -0700 | [diff] [blame] | 70 | libandroidfw \ |
| 71 | libprotoutil |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 72 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 73 | # ========= |
| 74 | # statsd |
| 75 | # ========= |
| 76 | |
| 77 | include $(CLEAR_VARS) |
| 78 | |
| 79 | LOCAL_MODULE := statsd |
| 80 | |
| 81 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 82 | $(statsd_common_src) \ |
| 83 | src/main.cpp |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 84 | |
| 85 | LOCAL_CFLAGS += \ |
| 86 | -Wall \ |
| 87 | -Werror \ |
| 88 | -Wno-missing-field-initializers \ |
| 89 | -Wno-unused-variable \ |
| 90 | -Wno-unused-function \ |
| 91 | -Wno-unused-parameter |
| 92 | |
| 93 | ifeq (debug,) |
| 94 | LOCAL_CFLAGS += \ |
| 95 | -g -O0 |
| 96 | else |
| 97 | # optimize for size (protobuf glop can get big) |
| 98 | LOCAL_CFLAGS += \ |
| 99 | -Os |
| 100 | endif |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 101 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 102 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 103 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 104 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
Yao Chen | ab273e2 | 2017-09-06 12:53:50 -0700 | [diff] [blame] | 105 | |
David Chen | d689689 | 2017-10-25 11:49:03 -0700 | [diff] [blame^] | 106 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \ |
| 107 | libgtest_prod |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 108 | |
| 109 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 110 | |
| 111 | #LOCAL_INIT_RC := statsd.rc |
| 112 | |
| 113 | include $(BUILD_EXECUTABLE) |
| 114 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 115 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 116 | # ============== |
| 117 | # statsd_test |
| 118 | # ============== |
| 119 | |
| 120 | include $(CLEAR_VARS) |
| 121 | |
| 122 | LOCAL_MODULE := statsd_test |
| 123 | LOCAL_COMPATIBILITY_SUITE := device-tests |
| 124 | LOCAL_MODULE_TAGS := tests |
| 125 | |
David Chen | 1481fe1 | 2017-10-16 13:16:34 -0700 | [diff] [blame] | 126 | LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 127 | LOCAL_C_INCLUDES += $(statsd_common_c_includes) |
David Chen | dd89694 | 2017-09-26 11:44:40 -0700 | [diff] [blame] | 128 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 129 | LOCAL_CFLAGS += \ |
| 130 | -Wall \ |
| 131 | -Werror \ |
| 132 | -Wno-missing-field-initializers \ |
| 133 | -Wno-unused-variable \ |
| 134 | -Wno-unused-function \ |
| 135 | -Wno-unused-parameter |
| 136 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 137 | LOCAL_SRC_FILES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 138 | $(statsd_common_src) \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 139 | tests/AnomalyMonitor_test.cpp \ |
| 140 | tests/ConditionTracker_test.cpp \ |
| 141 | tests/ConfigManager_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 142 | tests/indexed_priority_queue_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 143 | tests/LogEntryMatcher_test.cpp \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 144 | tests/LogReader_test.cpp \ |
| 145 | tests/MetricsManager_test.cpp \ |
Joe Onorato | 9fc9edf | 2017-10-15 20:08:52 -0700 | [diff] [blame] | 146 | tests/UidMap_test.cpp |
| 147 | |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 148 | |
| 149 | LOCAL_STATIC_LIBRARIES := \ |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 150 | libgmock |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 151 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 152 | LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) |
| 153 | |
| 154 | LOCAL_PROTOC_OPTIMIZE_TYPE := lite |
| 155 | |
| 156 | statsd_common_src:= |
| 157 | statsd_common_aidl_includes:= |
| 158 | statsd_common_c_includes:= |
Joe Onorato | 5dcbc6c | 2017-08-29 15:13:58 -0700 | [diff] [blame] | 159 | |
| 160 | include $(BUILD_NATIVE_TEST) |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 161 | |