blob: a7daa3f2b63aba4a5d057481109f627be5f753dc [file] [log] [blame]
Joe Onorato5dcbc6c2017-08-29 15:13:58 -07001# 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
15LOCAL_PATH:= $(call my-dir)
16
Yao Chend54f9dd2017-10-17 17:37:48 +000017statsd_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 \
Yangster-macd19bcae42018-01-04 15:43:39 -080022 src/statsd_internal.proto \
Joe Onorato62c220b2017-11-18 20:32:56 -080023 src/atoms.proto \
Yangster-mac20877162017-12-22 17:19:39 -080024 src/field_util.cpp \
25 src/stats_log_util.cpp \
26 src/dimension.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -070027 src/anomaly/AnomalyMonitor.cpp \
Yangster-mace2cd6d52017-11-09 20:38:30 -080028 src/anomaly/AnomalyTracker.cpp \
Bookatz857aaa52017-12-19 15:29:06 -080029 src/anomaly/DurationAnomalyTracker.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000030 src/condition/CombinationConditionTracker.cpp \
31 src/condition/condition_util.cpp \
32 src/condition/SimpleConditionTracker.cpp \
Yao Chen729093d2017-10-16 10:33:26 -070033 src/condition/ConditionWizard.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -070034 src/config/ConfigKey.cpp \
35 src/config/ConfigListener.cpp \
36 src/config/ConfigManager.cpp \
Primiano Tuccie4d44912018-01-10 12:14:50 +000037 src/external/Perfetto.cpp \
Chenjie Yub038b702017-12-18 15:15:34 -080038 src/external/StatsPuller.cpp \
Chenjie Yu5305e1d2017-10-31 13:49:36 -070039 src/external/StatsCompanionServicePuller.cpp \
Chenjie Yuc8b7f222018-01-11 23:25:57 -080040 src/external/SubsystemSleepStatePuller.cpp \
Chenjie Yue33bc3b2017-11-06 17:56:44 -080041 src/external/CpuTimePerUidPuller.cpp \
42 src/external/CpuTimePerUidFreqPuller.cpp \
Chenjie Yu6736c892017-11-09 10:50:09 -080043 src/external/StatsPullerManagerImpl.cpp \
Joe Onoratoc4dfae52017-10-17 23:38:21 -070044 src/logd/LogEvent.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -070045 src/logd/LogListener.cpp \
46 src/logd/LogReader.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000047 src/matchers/CombinationLogMatchingTracker.cpp \
48 src/matchers/matcher_util.cpp \
49 src/matchers/SimpleLogMatchingTracker.cpp \
Yao Chenb7041772017-10-20 16:59:25 -070050 src/metrics/MetricProducer.cpp \
Yao Chen5110bed2017-10-23 12:50:02 -070051 src/metrics/EventMetricProducer.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000052 src/metrics/CountMetricProducer.cpp \
Yao Chen729093d2017-10-16 10:33:26 -070053 src/metrics/DurationMetricProducer.cpp \
Yao Chen5154a372017-10-30 22:57:06 -070054 src/metrics/duration_helper/OringDurationTracker.cpp \
55 src/metrics/duration_helper/MaxDurationTracker.cpp \
Chenjie Yub3dda412017-10-24 13:41:59 -070056 src/metrics/ValueMetricProducer.cpp \
Yangster1d4d6862017-10-31 12:58:51 -070057 src/metrics/GaugeMetricProducer.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000058 src/metrics/MetricsManager.cpp \
59 src/metrics/metrics_manager_util.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -070060 src/packages/UidMap.cpp \
Primiano Tuccie4d44912018-01-10 12:14:50 +000061 src/perfetto/perfetto_config.proto \
yro947fbce2017-11-15 22:50:23 -080062 src/storage/StorageManager.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000063 src/StatsLogProcessor.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +000064 src/StatsService.cpp \
Yao Chend5aa01b32017-12-19 16:46:36 -080065 src/HashableDimensionKey.cpp \
Yao Chenb3561512017-11-21 18:07:17 -080066 src/guardrail/MemoryLeakTrackUtil.cpp \
67 src/guardrail/StatsdStats.cpp
Yao Chenab273e22017-09-06 12:53:50 -070068
Yao Chend54f9dd2017-10-17 17:37:48 +000069statsd_common_c_includes := \
David Chen1481fe12017-10-16 13:16:34 -070070 $(LOCAL_PATH)/src \
71 $(LOCAL_PATH)/../../libs/services/include
Yao Chenab273e22017-09-06 12:53:50 -070072
Yao Chend54f9dd2017-10-17 17:37:48 +000073statsd_common_aidl_includes := \
74 $(LOCAL_PATH)/../../core/java
Yao Chenab273e22017-09-06 12:53:50 -070075
Joe Onorato62c220b2017-11-18 20:32:56 -080076statsd_common_static_libraries := \
77 libplatformprotos
78
Yao Chend54f9dd2017-10-17 17:37:48 +000079statsd_common_shared_libraries := \
80 libbase \
81 libbinder \
82 libcutils \
83 libincident \
84 liblog \
85 libselinux \
86 libutils \
87 libservices \
Chenjie Yu5305e1d2017-10-31 13:49:36 -070088 libprotoutil \
89 libstatslog \
90 libhardware \
91 libhardware_legacy \
92 libhidlbase \
93 libhidltransport \
94 libhwbinder \
95 android.hardware.power@1.0 \
Yao Chen8d9989b2017-11-18 18:54:50 -080096 android.hardware.power@1.1 \
97 libmemunreachable
Yao Chenab273e22017-09-06 12:53:50 -070098
Joe Onorato5dcbc6c2017-08-29 15:13:58 -070099# =========
100# statsd
101# =========
102
103include $(CLEAR_VARS)
104
105LOCAL_MODULE := statsd
106
107LOCAL_SRC_FILES := \
Yao Chend54f9dd2017-10-17 17:37:48 +0000108 $(statsd_common_src) \
109 src/main.cpp
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700110
111LOCAL_CFLAGS += \
112 -Wall \
113 -Werror \
114 -Wno-missing-field-initializers \
115 -Wno-unused-variable \
116 -Wno-unused-function \
117 -Wno-unused-parameter
118
119ifeq (debug,)
120 LOCAL_CFLAGS += \
121 -g -O0
122else
123 # optimize for size (protobuf glop can get big)
124 LOCAL_CFLAGS += \
125 -Os
126endif
Yao Chend54f9dd2017-10-17 17:37:48 +0000127LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700128
David Chen1481fe12017-10-16 13:16:34 -0700129LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes)
Yao Chend54f9dd2017-10-17 17:37:48 +0000130LOCAL_C_INCLUDES += $(statsd_common_c_includes)
Yao Chenab273e22017-09-06 12:53:50 -0700131
Joe Onorato62c220b2017-11-18 20:32:56 -0800132LOCAL_STATIC_LIBRARIES := $(statsd_common_static_libraries)
133
David Chend6896892017-10-25 11:49:03 -0700134LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries) \
135 libgtest_prod
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700136
137LOCAL_MODULE_CLASS := EXECUTABLES
138
Yao Chenb00cce82018-01-22 22:54:26 +0000139LOCAL_INIT_RC := statsd.rc
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700140
141include $(BUILD_EXECUTABLE)
142
Yao Chend54f9dd2017-10-17 17:37:48 +0000143
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700144# ==============
145# statsd_test
146# ==============
147
148include $(CLEAR_VARS)
149
150LOCAL_MODULE := statsd_test
151LOCAL_COMPATIBILITY_SUITE := device-tests
152LOCAL_MODULE_TAGS := tests
153
David Chen1481fe12017-10-16 13:16:34 -0700154LOCAL_AIDL_INCLUDES := $(statsd_common_aidl_includes)
Yao Chend54f9dd2017-10-17 17:37:48 +0000155LOCAL_C_INCLUDES += $(statsd_common_c_includes)
David Chendd896942017-09-26 11:44:40 -0700156
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700157LOCAL_CFLAGS += \
158 -Wall \
159 -Werror \
160 -Wno-missing-field-initializers \
161 -Wno-unused-variable \
162 -Wno-unused-function \
163 -Wno-unused-parameter
164
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700165LOCAL_SRC_FILES := \
Yao Chend54f9dd2017-10-17 17:37:48 +0000166 $(statsd_common_src) \
Joe Onorato9fc9edf2017-10-15 20:08:52 -0700167 tests/AnomalyMonitor_test.cpp \
Yang Lu3eba6212017-10-25 19:54:45 -0700168 tests/anomaly/AnomalyTracker_test.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -0700169 tests/ConfigManager_test.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +0000170 tests/indexed_priority_queue_test.cpp \
Joe Onorato9fc9edf2017-10-15 20:08:52 -0700171 tests/LogEntryMatcher_test.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +0000172 tests/LogReader_test.cpp \
Yangster-mac20877162017-12-22 17:19:39 -0800173 tests/LogEvent_test.cpp \
Yao Chend54f9dd2017-10-17 17:37:48 +0000174 tests/MetricsManager_test.cpp \
David Chend9269e22017-12-05 13:43:51 -0800175 tests/StatsLogProcessor_test.cpp \
Yao Chen5154a372017-10-30 22:57:06 -0700176 tests/UidMap_test.cpp \
Yao Chen967b2052017-11-07 16:36:43 -0800177 tests/condition/CombinationConditionTracker_test.cpp \
178 tests/condition/SimpleConditionTracker_test.cpp \
Yao Chen93fe3a32017-11-02 13:52:59 -0700179 tests/metrics/OringDurationTracker_test.cpp \
180 tests/metrics/MaxDurationTracker_test.cpp \
181 tests/metrics/CountMetricProducer_test.cpp \
Yangsterf2bee6f2017-11-29 12:01:05 -0800182 tests/metrics/DurationMetricProducer_test.cpp \
Chenjie Yu6736c892017-11-09 10:50:09 -0800183 tests/metrics/EventMetricProducer_test.cpp \
Yao Chenb3561512017-11-21 18:07:17 -0800184 tests/metrics/ValueMetricProducer_test.cpp \
Chenjie Yud9dfda72017-12-11 17:41:20 -0800185 tests/metrics/GaugeMetricProducer_test.cpp \
Yao Chend5aa01b32017-12-19 16:46:36 -0800186 tests/guardrail/StatsdStats_test.cpp \
Yangster-mac20877162017-12-22 17:19:39 -0800187 tests/metrics/metrics_test_helper.cpp \
188 tests/statsd_test_util.cpp \
189 tests/e2e/WakelockDuration_e2e_test.cpp \
Yangster-macb5bc7412018-01-06 23:17:45 -0800190 tests/e2e/MetricConditionLink_e2e_test.cpp \
Yangster-mac87718e22018-01-11 16:16:26 -0800191 tests/e2e/Attribution_e2e_test.cpp \
192 tests/e2e/GaugeMetric_e2e_test.cpp
Joe Onorato9fc9edf2017-10-15 20:08:52 -0700193
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700194LOCAL_STATIC_LIBRARIES := \
Joe Onorato62c220b2017-11-18 20:32:56 -0800195 $(statsd_common_static_libraries) \
Yao Chend54f9dd2017-10-17 17:37:48 +0000196 libgmock
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700197
Yao Chend54f9dd2017-10-17 17:37:48 +0000198LOCAL_SHARED_LIBRARIES := $(statsd_common_shared_libraries)
199
200LOCAL_PROTOC_OPTIMIZE_TYPE := lite
201
Joe Onorato62c220b2017-11-18 20:32:56 -0800202include $(BUILD_NATIVE_TEST)
203
Yao Chen459dee62018-01-10 16:47:05 -0800204##############################
205# stats proto static java lib
206##############################
207
208include $(CLEAR_VARS)
209LOCAL_MODULE := statsdprotolite
210
211LOCAL_SRC_FILES := \
212 src/stats_log.proto \
213 src/statsd_config.proto \
Primiano Tuccie4d44912018-01-10 12:14:50 +0000214 src/perfetto/perfetto_config.proto \
Yao Chen459dee62018-01-10 16:47:05 -0800215 src/atoms.proto
216
217LOCAL_PROTOC_OPTIMIZE_TYPE := lite
218
219LOCAL_STATIC_JAVA_LIBRARIES := \
220 platformprotoslite
221
222include $(BUILD_STATIC_JAVA_LIBRARY)
Joe Onorato62c220b2017-11-18 20:32:56 -0800223
Yao Chend54f9dd2017-10-17 17:37:48 +0000224statsd_common_src:=
225statsd_common_aidl_includes:=
226statsd_common_c_includes:=
Joe Onorato62c220b2017-11-18 20:32:56 -0800227statsd_common_static_libraries:=
228statsd_common_shared_libraries:=
Joe Onorato5dcbc6c2017-08-29 15:13:58 -0700229
Yao Chen1ff4f432017-11-16 17:01:40 -0800230
231##############################
232
Yao Chen459dee62018-01-10 16:47:05 -0800233include $(call all-makefiles-under,$(LOCAL_PATH))