blob: 3dc5faf9f31686ba2cb3ec6338694bae14ec98a0 [file] [log] [blame]
# 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("//src/sys/build/components.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/zircon-internal",
"//zircon/system/ulib/trace",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
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/zircon-internal",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/trace",
"//zircon/system/ulib/trace-provider:trace-provider-with-fdio",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_package_with_single_component("cpuperf_provider") {
manifest = "meta/cpuperf_provider.cmx"
deps = [ ":bin" ]
}
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_bin") {
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",
]
}
fuchsia_test_component("cpuperf_provider_integration_tests_component") {
component_name = "cpuperf_provider_integration_tests"
manifest = "meta/cpuperf_provider_integration_tests.cmx"
deps = [ ":cpuperf_provider_integration_tests_bin" ]
}
}
fuchsia_unittest_component("cpuperf_provider_tests_component") {
component_name = "cpuperf_provider_tests"
manifest = "meta/cpuperf_provider_tests.cmx"
deps = [ ":cpuperf_provider_tests_bin" ]
}
fuchsia_test_package("cpuperf_provider_tests") {
test_components = [ ":cpuperf_provider_tests_component" ]
if (current_cpu == "x64") {
test_components += [ ":cpuperf_provider_integration_tests_component" ]
}
test_specs = {
environments = basic_envs
}
}