| # Copyright (C) 2017 The Android Open Source Project |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("../gn/perfetto.gni") |
| import("//build_overrides/build.gni") |
| import("../ipc//ipc_library.gni") |
| |
| config("tracing_config") { |
| include_dirs = [ |
| "include", |
| perfetto_root_path, |
| ] |
| } |
| |
| # Core tracing library, platform independent, no transport layer. |
| source_set("tracing") { |
| all_dependent_configs = [ ":tracing_config" ] |
| deps = [ |
| "../perfetto_base", |
| ] |
| sources = [ |
| "include/tracing/core/basic_types.h", |
| "include/tracing/core/data_source_config.h", |
| "include/tracing/core/data_source_descriptor.h", |
| "include/tracing/core/producer.h", |
| "include/tracing/core/service.h", |
| "include/tracing/core/shared_memory.h", |
| "src/core/service_impl.cc", |
| "src/core/service_impl.h", |
| ] |
| } |
| |
| # IPC service definitions. |
| ipc_library("ipc_protos") { |
| proto_in_dir = perfetto_root_path |
| extra_configs = [ "../ipc:config" ] |
| sources = [ |
| "src/ipc/data_source_config.proto", |
| "src/ipc/data_source_descriptor.proto", |
| "src/ipc/producer_port.proto", |
| ] |
| } |
| |
| # Posix specialization of the tracing library for Linux/Android/Mac. Provides |
| # an IPC transport over a UNIX domain socket. |
| source_set("ipc") { |
| sources = [ |
| "include/tracing/ipc/producer_ipc_client.h", |
| "include/tracing/ipc/service_ipc_host.h", |
| "src/ipc/posix_shared_memory.cc", |
| "src/ipc/posix_shared_memory.h", |
| "src/ipc/producer/producer_ipc_client_impl.cc", |
| "src/ipc/producer/producer_ipc_client_impl.h", |
| "src/ipc/service/producer_ipc_service.cc", |
| "src/ipc/service/producer_ipc_service.h", |
| "src/ipc/service/service_ipc_host_impl.cc", |
| "src/ipc/service/service_ipc_host_impl.h", |
| ] |
| deps = [ |
| ":ipc_protos", |
| ":tracing", |
| "../ipc", |
| "../perfetto_base", |
| ] |
| } |
| |
| executable("tracing_unittests") { |
| testonly = true |
| deps = [ |
| ":ipc", |
| ":tracing", |
| "../gn:default_deps", |
| "../gn:gtest_deps", |
| "../perfetto_base", |
| "../perfetto_base:test_support", |
| ] |
| |
| sources = [ |
| "src/core/service_impl_unittest.cc", |
| "src/ipc/posix_shared_memory_unittest.cc", |
| "src/test/test_shared_memory.cc", |
| "src/test/test_shared_memory.h", |
| ] |
| } |
| |
| executable("tracing_test") { |
| testonly = true |
| deps = [ |
| ":ipc", |
| ":ipc_protos", |
| ":tracing", |
| "../gn:default_deps", |
| "../ipc", |
| "../perfetto_base", |
| "../perfetto_base:test_support", |
| ] |
| sources = [ |
| "src/test/ipc_test.cc", |
| ] |
| } |
| |
| if (!build_with_chromium) { |
| executable("tracing_benchmarks") { |
| testonly = true |
| |
| deps = [ |
| "../gn:default_deps", |
| "//buildtools:benchmark", |
| ] |
| |
| sources = [ |
| "src/test/hello_world_benchmark.cc", |
| ] |
| } |
| } |