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