blob: 5b4c0eadbecc2cecb9190b6638f4506e6674a28b [file]
# 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")
# Kept in GN because `:bin` transitively links `rustc_dylib`
# `//src/storage/lib/vfs/rust:vfs_dylib` via `//src/lib/fuchsia-component`.
fuchsia_package("memory_sampler") {
deps = [ ":component" ]
}
group("tests") {
testonly = true
deps = [
":memory_sampler_tests",
"instrumentation/tests:memory_sampler_instrumentation_tests",
]
}
## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ##
#
# ________ _________ ________ ________
# |\ ____\|\___ ___\\ __ \|\ __ \
# \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \
# \ \_____ \ \ \ \ \ \ \\\ \ \ ____\
# \|____|\ \ \ \ \ \ \ \\\ \ \ \___|
# ____\_\ \ \ \__\ \ \_______\ \__\
# |\_________\ \|__| \|_______|\|__|
# \|_________|
#
#
# AUTO-GENERATED - DO NOT EDIT
#
# The targets below are auto-generated based on the targets defined in the
# BUILD.bazel file from the same directory. If you made changes to targets in
# Bazel, instead of editing this file manually, run:
#
# > fx bazel2gn
#
# Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and
# rerun bazel2gn.
import("//build/tools/bazel2gn/bazel_migration.gni")
rust_proto_library("profile_rust_proto") {
sources = [ "//third_party/perfetto/protos/third_party/pprof/profile.proto" ]
packages = [ "perfetto.third_party.perftools.profiles" ]
}
rustc_binary("bin") {
sources = [
"src/crash_reporter.rs",
"src/main.rs",
"src/pprof.rs",
"src/profile_builder.rs",
"src/sampler_service.rs",
]
output_name = "memory_sampler"
edition = "2024"
deps = [
":profile_rust_proto",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/fidl/fuchsia.memory.sampler:fuchsia.memory.sampler_rust",
"//sdk/rust/zx",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:flate2",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:log",
"//third_party/rust_crates:prost",
"//third_party/rust_crates:tar",
]
}
if (is_fuchsia) {
rustc_test("bin_test") {
sources = [
"src/crash_reporter.rs",
"src/main.rs",
"src/pprof.rs",
"src/profile_builder.rs",
"src/sampler_service.rs",
]
edition = "2024"
deps = [
":profile_rust_proto",
"//sdk/fidl/fuchsia.feedback:fuchsia.feedback_rust",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_rust",
"//sdk/fidl/fuchsia.memory.sampler:fuchsia.memory.sampler_rust",
"//sdk/rust/zx",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:flate2",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:hex",
"//third_party/rust_crates:log",
"//third_party/rust_crates:prost",
"//third_party/rust_crates:tar",
] + [ "//third_party/rust_crates:itertools" ]
source_root = "src/main.rs"
output_name = "memory_sampler_bin_test"
}
}
fuchsia_unittest_package("memory_sampler_tests") {
package_name = "memory_sampler_tests-gn"
component_name = "memory_sampler_tests"
deps = [ ":bin_test" ]
}
fuchsia_component_manifest("memory_sampler_manifest") {
component_name = "memory_sampler"
manifest = "meta/memory_sampler.cml"
}
fuchsia_component("component") {
cm_label = ":memory_sampler_manifest"
deps = [ ":bin" ]
}