Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 1 | # Copyright (C) 2017 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 | |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 15 | import("//ipc//ipc_library.gni") |
| 16 | |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 17 | config("tracing_config") { |
| 18 | include_dirs = [ "include" ] |
| 19 | } |
| 20 | |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 21 | # Core tracing library, platform independent, no transport layer. |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 22 | source_set("tracing") { |
| 23 | all_dependent_configs = [ ":tracing_config" ] |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 24 | deps += [ "//base" ] |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 25 | sources = [ |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 26 | "include/tracing/core/basic_types.h", |
| 27 | "include/tracing/core/data_source_config.h", |
| 28 | "include/tracing/core/data_source_descriptor.h", |
| 29 | "include/tracing/core/producer.h", |
| 30 | "include/tracing/core/service.h", |
| 31 | "include/tracing/core/shared_memory.h", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 32 | "src/core/service_impl.cc", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 33 | "src/core/service_impl.h", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 34 | ] |
| 35 | } |
| 36 | |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 37 | # IPC service definitions. |
| 38 | ipc_library("ipc_protos") { |
| 39 | sources = [ |
| 40 | "src/ipc/data_source_config.proto", |
| 41 | "src/ipc/data_source_descriptor.proto", |
| 42 | "src/ipc/producer_port.proto", |
| 43 | ] |
| 44 | } |
| 45 | |
| 46 | # Posix specialization of the tracing library for Linux/Android/Mac. Provides |
| 47 | # an IPC transport over a UNIX domain socket. |
| 48 | source_set("ipc") { |
| 49 | sources = [ |
Primiano Tucci | 1d94e7d | 2017-11-20 14:45:16 +0000 | [diff] [blame] | 50 | "include/tracing/ipc/producer_ipc_client.h", |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 51 | "include/tracing/ipc/service_ipc_host.h", |
| 52 | "src/ipc/posix_shared_memory.cc", |
| 53 | "src/ipc/posix_shared_memory.h", |
Primiano Tucci | 1d94e7d | 2017-11-20 14:45:16 +0000 | [diff] [blame] | 54 | "src/ipc/producer/producer_ipc_client_impl.cc", |
| 55 | "src/ipc/producer/producer_ipc_client_impl.h", |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 56 | "src/ipc/service/producer_ipc_service.cc", |
| 57 | "src/ipc/service/producer_ipc_service.h", |
| 58 | "src/ipc/service/service_ipc_host_impl.cc", |
| 59 | "src/ipc/service/service_ipc_host_impl.h", |
| 60 | ] |
| 61 | deps = [ |
| 62 | ":ipc_protos", |
| 63 | ":tracing", |
| 64 | "//base", |
| 65 | ] |
| 66 | } |
| 67 | |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 68 | executable("tracing_unittests") { |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 69 | testonly = true |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 70 | deps += [ |
Primiano Tucci | a616648 | 2017-11-20 13:05:45 +0000 | [diff] [blame] | 71 | ":ipc", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 72 | ":tracing", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 73 | "//base", |
| 74 | "//base:test_support", |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 75 | "//buildtools:gmock", |
| 76 | "//buildtools:gtest", |
| 77 | "//buildtools:gtest_main", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 78 | ] |
| 79 | sources = [ |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 80 | "src/core/service_impl_unittest.cc", |
Primiano Tucci | 69ca126 | 2017-11-20 19:42:22 +0000 | [diff] [blame] | 81 | "src/ipc/posix_shared_memory_unittest.cc", |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 82 | "src/test/test_shared_memory.cc", |
Primiano Tucci | d7d1be0 | 2017-10-30 17:41:34 +0000 | [diff] [blame] | 83 | "src/test/test_shared_memory.h", |
Primiano Tucci | ae2879e | 2017-09-27 11:02:09 +0900 | [diff] [blame] | 84 | ] |
| 85 | } |
Primiano Tucci | 0825bc8 | 2017-09-28 18:50:23 +0100 | [diff] [blame] | 86 | |
Primiano Tucci | 1d94e7d | 2017-11-20 14:45:16 +0000 | [diff] [blame] | 87 | executable("tracing_test") { |
| 88 | testonly = true |
| 89 | deps += [ |
| 90 | ":ipc", |
Primiano Tucci | f54cae4 | 2017-11-21 19:37:13 +0000 | [diff] [blame] | 91 | ":ipc_protos", |
Primiano Tucci | 1d94e7d | 2017-11-20 14:45:16 +0000 | [diff] [blame] | 92 | ":tracing", |
| 93 | "//base", |
| 94 | "//base:test_support", |
Primiano Tucci | f54cae4 | 2017-11-21 19:37:13 +0000 | [diff] [blame] | 95 | "//ipc", |
Primiano Tucci | 1d94e7d | 2017-11-20 14:45:16 +0000 | [diff] [blame] | 96 | ] |
| 97 | sources = [ |
| 98 | "src/test/ipc_test.cc", |
| 99 | ] |
| 100 | } |
| 101 | |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 102 | executable("tracing_benchmarks") { |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 103 | testonly = true |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 104 | deps += [ "//buildtools:benchmark" ] |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 105 | sources = [ |
Primiano Tucci | ce72002 | 2017-10-30 12:50:06 +0000 | [diff] [blame] | 106 | "src/test/hello_world_benchmark.cc", |
Hector Dearman | 88a1011 | 2017-10-12 11:07:10 +0100 | [diff] [blame] | 107 | ] |
| 108 | } |