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", |
| 33 | "liblog", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 34 | ], |
Ryan Zuklie | a603ce5 | 2023-01-10 14:39:03 -0800 | [diff] [blame] | 35 | static_libs: [ |
| 36 | "libperfetto_client_experimental", |
| 37 | ], |
| 38 | export_static_lib_headers: [ |
| 39 | "libperfetto_client_experimental", |
| 40 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 41 | export_include_dirs: ["include"], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 42 | cflags: [ |
| 43 | "-Wall", |
| 44 | "-Werror", |
| 45 | "-Wno-unused-parameter", |
| 46 | "-Wthread-safety", |
| 47 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 48 | sanitize: { |
| 49 | cfi: true, |
| 50 | }, |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 51 | apex_available: [ |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 52 | "com.android.tethering", |
| 53 | ], |
| 54 | min_sdk_version: "30", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | cc_test { |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 58 | name: "libnetworkstats_test", |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 59 | test_suites: ["general-tests", "mts-tethering"], |
| 60 | test_config_template: ":net_native_test_config_template", |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 61 | require_root: true, // required by setrlimitForTest() |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 62 | header_libs: ["bpf_connectivity_headers"], |
| 63 | srcs: [ |
| 64 | "BpfNetworkStatsTest.cpp", |
Ryan Zuklie | 5a6b1ee | 2023-03-09 11:44:02 -0800 | [diff] [blame] | 65 | "NetworkTraceHandlerTest.cpp", |
Ryan Zuklie | 75de743 | 2023-03-07 10:15:32 -0800 | [diff] [blame] | 66 | "NetworkTracePollerTest.cpp", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 67 | ], |
Ken Chen | f426b2b | 2022-01-23 15:39:13 +0800 | [diff] [blame] | 68 | cflags: [ |
| 69 | "-Wall", |
| 70 | "-Werror", |
| 71 | "-Wno-unused-parameter", |
| 72 | "-Wthread-safety", |
| 73 | ], |
Lorenzo Colitti | 0db496e | 2022-02-07 09:01:37 +0900 | [diff] [blame] | 74 | static_libs: [ |
| 75 | "libgmock", |
| 76 | "libnetworkstats", |
Ryan Zuklie | a603ce5 | 2023-01-10 14:39:03 -0800 | [diff] [blame] | 77 | "libperfetto_client_experimental", |
Ryan Zuklie | 5a6b1ee | 2023-03-09 11:44:02 -0800 | [diff] [blame] | 78 | "libprotobuf-cpp-lite", |
| 79 | "perfetto_trace_protos", |
Lorenzo Colitti | 0db496e | 2022-02-07 09:01:37 +0900 | [diff] [blame] | 80 | ], |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 81 | shared_libs: [ |
| 82 | "libbase", |
| 83 | "liblog", |
Ryan Zuklie | 0b9478b | 2023-01-10 13:45:39 -0800 | [diff] [blame] | 84 | "libandroid_net", |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 85 | ], |
Ken Chen | b9266bf | 2022-05-25 15:34:17 +0800 | [diff] [blame] | 86 | compile_multilib: "both", |
| 87 | multilib: { |
| 88 | lib32: { |
| 89 | suffix: "32", |
| 90 | }, |
| 91 | lib64: { |
| 92 | suffix: "64", |
| 93 | }, |
| 94 | }, |
Ken Chen | f2bb7b1 | 2022-01-22 19:17:20 +0800 | [diff] [blame] | 95 | } |