Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 1 | // 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 Badour | 4da7d22 | 2021-02-22 16:14:07 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 19 | cc_defaults { |
| 20 | name: "carwatchdogd_defaults", |
| 21 | cflags: [ |
| 22 | "-Wall", |
| 23 | "-Wno-missing-field-initializers", |
| 24 | "-Werror", |
| 25 | "-Wno-unused-variable", |
| 26 | "-Wunused-parameter", |
Jooyung Han | 2359809 | 2021-01-06 15:49:53 +0900 | [diff] [blame] | 27 | "-Wno-error=deprecated", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 28 | ], |
| 29 | include_dirs: [ |
Baligh Uddin | 919323d | 2020-10-25 18:13:46 +0000 | [diff] [blame] | 30 | "system/libbase/include", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 31 | ], |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 32 | shared_libs: [ |
Jeongik Cha | d589dc0 | 2021-01-28 00:49:50 +0900 | [diff] [blame] | 33 | "android.automotive.watchdog-V3-cpp", |
| 34 | "android.automotive.watchdog.internal-cpp", |
Jeongik Cha | 82d29d2 | 2021-02-11 09:57:26 +0900 | [diff] [blame] | 35 | "android.automotive.watchdog.internal-cpp", |
| 36 | "android.automotive.watchdog-V3-cpp", |
Lakshman Annadorai | 8dfeeaf | 2020-12-15 14:10:53 -0800 | [diff] [blame] | 37 | "android.hardware.automotive.vehicle@2.0", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 38 | "libbase", |
| 39 | "libbinder", |
| 40 | "liblog", |
| 41 | "libutils", |
| 42 | ], |
Yifan Hong | 6e1f50d | 2021-04-28 13:54:39 -0700 | [diff] [blame] | 43 | header_libs: [ |
| 44 | "libgtest_prod_headers", |
Lakshman Annadorai | e405462 | 2020-11-10 14:09:42 -0800 | [diff] [blame] | 45 | ], |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 46 | } |
| 47 | |
Lakshman Annadorai | f3abe48 | 2020-08-07 16:52:45 -0700 | [diff] [blame] | 48 | cc_library { |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 49 | name: "libwatchdog_package_info_resolver", |
Lakshman Annadorai | f3abe48 | 2020-08-07 16:52:45 -0700 | [diff] [blame] | 50 | srcs: [ |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 51 | "src/PackageInfoResolver.cpp", |
Lakshman Annadorai | f3abe48 | 2020-08-07 16:52:45 -0700 | [diff] [blame] | 52 | ], |
| 53 | defaults: [ |
| 54 | "carwatchdogd_defaults", |
| 55 | ], |
| 56 | shared_libs: [ |
| 57 | "libcutils", |
| 58 | ], |
Lakshman Annadorai | f3abe48 | 2020-08-07 16:52:45 -0700 | [diff] [blame] | 59 | export_include_dirs: [ |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 60 | "src", |
Lakshman Annadorai | f3abe48 | 2020-08-07 16:52:45 -0700 | [diff] [blame] | 61 | ], |
| 62 | } |
| 63 | |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 64 | cc_defaults { |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 65 | name: "libwatchdog_perf_service_defaults", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 66 | shared_libs: [ |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 67 | "libcutils", |
Lakshman Annadorai | f2855b2 | 2020-03-03 14:13:10 -0800 | [diff] [blame] | 68 | "libprocessgroup", |
Lakshman Annadorai | 9fb0eea | 2021-05-19 09:00:42 -0700 | [diff] [blame] | 69 | "libtinyxml2", |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 70 | "libwatchdog_package_info_resolver", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 71 | ], |
| 72 | } |
| 73 | |
| 74 | cc_library { |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 75 | name: "libwatchdog_perf_service", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 76 | defaults: [ |
| 77 | "carwatchdogd_defaults", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 78 | "libwatchdog_perf_service_defaults", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 79 | ], |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 80 | srcs: [ |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 81 | "src/WatchdogPerfService.cpp", |
Lakshman Annadorai | af6486c | 2020-10-09 12:41:45 -0700 | [diff] [blame] | 82 | "src/IoOveruseConfigs.cpp", |
Lakshman Annadorai | e166c8b | 2020-10-09 12:36:50 -0700 | [diff] [blame] | 83 | "src/IoOveruseMonitor.cpp", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 84 | "src/IoPerfCollection.cpp", |
Lakshman Annadorai | f2855b2 | 2020-03-03 14:13:10 -0800 | [diff] [blame] | 85 | "src/LooperWrapper.cpp", |
Lakshman Annadorai | 9fb0eea | 2021-05-19 09:00:42 -0700 | [diff] [blame] | 86 | "src/OveruseConfigurationXmlHelper.cpp", |
Lakshman Annadorai | a0a1459 | 2021-02-03 12:45:17 -0800 | [diff] [blame] | 87 | "src/ProcDiskStats.cpp", |
Lakshman Annadorai | 2fce001 | 2020-02-18 14:05:22 -0800 | [diff] [blame] | 88 | "src/ProcPidStat.cpp", |
| 89 | "src/ProcStat.cpp", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 90 | "src/UidIoStats.cpp", |
| 91 | ], |
Lakshman Annadorai | 5287770 | 2020-03-25 14:29:52 -0700 | [diff] [blame] | 92 | whole_static_libs: [ |
| 93 | "libwatchdog_properties", |
| 94 | ], |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 95 | export_include_dirs: [ |
| 96 | "src", |
| 97 | ], |
| 98 | } |
| 99 | |
Lakshman Annadorai | 9fb0eea | 2021-05-19 09:00:42 -0700 | [diff] [blame] | 100 | filegroup { |
| 101 | name: "watchdog_test_xml_files", |
| 102 | srcs: [ |
| 103 | "tests/data/*.xml", |
| 104 | ], |
| 105 | } |
| 106 | |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 107 | cc_test { |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 108 | name: "libwatchdog_test", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 109 | defaults: [ |
| 110 | "carwatchdogd_defaults", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 111 | "libwatchdog_perf_service_defaults", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 112 | "libwatchdog_process_service_defaults", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 113 | ], |
| 114 | test_suites: ["general-tests"], |
| 115 | srcs: [ |
Lakshman Annadorai | af6486c | 2020-10-09 12:41:45 -0700 | [diff] [blame] | 116 | "tests/IoOveruseConfigsTest.cpp", |
Lakshman Annadorai | 9be7651 | 2021-02-10 13:48:58 -0800 | [diff] [blame] | 117 | "tests/IoOveruseMonitorTest.cpp", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 118 | "tests/IoPerfCollectionTest.cpp", |
Lakshman Annadorai | f2855b2 | 2020-03-03 14:13:10 -0800 | [diff] [blame] | 119 | "tests/LooperStub.cpp", |
Lakshman Annadorai | 9fb0eea | 2021-05-19 09:00:42 -0700 | [diff] [blame] | 120 | "tests/OveruseConfigurationTestUtils.cpp", |
| 121 | "tests/OveruseConfigurationXmlHelperTest.cpp", |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 122 | "tests/PackageInfoResolverTest.cpp", |
Lakshman Annadorai | a0a1459 | 2021-02-03 12:45:17 -0800 | [diff] [blame] | 123 | "tests/ProcDiskStatsTest.cpp", |
Lakshman Annadorai | 325e965 | 2020-02-20 17:27:11 -0800 | [diff] [blame] | 124 | "tests/ProcPidDir.cpp", |
Lakshman Annadorai | 2fce001 | 2020-02-18 14:05:22 -0800 | [diff] [blame] | 125 | "tests/ProcPidStatTest.cpp", |
Lakshman Annadorai | f9b47c2 | 2020-02-10 16:45:18 -0800 | [diff] [blame] | 126 | "tests/ProcStatTest.cpp", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 127 | "tests/UidIoStatsTest.cpp", |
| 128 | "tests/WatchdogBinderMediatorTest.cpp", |
Lakshman Annadorai | 967b21e | 2020-10-30 09:35:29 -0700 | [diff] [blame] | 129 | "tests/WatchdogInternalHandlerTest.cpp", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 130 | "tests/WatchdogPerfServiceTest.cpp", |
Eric Jeong | 951f2aa | 2020-03-31 12:18:00 -0700 | [diff] [blame] | 131 | "tests/WatchdogProcessServiceTest.cpp", |
Lakshman Annadorai | e405462 | 2020-11-10 14:09:42 -0800 | [diff] [blame] | 132 | "tests/WatchdogServiceHelperTest.cpp", |
Lakshman Annadorai | ab4d3fd | 2020-02-06 11:24:56 -0800 | [diff] [blame] | 133 | ], |
| 134 | static_libs: [ |
| 135 | "libgmock", |
| 136 | "libgtest", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 137 | "libwatchdog_binder_mediator", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 138 | "libwatchdog_perf_service", |
Lakshman Annadorai | 8dfeeaf | 2020-12-15 14:10:53 -0800 | [diff] [blame] | 139 | "libwatchdog_process_service", |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 140 | "libwatchdog_package_info_resolver", |
Lakshman Annadorai | 6094e9a | 2020-01-31 10:03:33 -0800 | [diff] [blame] | 141 | ], |
Lakshman Annadorai | 9fb0eea | 2021-05-19 09:00:42 -0700 | [diff] [blame] | 142 | data: [":watchdog_test_xml_files"], |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | cc_defaults { |
| 146 | name: "libwatchdog_process_service_defaults", |
| 147 | shared_libs: [ |
Eric Jeong | 3a4b635 | 2020-08-18 18:06:53 -0700 | [diff] [blame] | 148 | "libhidlbase", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 149 | ], |
| 150 | } |
| 151 | |
| 152 | cc_library { |
| 153 | name: "libwatchdog_process_service", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 154 | srcs: [ |
| 155 | "src/WatchdogProcessService.cpp", |
| 156 | ], |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 157 | defaults: [ |
| 158 | "carwatchdogd_defaults", |
| 159 | "libwatchdog_process_service_defaults" |
| 160 | ], |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | cc_library { |
| 164 | name: "libwatchdog_binder_mediator", |
| 165 | defaults: [ |
| 166 | "carwatchdogd_defaults", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 167 | "libwatchdog_perf_service_defaults", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 168 | "libwatchdog_process_service_defaults", |
| 169 | ], |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 170 | srcs: [ |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 171 | "src/WatchdogBinderMediator.cpp", |
Lakshman Annadorai | 967b21e | 2020-10-30 09:35:29 -0700 | [diff] [blame] | 172 | "src/WatchdogInternalHandler.cpp", |
Lakshman Annadorai | e405462 | 2020-11-10 14:09:42 -0800 | [diff] [blame] | 173 | "src/WatchdogServiceHelper.cpp", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 174 | ], |
| 175 | shared_libs: [ |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 176 | "libwatchdog_perf_service", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 177 | "libwatchdog_process_service", |
| 178 | ], |
| 179 | export_include_dirs: [ |
| 180 | "src", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 181 | ], |
| 182 | } |
| 183 | |
| 184 | cc_binary { |
| 185 | name: "carwatchdogd", |
| 186 | defaults: [ |
| 187 | "carwatchdogd_defaults", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 188 | "libwatchdog_perf_service_defaults", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 189 | "libwatchdog_process_service_defaults", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 190 | ], |
| 191 | srcs: [ |
| 192 | "src/main.cpp", |
Eric Jeong | 69e9978 | 2020-02-12 17:41:00 -0800 | [diff] [blame] | 193 | "src/ServiceManager.cpp", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 194 | ], |
| 195 | init_rc: ["carwatchdogd.rc"], |
| 196 | shared_libs: [ |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 197 | "libwatchdog_binder_mediator", |
Lakshman Annadorai | d9a2c6e | 2020-09-03 11:52:06 -0700 | [diff] [blame] | 198 | "libwatchdog_perf_service", |
Lakshman Annadorai | 0dfeeeb | 2020-03-13 16:57:12 -0700 | [diff] [blame] | 199 | "libwatchdog_process_service", |
Lakshman Annadorai | 37975c9 | 2021-01-06 11:03:13 -0800 | [diff] [blame] | 200 | "libwatchdog_package_info_resolver", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 201 | ], |
Eric Jeong | ae2c04c | 2020-02-21 09:18:31 -0800 | [diff] [blame] | 202 | vintf_fragments: ["carwatchdogd.xml"], |
Lakshman Annadorai | 1b36608 | 2021-06-01 13:57:04 -0700 | [diff] [blame] | 203 | required: [ |
| 204 | "system_resource_overuse_configuration.xml", |
| 205 | "third_party_resource_overuse_configuration.xml", |
| 206 | ], |
| 207 | } |
| 208 | |
| 209 | prebuilt_etc { |
| 210 | name: "system_resource_overuse_configuration.xml", |
| 211 | src: "data/system_resource_overuse_configuration.xml", |
| 212 | sub_dir: "automotive/watchdog/", |
| 213 | } |
| 214 | |
| 215 | prebuilt_etc { |
| 216 | name: "third_party_resource_overuse_configuration.xml", |
| 217 | src: "data/third_party_resource_overuse_configuration.xml", |
| 218 | sub_dir: "automotive/watchdog/", |
Eric Jeong | 34edd98 | 2019-12-17 17:26:35 -0800 | [diff] [blame] | 219 | } |