| # 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/python/python_binary.gni") |
| import("//build/python/python_library.gni") |
| |
| python_library("trace_processing") { |
| testonly = true |
| library_name = "trace_processing" |
| sources = [ |
| "__init__.py", |
| "hardware_configs.py", |
| "metrics/__init__.py", |
| "metrics/agg_cpu_breakdown.py", |
| "metrics/app_render.py", |
| "metrics/cpu.py", |
| "metrics/fps.py", |
| "metrics/gpu.py", |
| "metrics/input_latency.py", |
| "metrics/memory.py", |
| "metrics/power.py", |
| "metrics/scenic.py", |
| "metrics/suspend.py", |
| "metrics/wakeup.py", |
| "trace_importing.py", |
| "trace_metrics.py", |
| "trace_model.py", |
| "trace_time.py", |
| "trace_utils.py", |
| ] |
| library_deps = [ |
| "//src/performance/lib/reporting", |
| "//src/performance/trace2json:bin", |
| ] |
| |
| data_package_name = "data" |
| data_sources = [ "${root_out_dir}/trace2json" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ "tests" ] |
| } |
| |
| python_binary("run_cpu_breakdown_bin") { |
| testonly = true |
| main_source = "run_cpu_breakdown.py" |
| deps = [ |
| ":trace_processing", |
| "//src/performance/trace2json", |
| ] |
| output_name = "run_cpu_breakdown.pyz" |
| } |
| |
| # Rename the resulting .pyz for the host tool |
| copy("copy_cpu_breakdown_pyz") { |
| testonly = true |
| deps = [ ":run_cpu_breakdown_bin" ] |
| sources = [ "${target_out_dir}/run_cpu_breakdown.pyz" ] |
| outputs = [ "${root_out_dir}/run_cpu_breakdown" ] |
| } |
| |
| install_host_tools("run_cpu_breakdown") { |
| testonly = true |
| deps = [ ":copy_cpu_breakdown_pyz" ] |
| outputs = [ "run_cpu_breakdown" ] |
| } |
| |
| # Rename the resulting .pyz for the host tool |
| copy("copy_power_metrics_pyz") { |
| testonly = true |
| deps = [ ":run_power_metrics_bin" ] |
| sources = [ "${target_out_dir}/run_power_metrics.pyz" ] |
| outputs = [ "${root_out_dir}/run_power_metrics" ] |
| } |
| |
| install_host_tools("run_power_metrics") { |
| testonly = true |
| deps = [ ":copy_power_metrics_pyz" ] |
| outputs = [ "run_power_metrics" ] |
| } |
| |
| python_binary("run_power_metrics_bin") { |
| testonly = true |
| main_source = "run_power_metrics.py" |
| deps = [ ":trace_processing" ] |
| output_name = "run_power_metrics.pyz" |
| } |
| |
| python_binary("run_suspend_metrics_bin") { |
| testonly = true |
| main_source = "run_suspend_metrics.py" |
| deps = [ |
| ":trace_processing", |
| "//src/performance/trace2json", |
| ] |
| output_name = "run_suspend_metrics.pyz" |
| } |
| |
| # Graphics metrics tooling |
| |
| python_binary("run_graphics_metrics_bin") { |
| testonly = true |
| main_source = "run_graphics_metrics.py" |
| deps = [ |
| ":trace_processing", |
| "//src/performance/trace2json", |
| ] |
| output_name = "run_graphics_metrics.pyz" |
| } |
| |
| copy("copy_graphics_metrics_pyz") { |
| testonly = true |
| deps = [ ":run_graphics_metrics_bin" ] |
| sources = [ "${target_out_dir}/run_graphics_metrics.pyz" ] |
| outputs = [ "${root_out_dir}/run_graphics_metrics" ] |
| } |
| |
| install_host_tools("run_graphics_metrics") { |
| testonly = true |
| deps = [ ":copy_graphics_metrics_pyz" ] |
| outputs = [ "run_graphics_metrics" ] |
| } |
| |
| # Rename the resulting .pyz for the host tool |
| copy("copy_suspend_metrics_pyz") { |
| testonly = true |
| deps = [ ":run_suspend_metrics_bin" ] |
| sources = [ "${target_out_dir}/run_suspend_metrics.pyz" ] |
| outputs = [ "${root_out_dir}/run_suspend_metrics" ] |
| } |
| |
| install_host_tools("run_suspend_metrics") { |
| testonly = true |
| deps = [ ":copy_suspend_metrics_pyz" ] |
| outputs = [ "run_suspend_metrics" ] |
| } |
| |
| python_binary("run_wakeup_metrics_bin") { |
| testonly = true |
| main_source = "run_wakeup_metrics.py" |
| deps = [ |
| ":trace_processing", |
| "//src/performance/trace2json", |
| ] |
| output_name = "run_wakeup_metrics.pyz" |
| } |
| |
| # Rename the resulting .pyz for the host tool |
| copy("copy_wakeup_metrics_pyz") { |
| testonly = true |
| deps = [ ":run_wakeup_metrics_bin" ] |
| sources = [ "${target_out_dir}/run_wakeup_metrics.pyz" ] |
| outputs = [ "${root_out_dir}/run_wakeup_metrics" ] |
| } |
| |
| install_host_tools("run_wakeup_metrics") { |
| testonly = true |
| deps = [ ":copy_wakeup_metrics_pyz" ] |
| outputs = [ "run_wakeup_metrics" ] |
| } |