| # 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/host.gni") |
| import("//build/test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| source_set("samples_to_pprof_src") { |
| sources = [ "samples_to_pprof.cc" ] |
| deps = [ |
| # TODO(https://fxbug.dev/42066681): Replace with pprof. |
| # "//third_party/github.com/google/pprof:profile_proto", |
| ":profile_proto", |
| "//src/lib/fxl", |
| "//third_party/protobuf:protobuf_full", |
| ] |
| } |
| |
| if (is_host) { |
| executable("samples_to_pprof") { |
| output_name = "samples_to_pprof" |
| sources = [ "main.cc" ] |
| deps = [ |
| ":profile_proto", |
| ":samples_to_pprof_src", |
| "//src/lib/fxl", |
| ] |
| } |
| } |
| |
| test("samples_to_pprof_test") { |
| sources = [ "samples_to_pprof_test.cc" ] |
| deps = [ |
| ":profile_proto", |
| ":samples_to_pprof_src", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| proto_library("profile_proto") { |
| proto_out_dir = "//src/performance/profiler/profile" |
| sources = [ "//third_party/perfetto/protos/third_party/pprof/profile.proto" ] |
| } |
| |
| install_host_tools("install") { |
| deps = [ ":samples_to_pprof($host_toolchain)" ] |
| outputs = [ "samples_to_pprof" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":samples_to_pprof_test" ] |
| } |