| # Copyright 2019 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| |
| source_set("perf-mon") { |
| visibility = [ ":*" ] |
| |
| sources = [ |
| "perf-mon.cc", |
| "perf-mon.h", |
| ] |
| |
| if (current_cpu == "arm64") { |
| sources += [ "arm64-pm.cc" ] |
| } else if (current_cpu == "x64") { |
| sources += [ "intel-pm.cc" ] |
| } |
| |
| public_deps = [ |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| ] |
| |
| deps = [ |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/fidl/fuchsia.perfmon.cpu:fuchsia.perfmon.cpu_llcpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zircon-internal", |
| ] |
| } |
| |
| driver_module("cpu-trace") { |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ "cpu-trace.cc" ] |
| |
| if (current_cpu == "x64") { |
| sources += [ "intel-pt.cc" ] |
| } |
| |
| deps = [ |
| ":perf-mon", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/fidl/fuchsia.hardware.cpu.insntrace:fuchsia.hardware.cpu.insntrace_llcpp", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| |
| # TODO(fxb/38132): Migrate to the new bind rules and delete the below |
| "//src/lib/ddk:ddk-deprecated-binding-headers", |
| "//src/lib/ddktl", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":perf-mon-tests-package" ] |
| } |
| |
| test("perf-mon-tests") { |
| output_name = "perf-mon-tests-test" |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| sources = [ "tests/perf-mon-tests.cc" ] |
| deps = [ |
| ":perf-mon", |
| "//sdk/fidl/fuchsia.perfmon.cpu:fuchsia.perfmon.cpu_llcpp", |
| "//sdk/lib/fdio", |
| "//src/devices/lib/driver", |
| "//src/devices/testing/fake-bti", |
| "//src/devices/testing/no_ddk", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| unittest_package("perf-mon-tests-package") { |
| package_name = "perf-mon-tests" |
| deps = [ ":perf-mon-tests" ] |
| |
| tests = [ |
| { |
| name = "perf-mon-tests-test" |
| }, |
| ] |
| } |