| # Copyright 2017 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/package.gni") |
| import("//build/test/test_package.gni") |
| |
| # Split out so that unittests can reference it. |
| source_set("categories") { |
| sources = [ |
| "categories.cc", |
| "categories.h", |
| "category-db.cc", |
| ] |
| |
| if (current_cpu == "arm64") { |
| sources += [ |
| "arm64-category-db.cc", |
| "arm64-events.h", |
| "arm64-pm-categories.inc", |
| "arm64-timebase-categories.inc", |
| ] |
| } |
| |
| if (current_cpu == "x64") { |
| sources += [ |
| "intel-category-db.cc", |
| "intel-events.h", |
| "intel-pm-categories.inc", |
| "intel-timebase-categories.inc", |
| "skylake-misc-categories.inc", |
| "skylake-pm-categories.inc", |
| ] |
| } |
| |
| deps = [ |
| "//src/lib/fxl", |
| "//zircon/public/lib/fbl", |
| ] |
| |
| public_deps = [ |
| "//garnet/lib/perfmon", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/zircon-internal", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "cpuperf_provider" |
| |
| sources = [ |
| "app.cc", |
| "app.h", |
| "importer.cc", |
| "importer.h", |
| "main.cc", |
| ] |
| |
| deps = [ |
| ":categories", |
| "//garnet/lib/perfmon", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-provider-with-fdio", |
| "//zircon/public/lib/zircon-internal", |
| ] |
| } |
| |
| package("cpuperf_provider") { |
| deps = [ ":bin" ] |
| |
| binary = "cpuperf_provider" |
| |
| meta = [ |
| { |
| path = rebase_path("meta/cpuperf_provider.cmx") |
| dest = "cpuperf_provider.cmx" |
| }, |
| ] |
| } |
| |
| group("report_generators") { |
| deps = [ "//garnet/bin/cpuperf_provider/report-generators/tally" ] |
| } |
| |
| executable("cpuperf_provider_tests_bin") { |
| testonly = true |
| output_name = "cpuperf_provider_tests" |
| |
| sources = [ "categories_unittest.cc" ] |
| |
| deps = [ |
| ":categories", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| if (current_cpu == "x64") { |
| executable("cpuperf_provider_integration_tests") { |
| testonly = true |
| output_name = "cpuperf_provider_integration_tests" |
| |
| sources = [ "cpuperf_provider_integration_tests.cc" ] |
| |
| deps = [ |
| "//garnet/lib/perfmon", |
| "//src/developer/tracing/lib/test_utils", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:test_settings", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| ] |
| } |
| } |
| |
| test_package("cpuperf_provider_tests") { |
| deprecated_shell = "//build" |
| |
| deps = [ ":cpuperf_provider_tests_bin" ] |
| |
| tests = [ |
| { |
| name = "cpuperf_provider_tests" |
| environments = basic_envs |
| }, |
| ] |
| |
| if (current_cpu == "x64") { |
| deps += [ ":cpuperf_provider_integration_tests" ] |
| |
| tests += [ |
| { |
| name = "cpuperf_provider_integration_tests" |
| environments = basic_envs |
| }, |
| ] |
| } |
| } |