Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2017 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | package { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 18 | default_applicable_licenses: ["Android-Apache-2.0"], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | cc_library { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 22 | name: "libnetworkstats", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 23 | vendor_available: false, |
| 24 | host_supported: false, |
| 25 | header_libs: ["bpf_connectivity_headers"], |
| 26 | srcs: [ |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 27 | "BpfNetworkStats.cpp", |
| 28 | "NetworkTraceHandler.cpp", |
Ryan Zuklie | 75de743 | 2023-03-07 10:15:32 -0800 | [diff] [blame] | 29 | "NetworkTracePoller.cpp", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 30 | ], |
| 31 | shared_libs: [ |
| 32 | "libbase", |
Ryan Zuklie | 80d7055 | 2023-05-03 16:18:59 -0700 | [diff] [blame] | 33 | "libcutils", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 34 | "liblog", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 35 | ], |
Ryan Zuklie | a603ce5 | 2023-01-10 14:39:03 -0800 | [diff] [blame] | 36 | static_libs: [ |
| 37 | "libperfetto_client_experimental", |
| 38 | ], |
| 39 | export_static_lib_headers: [ |
| 40 | "libperfetto_client_experimental", |
| 41 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 42 | export_include_dirs: ["include"], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 43 | cflags: [ |
| 44 | "-Wall", |
| 45 | "-Werror", |
| 46 | "-Wno-unused-parameter", |
| 47 | "-Wthread-safety", |
| 48 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 49 | sanitize: { |
| 50 | cfi: true, |
| 51 | }, |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 52 | apex_available: [ |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 53 | "com.android.tethering", |
| 54 | ], |
| 55 | min_sdk_version: "30", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 56 | } |
| 57 | |
| 58 | cc_test { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 59 | name: "libnetworkstats_test", |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 60 | test_suites: ["general-tests", "mts-tethering"], |
| 61 | test_config_template: ":net_native_test_config_template", |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 62 | require_root: true, // required by setrlimitForTest() |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 63 | header_libs: ["bpf_connectivity_headers"], |
| 64 | srcs: [ |
| 65 | "BpfNetworkStatsTest.cpp", |
Ryan Zuklie | 5a6b1ee | 2023-03-09 11:44:02 -0800 | [diff] [blame] | 66 | "NetworkTraceHandlerTest.cpp", |
Ryan Zuklie | 75de743 | 2023-03-07 10:15:32 -0800 | [diff] [blame] | 67 | "NetworkTracePollerTest.cpp", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 68 | ], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 69 | cflags: [ |
| 70 | "-Wall", |
| 71 | "-Werror", |
| 72 | "-Wno-unused-parameter", |
| 73 | "-Wthread-safety", |
| 74 | ], |
Lorenzo Colitti | 0db496e | 2022-02-07 09:01:37 +0900 | [diff] [blame] | 75 | static_libs: [ |
| 76 | "libgmock", |
| 77 | "libnetworkstats", |
Ryan Zuklie | a603ce5 | 2023-01-10 14:39:03 -0800 | [diff] [blame] | 78 | "libperfetto_client_experimental", |
Ryan Zuklie | 5a6b1ee | 2023-03-09 11:44:02 -0800 | [diff] [blame] | 79 | "libprotobuf-cpp-lite", |
| 80 | "perfetto_trace_protos", |
Lorenzo Colitti | 0db496e | 2022-02-07 09:01:37 +0900 | [diff] [blame] | 81 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 82 | shared_libs: [ |
| 83 | "libbase", |
| 84 | "liblog", |
Ryan Zuklie | 80d7055 | 2023-05-03 16:18:59 -0700 | [diff] [blame] | 85 | "libcutils", |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 86 | "libandroid_net", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 87 | ], |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 88 | compile_multilib: "both", |
| 89 | multilib: { |
| 90 | lib32: { |
| 91 | suffix: "32", |
| 92 | }, |
| 93 | lib64: { |
| 94 | suffix: "64", |
| 95 | }, |
| 96 | }, |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 97 | } |