blob: 75cc5fab3f3b662c2ed84658c5f58a7d29ea851b [file] [log] [blame]
# Copyright 2018 The Chromium 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/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
config("wrap_find_exidx") {
ldflags = [ "-Wl,-wrap,dl_unwind_find_exidx" ]
}
source_set("traced_process") {
sources = [
"traced_process.cc",
"traced_process.h",
]
public_deps = [
"//services/tracing/public/mojom",
]
if (!is_nacl && !is_ios) {
deps = [
":cpp",
]
}
}
if (!is_nacl && !is_ios) {
component("cpp") {
sources = [
"base_agent.cc",
"base_agent.h",
"perfetto/dummy_producer.cc",
"perfetto/dummy_producer.h",
"perfetto/interning_index.h",
"perfetto/java_heap_profiler/java_heap_profiler.cc",
"perfetto/java_heap_profiler/java_heap_profiler.h",
"perfetto/perfetto_config.cc",
"perfetto/perfetto_config.h",
"perfetto/perfetto_producer.cc",
"perfetto/perfetto_producer.h",
"perfetto/perfetto_traced_process.cc",
"perfetto/perfetto_traced_process.h",
"perfetto/producer_client.cc",
"perfetto/producer_client.h",
"perfetto/shared_memory.cc",
"perfetto/shared_memory.h",
"perfetto/system_producer.cc",
"perfetto/system_producer.h",
"perfetto/system_trace_writer.h",
"perfetto/task_runner.cc",
"perfetto/task_runner.h",
"perfetto/thread_local_event_sink.cc",
"perfetto/thread_local_event_sink.h",
"perfetto/trace_event_data_source.cc",
"perfetto/trace_event_data_source.h",
"perfetto/traced_value_proto_writer.cc",
"perfetto/traced_value_proto_writer.h",
"perfetto/track_event_thread_local_event_sink.cc",
"perfetto/track_event_thread_local_event_sink.h",
"stack_sampling/tracing_sampler_profiler.cc",
"stack_sampling/tracing_sampler_profiler.h",
"trace_event_agent.cc",
"trace_event_agent.h",
"trace_event_args_whitelist.cc",
"trace_event_args_whitelist.h",
"trace_startup.cc",
"trace_startup.h",
"traced_process_impl.cc",
"traced_process_impl.h",
"tracing_features.cc",
"tracing_features.h",
]
defines = [ "IS_TRACING_CPP_IMPL" ]
output_name = "tracing_cpp"
configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [
"//base",
"//components/tracing:startup_tracing",
"//mojo/public/cpp/bindings",
"//services/tracing/public/mojom",
"//third_party/perfetto:libperfetto",
]
deps = [
"//third_party/perfetto/include/perfetto/protozero",
"//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
]
# Add the SystemProducer implementations.
if (is_android) {
sources += [
"perfetto/android_system_producer.cc",
"perfetto/android_system_producer.h",
]
deps += [ "//third_party/perfetto/src/tracing:ipc" ]
}
if (is_chromecast) {
defines += [ "IS_CHROMECAST" ]
}
if (is_android && can_unwind_with_cfi_table && is_official_build) {
sources += [
"stack_sampling/stack_sampler_android.cc",
"stack_sampling/stack_sampler_android.h",
"stack_sampling/stack_unwinder_android.cc",
"stack_sampling/stack_unwinder_android.h",
]
deps += [ "//buildtools/third_party/libunwind" ]
include_dirs = [ "//buildtools/third_party/libunwind/trunk/include" ]
# stack_unwinder_android.cc overrides the dl_unwind_find_exidx function.
all_dependent_configs = [ ":wrap_find_exidx" ]
}
}
} # !is_nacl && !is_ios