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