Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2018 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 | // ========================================================================= |
| 18 | // Native library to write stats log to statsd socket on Android R and later |
| 19 | // ========================================================================= |
| 20 | cc_library { |
| 21 | name: "libstatssocket", |
| 22 | srcs: [ |
Muhammad Qureshi | 962cc23 | 2019-11-06 15:15:23 -0800 | [diff] [blame] | 23 | "stats_buffer_writer.c", |
Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 24 | "stats_event.c", |
Muhammad Qureshi | 962cc23 | 2019-11-06 15:15:23 -0800 | [diff] [blame] | 25 | // TODO(b/145573568): Remove stats_event_list once stats_event |
| 26 | // migration is complete. |
Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 27 | "stats_event_list.c", |
Muhammad Qureshi | 2ebc2e3 | 2020-02-11 14:12:59 -0800 | [diff] [blame^] | 28 | "stats_socket.c", |
Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 29 | "statsd_writer.c", |
| 30 | ], |
| 31 | host_supported: true, |
| 32 | cflags: [ |
| 33 | "-Wall", |
| 34 | "-Werror", |
| 35 | "-DLIBLOG_LOG_TAG=1006", |
| 36 | "-DWRITE_TO_STATSD=1", |
| 37 | "-DWRITE_TO_LOGD=0", |
| 38 | ], |
| 39 | export_include_dirs: ["include"], |
| 40 | shared_libs: [ |
| 41 | "libcutils", |
| 42 | "liblog", |
| 43 | ], |
Ruchir Rastogi | 5dbcae5 | 2019-12-19 15:44:58 -0800 | [diff] [blame] | 44 | |
| 45 | // enumerate stable entry points for APEX use |
| 46 | stubs: { |
| 47 | symbol_file: "libstatssocket.map.txt", |
| 48 | versions: [ |
Tej Singh | a8fd39d | 2020-01-14 13:46:27 -0800 | [diff] [blame] | 49 | "30", |
Ruchir Rastogi | 5dbcae5 | 2019-12-19 15:44:58 -0800 | [diff] [blame] | 50 | ], |
| 51 | } |
Muhammad Qureshi | a3dcefc | 2019-12-02 20:27:46 -0800 | [diff] [blame] | 52 | } |
Ruchir Rastogi | 926fa88 | 2019-12-10 18:46:23 -0800 | [diff] [blame] | 53 | |
| 54 | cc_library_headers { |
| 55 | name: "libstatssocket_headers", |
| 56 | export_include_dirs: ["include"], |
| 57 | host_supported: true, |
| 58 | } |
Ruchir Rastogi | 79dd3ea | 2019-12-12 17:16:59 -0800 | [diff] [blame] | 59 | |
| 60 | cc_benchmark { |
| 61 | name: "libstatssocket_benchmark", |
| 62 | srcs: [ |
| 63 | "benchmark/main.cpp", |
| 64 | "benchmark/stats_event_benchmark.cpp", |
| 65 | ], |
| 66 | cflags: [ |
| 67 | "-Wall", |
| 68 | "-Werror", |
| 69 | ], |
| 70 | static_libs: [ |
| 71 | "libstatssocket", |
| 72 | ], |
| 73 | shared_libs: [ |
| 74 | "libcutils", |
| 75 | "liblog", |
| 76 | "libgtest_prod", |
| 77 | ], |
| 78 | } |
Ruchir Rastogi | 21c1f9c | 2020-01-07 09:36:04 -0800 | [diff] [blame] | 79 | |
| 80 | cc_test { |
| 81 | name: "libstatssocket_test", |
| 82 | srcs: ["tests/stats_event_test.cpp"], |
| 83 | cflags: [ |
| 84 | "-Wall", |
| 85 | "-Werror", |
| 86 | ], |
| 87 | static_libs: [ |
| 88 | "libgmock", |
| 89 | "libstatssocket", |
| 90 | ], |
| 91 | shared_libs: [ |
| 92 | "libcutils", |
| 93 | "liblog", |
| 94 | "libutils", |
| 95 | ], |
Tej Singh | 0fca736 | 2020-02-04 14:13:20 -0800 | [diff] [blame] | 96 | test_suites: ["device-tests"], |
Ruchir Rastogi | 21c1f9c | 2020-01-07 09:36:04 -0800 | [diff] [blame] | 97 | } |