blob: 8ce4c04ae0193eba12a7abddfdeb4b27c5e3087b [file] [log] [blame]
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -08001// Copyright (C) 2020 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
Bob Badour4da7d222021-02-22 16:14:07 -080015package {
16 default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080019cc_defaults {
20 name: "carwatchdogd_defaults",
21 cflags: [
22 "-Wall",
23 "-Wno-missing-field-initializers",
24 "-Werror",
25 "-Wno-unused-variable",
26 "-Wunused-parameter",
Jooyung Han23598092021-01-06 15:49:53 +090027 "-Wno-error=deprecated",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080028 ],
29 include_dirs: [
Baligh Uddin919323d2020-10-25 18:13:46 +000030 "system/libbase/include",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080031 ],
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -070032 shared_libs: [
Jeongik Chad589dc02021-01-28 00:49:50 +090033 "android.automotive.watchdog-V3-cpp",
34 "android.automotive.watchdog.internal-cpp",
Jeongik Cha82d29d22021-02-11 09:57:26 +090035 "android.automotive.watchdog.internal-cpp",
36 "android.automotive.watchdog-V3-cpp",
Lakshman Annadorai8dfeeaf2020-12-15 14:10:53 -080037 "android.hardware.automotive.vehicle@2.0",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -070038 "libbase",
39 "libbinder",
40 "liblog",
41 "libutils",
42 ],
Yifan Hong6e1f50d2021-04-28 13:54:39 -070043 header_libs: [
44 "libgtest_prod_headers",
Lakshman Annadoraie4054622020-11-10 14:09:42 -080045 ],
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080046}
47
Lakshman Annadoraif3abe482020-08-07 16:52:45 -070048cc_library {
Lakshman Annadorai37975c92021-01-06 11:03:13 -080049 name: "libwatchdog_package_info_resolver",
Lakshman Annadoraif3abe482020-08-07 16:52:45 -070050 srcs: [
Lakshman Annadorai37975c92021-01-06 11:03:13 -080051 "src/PackageInfoResolver.cpp",
Lakshman Annadoraif3abe482020-08-07 16:52:45 -070052 ],
53 defaults: [
54 "carwatchdogd_defaults",
55 ],
56 shared_libs: [
57 "libcutils",
58 ],
Lakshman Annadoraif3abe482020-08-07 16:52:45 -070059 export_include_dirs: [
Lakshman Annadorai37975c92021-01-06 11:03:13 -080060 "src",
Lakshman Annadoraif3abe482020-08-07 16:52:45 -070061 ],
62}
63
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080064cc_defaults {
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -070065 name: "libwatchdog_perf_service_defaults",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080066 shared_libs: [
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080067 "libcutils",
Lakshman Annadoraif2855b22020-03-03 14:13:10 -080068 "libprocessgroup",
Lakshman Annadorai9fb0eea2021-05-19 09:00:42 -070069 "libtinyxml2",
Lakshman Annadorai37975c92021-01-06 11:03:13 -080070 "libwatchdog_package_info_resolver",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080071 ],
72}
73
74cc_library {
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -070075 name: "libwatchdog_perf_service",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080076 defaults: [
77 "carwatchdogd_defaults",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -070078 "libwatchdog_perf_service_defaults",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080079 ],
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080080 srcs: [
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -070081 "src/WatchdogPerfService.cpp",
Lakshman Annadoraiaf6486c2020-10-09 12:41:45 -070082 "src/IoOveruseConfigs.cpp",
Lakshman Annadoraie166c8b2020-10-09 12:36:50 -070083 "src/IoOveruseMonitor.cpp",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -080084 "src/IoPerfCollection.cpp",
Lakshman Annadoraif2855b22020-03-03 14:13:10 -080085 "src/LooperWrapper.cpp",
Lakshman Annadorai9fb0eea2021-05-19 09:00:42 -070086 "src/OveruseConfigurationXmlHelper.cpp",
Lakshman Annadoraia0a14592021-02-03 12:45:17 -080087 "src/ProcDiskStats.cpp",
Lakshman Annadorai2fce0012020-02-18 14:05:22 -080088 "src/ProcPidStat.cpp",
89 "src/ProcStat.cpp",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080090 "src/UidIoStats.cpp",
91 ],
Lakshman Annadorai52877702020-03-25 14:29:52 -070092 whole_static_libs: [
93 "libwatchdog_properties",
94 ],
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -080095 export_include_dirs: [
96 "src",
97 ],
98}
99
Lakshman Annadorai9fb0eea2021-05-19 09:00:42 -0700100filegroup {
101 name: "watchdog_test_xml_files",
102 srcs: [
103 "tests/data/*.xml",
104 ],
105}
106
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -0800107cc_test {
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700108 name: "libwatchdog_test",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -0800109 defaults: [
110 "carwatchdogd_defaults",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700111 "libwatchdog_perf_service_defaults",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700112 "libwatchdog_process_service_defaults",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -0800113 ],
114 test_suites: ["general-tests"],
115 srcs: [
Lakshman Annadoraiaf6486c2020-10-09 12:41:45 -0700116 "tests/IoOveruseConfigsTest.cpp",
Lakshman Annadorai9be76512021-02-10 13:48:58 -0800117 "tests/IoOveruseMonitorTest.cpp",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -0800118 "tests/IoPerfCollectionTest.cpp",
Lakshman Annadoraif2855b22020-03-03 14:13:10 -0800119 "tests/LooperStub.cpp",
Lakshman Annadorai9fb0eea2021-05-19 09:00:42 -0700120 "tests/OveruseConfigurationTestUtils.cpp",
121 "tests/OveruseConfigurationXmlHelperTest.cpp",
Lakshman Annadorai37975c92021-01-06 11:03:13 -0800122 "tests/PackageInfoResolverTest.cpp",
Lakshman Annadoraia0a14592021-02-03 12:45:17 -0800123 "tests/ProcDiskStatsTest.cpp",
Lakshman Annadorai325e9652020-02-20 17:27:11 -0800124 "tests/ProcPidDir.cpp",
Lakshman Annadorai2fce0012020-02-18 14:05:22 -0800125 "tests/ProcPidStatTest.cpp",
Lakshman Annadoraif9b47c22020-02-10 16:45:18 -0800126 "tests/ProcStatTest.cpp",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700127 "tests/UidIoStatsTest.cpp",
128 "tests/WatchdogBinderMediatorTest.cpp",
Lakshman Annadorai967b21e2020-10-30 09:35:29 -0700129 "tests/WatchdogInternalHandlerTest.cpp",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700130 "tests/WatchdogPerfServiceTest.cpp",
Eric Jeong951f2aa2020-03-31 12:18:00 -0700131 "tests/WatchdogProcessServiceTest.cpp",
Lakshman Annadoraie4054622020-11-10 14:09:42 -0800132 "tests/WatchdogServiceHelperTest.cpp",
Lakshman Annadoraiab4d3fd2020-02-06 11:24:56 -0800133 ],
134 static_libs: [
135 "libgmock",
136 "libgtest",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700137 "libwatchdog_binder_mediator",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700138 "libwatchdog_perf_service",
Lakshman Annadorai8dfeeaf2020-12-15 14:10:53 -0800139 "libwatchdog_process_service",
Lakshman Annadorai37975c92021-01-06 11:03:13 -0800140 "libwatchdog_package_info_resolver",
Lakshman Annadorai6094e9a2020-01-31 10:03:33 -0800141 ],
Lakshman Annadorai9fb0eea2021-05-19 09:00:42 -0700142 data: [":watchdog_test_xml_files"],
Eric Jeong34edd982019-12-17 17:26:35 -0800143}
144
145cc_defaults {
146 name: "libwatchdog_process_service_defaults",
147 shared_libs: [
Eric Jeong3a4b6352020-08-18 18:06:53 -0700148 "libhidlbase",
Eric Jeong34edd982019-12-17 17:26:35 -0800149 ],
150}
151
152cc_library {
153 name: "libwatchdog_process_service",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700154 srcs: [
155 "src/WatchdogProcessService.cpp",
156 ],
Eric Jeong34edd982019-12-17 17:26:35 -0800157 defaults: [
158 "carwatchdogd_defaults",
159 "libwatchdog_process_service_defaults"
160 ],
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700161}
162
163cc_library {
164 name: "libwatchdog_binder_mediator",
165 defaults: [
166 "carwatchdogd_defaults",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700167 "libwatchdog_perf_service_defaults",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700168 "libwatchdog_process_service_defaults",
169 ],
Eric Jeong34edd982019-12-17 17:26:35 -0800170 srcs: [
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700171 "src/WatchdogBinderMediator.cpp",
Lakshman Annadorai967b21e2020-10-30 09:35:29 -0700172 "src/WatchdogInternalHandler.cpp",
Lakshman Annadoraie4054622020-11-10 14:09:42 -0800173 "src/WatchdogServiceHelper.cpp",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700174 ],
175 shared_libs: [
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700176 "libwatchdog_perf_service",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700177 "libwatchdog_process_service",
178 ],
179 export_include_dirs: [
180 "src",
Eric Jeong34edd982019-12-17 17:26:35 -0800181 ],
182}
183
184cc_binary {
185 name: "carwatchdogd",
186 defaults: [
187 "carwatchdogd_defaults",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700188 "libwatchdog_perf_service_defaults",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700189 "libwatchdog_process_service_defaults",
Eric Jeong34edd982019-12-17 17:26:35 -0800190 ],
191 srcs: [
192 "src/main.cpp",
Eric Jeong69e99782020-02-12 17:41:00 -0800193 "src/ServiceManager.cpp",
Eric Jeong34edd982019-12-17 17:26:35 -0800194 ],
195 init_rc: ["carwatchdogd.rc"],
196 shared_libs: [
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700197 "libwatchdog_binder_mediator",
Lakshman Annadoraid9a2c6e2020-09-03 11:52:06 -0700198 "libwatchdog_perf_service",
Lakshman Annadorai0dfeeeb2020-03-13 16:57:12 -0700199 "libwatchdog_process_service",
Lakshman Annadorai37975c92021-01-06 11:03:13 -0800200 "libwatchdog_package_info_resolver",
Eric Jeong34edd982019-12-17 17:26:35 -0800201 ],
Eric Jeongae2c04c2020-02-21 09:18:31 -0800202 vintf_fragments: ["carwatchdogd.xml"],
Lakshman Annadorai1b366082021-06-01 13:57:04 -0700203 required: [
204 "system_resource_overuse_configuration.xml",
205 "third_party_resource_overuse_configuration.xml",
206 ],
207}
208
209prebuilt_etc {
210 name: "system_resource_overuse_configuration.xml",
211 src: "data/system_resource_overuse_configuration.xml",
212 sub_dir: "automotive/watchdog/",
213}
214
215prebuilt_etc {
216 name: "third_party_resource_overuse_configuration.xml",
217 src: "data/third_party_resource_overuse_configuration.xml",
218 sub_dir: "automotive/watchdog/",
Eric Jeong34edd982019-12-17 17:26:35 -0800219}