| # Copyright 2023 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("//zircon/kernel/params.gni") |
| |
| source_set("lib") { |
| sources = [ |
| "component.cc", |
| "component_watcher.cc", |
| "job_watcher.cc", |
| "kernel_sampler.cc", |
| "process_watcher.cc", |
| "sampler.cc", |
| "symbolization_context.cc", |
| "symbolizer_markup.cc", |
| "targets.cc", |
| "taskfinder.cc", |
| "unowned_component.cc", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.component:fuchsia.component_cpp", |
| "//sdk/fidl/fuchsia.cpu.profiler:fuchsia.cpu.profiler_cpp", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp", |
| "//sdk/fidl/fuchsia.sys2:fuchsia.sys2_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/symbolizer-markup", |
| "//src/lib/unwinder", |
| "//src/lib/zxdump", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/elf-search", |
| "//zircon/system/ulib/task-utils", |
| "//zircon/system/ulib/trace-reader", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| |
| # TODO(https://fxbug.dev/42085293): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-vla-cxx-extension" ] |
| } |
| |
| executable("bin") { |
| testonly = true |
| output_name = "profiler" |
| |
| sources = [ |
| "main.cc", |
| "profiler_controller_impl.cc", |
| ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/fidl/fuchsia.cpu.profiler:fuchsia.cpu.profiler_cpp", |
| "//sdk/fidl/fuchsia.kernel:fuchsia.kernel_cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//src/lib/fsl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| defines = [ |
| "EXPERIMENTAL_THREAD_SAMPLER_ENABLED=$experimental_thread_sampler_enabled", |
| ] |
| } |
| |
| fuchsia_component("profiler_component") { |
| testonly = true |
| component_name = "profiler" |
| manifest = "meta/profiler.cml" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("profiler") { |
| testonly = true |
| deps = [ ":profiler_component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "samples_to_pprof:tests", |
| "tests", |
| ] |
| } |