blob: e27663250521c56b516ccce88ae423bd8df7fa19 [file] [log] [blame]
# 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/host.gni")
import("//build/python/python_binary.gni")
import("//build/python/python_library.gni")
python_library("power") {
testonly = true
library_name = "power"
sources = [
"__init__.py",
"gonk.py",
"powerserver.py",
"sampler.py",
]
library_deps = [ "//src/performance/lib/trace_processing" ]
}
# A small wrapper executable around the library call to merge power and trace data.
python_binary("merge_power_trace_bin") {
testonly = true
main_source = "merge_power_trace.py"
deps = [
":power",
"//src/performance/lib/trace_processing",
"//src/performance/trace2json",
]
output_name = "merge_power_trace.pyz"
}
# Rename the resulting .pyz for the host tool
copy("copy") {
testonly = true
deps = [ ":merge_power_trace_bin" ]
sources = [ "${target_out_dir}/merge_power_trace.pyz" ]
outputs = [ "${root_out_dir}/merge_power_trace" ]
}
install_host_tools("merge_power_trace") {
testonly = true
deps = [ ":copy" ]
outputs = [ "merge_power_trace" ]
}
group("tests") {
testonly = true
deps = [
# Build the host binary to make sure it at least typechecks
":merge_power_trace_bin($host_toolchain)",
"tests",
]
}