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