blob: e037b3fc1fab43b1c17ee41048e8ff19798f5839 [file] [log] [blame]
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/config.gni")
source_set("perfetto_bridge_lib") {
sources = [
"consumer_adapter.cc",
"consumer_adapter.h",
"producer_connector_impl.cc",
"producer_connector_impl.h",
]
public_deps = [
"//sdk/fidl/fuchsia.tracing.perfetto:fuchsia.tracing.perfetto_cpp",
"//third_party/perfetto:libperfetto_client_experimental",
"//third_party/perfetto/include/perfetto/ext/ipc",
"//third_party/perfetto/src/base",
"//third_party/perfetto/src/tracing/core:service",
"//third_party/perfetto/src/tracing/ipc/service",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider",
]
deps = [
"//sdk/lib/fidl/cpp",
"//sdk/lib/fit",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/fxl:fxl_cli",
"//third_party/perfetto/protos/perfetto/config:cpp",
"//third_party/perfetto/protos/perfetto/trace:non_minimal_cpp",
"//third_party/rapidjson",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
]
}
executable("bin") {
output_name = "perfetto-bridge"
sources = [ "main.cc" ]
# Perfetto (3P library) performs some pointer arithmetic that breaks UBSan
# (nullptr + offset). The arithmetic is legal because the addresses are used
# within a custom arena allocator, so UBSan's error is not correct.
# See https://github.com/google/perfetto/issues/271 , which recommends
# suppressing UBsan as the fix.
exclude_toolchain_tags = [ "ubsan" ]
deps = [
":perfetto_bridge_lib",
"//sdk/lib/component/outgoing/cpp",
"//sdk/lib/fidl/cpp",
"//sdk/lib/fidl/cpp",
"//sdk/lib/fit",
"//sdk/lib/sys/cpp",
"//sdk/lib/syslog/cpp",
"//src/lib/fxl:fxl_cli",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider",
]
}
fuchsia_component("component") {
component_name = "perfetto-bridge"
manifest = "meta/perfetto_bridge.cml"
deps = [ ":bin" ]
}
fuchsia_package("perfetto-bridge") {
deps = [ ":component" ]
}
group("tests") {
testonly = true
deps = [ "tests" ]
}