[go: nahoru, domu]

blob: f1e605d3ebc5c3e85bef97543976e982f9709771 [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" ]
deps = [ ":cpp" ]
}
# On IOS and NACL we don't support tracing so we only include the minimum needed
# to support a fake typed TRACE_EVENT macro. However this means we don't have
# any .cc files and thus on iOS and NaCl it needs to be a source_set and not a
# component. |tracing_lib_type| decides which version to build.
if (!is_nacl && !is_ios) {
tracing_lib_type = "component"
} else {
tracing_lib_type = "source_set"
}
target(tracing_lib_type, "cpp") {
sources = [
"perfetto/macros.h",
"perfetto/macros_internal.h",
]
defines = [ "IS_TRACING_CPP_IMPL" ]
output_name = "tracing_cpp"
configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [
"//base",
"//third_party/perfetto:libperfetto",
]
deps = [ "//third_party/perfetto/include/perfetto/protozero" ]
all_dependent_configs = [ "//third_party/perfetto/gn:public_config" ]
if (!is_nacl && !is_ios) {
sources += [
"base_agent.cc",
"base_agent.h",
"perfetto/dummy_producer.cc",
"perfetto/dummy_producer.h",
"perfetto/flow_event_utils.cc",
"perfetto/flow_event_utils.h",
"perfetto/interning_index.h",
"perfetto/java_heap_profiler/hprof_buffer_android.cc",
"perfetto/java_heap_profiler/hprof_buffer_android.h",
"perfetto/java_heap_profiler/hprof_data_type_android.h",
"perfetto/java_heap_profiler/hprof_instances_android.cc",
"perfetto/java_heap_profiler/hprof_instances_android.h",
"perfetto/java_heap_profiler/hprof_parser_android.cc",
"perfetto/java_heap_profiler/hprof_parser_android.h",
"perfetto/java_heap_profiler/java_heap_profiler_android.cc",
"perfetto/java_heap_profiler/java_heap_profiler_android.h",
"perfetto/macros_internal.cc",
"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/trace_event_data_source.cc",
"perfetto/trace_event_data_source.h",
"perfetto/trace_time.cc",
"perfetto/trace_time.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",
]
public_deps += [
"//components/tracing:startup_tracing",
"//mojo/public/cpp/bindings",
"//services/tracing/public/mojom",
]
deps += [
"//build:chromecast_buildflags",
"//third_party/perfetto/protos/perfetto/trace/chrome:minimal_complete_lite",
]
# Add the SystemProducer implementations.
if (is_posix) {
sources += [
"perfetto/posix_system_producer.cc",
"perfetto/posix_system_producer.h",
]
}
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_ios && !is_nacl
}