blob: 0f1ff9031ce01e8b031cb9a2e7d29e7ca42b8a66 [file]
# Copyright 2025 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/rust/rustc_library.gni")
import("//tools/protobuf/rust_proto_library.gni")
assert(is_host, "profiler is for use with the host toolchain only")
rustc_library("profiler") {
name = "ffx_profiler"
version = "0.1.0"
edition = "2024"
with_unit_tests = true
deps = [
":perfetto_trace_rust_proto",
":profile_rust_proto",
"//src/developer/ffx/config:lib",
"//src/developer/ffx/lib/symbol-index",
"//src/developer/ffx/lib/symbolize",
"//src/lib/diagnostics/log/rust_cpp_bridge",
"//src/performance/lib/fxt/rust",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:log",
"//third_party/rust_crates:prost",
"//third_party/rust_crates:rayon",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:zerocopy",
]
test_deps = [
"//third_party/rust_crates:assert_matches",
"//third_party/rust_crates:tempfile",
]
sources = [
"src/fxt_blob.rs",
"src/fxt_parse.rs",
"src/lib.rs",
"src/parse.rs",
"src/perfetto.rs",
"src/pprof.rs",
"src/symbolize.rs",
"src/unwinder.rs",
]
non_rust_deps = [ ":sys" ]
}
rust_proto_library("profile_rust_proto") {
sources = [ "//third_party/perfetto/protos/third_party/pprof/profile.proto" ]
packages = [ "perfetto.third_party.perftools.profiles" ]
}
rust_proto_library("perfetto_trace_rust_proto") {
sources =
[ "//third_party/perfetto/protos/perfetto/trace/perfetto_trace.proto" ]
packages = [ "perfetto.protos" ]
include_dirs = [ "//third_party/perfetto" ]
}
group("tests") {
testonly = true
deps = [ ":profiler_test" ]
}
if (is_host) {
group("host_tests") {
testonly = true
deps = [
":profiler_test",
"tests:host_tests",
]
}
}
source_set("sys") {
sources = [
"sys/unwinder_wrapper.cc",
"sys/unwinder_wrapper.h",
]
deps = [
"//sdk/lib/fit",
"//sdk/lib/stdcompat",
"//src/lib/unwinder",
"//zircon/system/public",
]
}