| # Copyright 2018 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") |
| |
| source_set("session_spec") { |
| sources = [ |
| "session_spec.cc", |
| "session_spec.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/lib/perfmon", |
| "//src/lib/fxl", |
| "//src/lib/json_parser", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. |
| "//zircon/third_party/rapidjson", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| source_set("session_result_spec") { |
| sources = [ |
| "session_result_spec.cc", |
| "session_result_spec.h", |
| ] |
| |
| public_deps = [ |
| "//garnet/lib/perfmon", |
| "//src/lib/fxl", |
| "//src/lib/json_parser", |
| |
| # TODO(fxbug.dev/57392): Move it back to //third_party once unification completes. |
| "//zircon/third_party/rapidjson", |
| ] |
| configs += [ |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| "//build/config:Wno-conversion", |
| ] |
| } |
| |
| executable("bin") { |
| output_name = "cpuperf" |
| |
| sources = [ |
| "main.cc", |
| "print_tallies.cc", |
| "print_tallies.h", |
| ] |
| |
| deps = [ |
| ":session_result_spec", |
| ":session_spec", |
| "//garnet/lib/debugger_utils", |
| "//garnet/lib/perfmon", |
| "//src/lib/fxl", |
| "//src/zircon/lib/zircon", |
| ] |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| package("cpuperf") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "cpuperf" |
| shell = true |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/cpuperf.cmx") |
| dest = "cpuperf.cmx" |
| }, |
| ] |
| |
| resources = [] |
| |
| if (current_cpu == "x64") { |
| resources += [ |
| { |
| path = rebase_path("cpspec/intel/basic-cpu-memory.cpspec") |
| dest = "basic-cpu-memory.cpspec" |
| }, |
| { |
| path = rebase_path("cpspec/intel/l1.cpspec") |
| dest = "l1.cpspec" |
| }, |
| { |
| path = rebase_path("cpspec/intel/l2.cpspec") |
| dest = "l2.cpspec" |
| }, |
| { |
| path = rebase_path("cpspec/intel/l3.cpspec") |
| dest = "l3.cpspec" |
| }, |
| ] |
| } |
| |
| if (current_cpu == "arm64") { |
| resources += [ |
| { |
| path = rebase_path("cpspec/arm64/cycle-counter.cpspec") |
| dest = "cycle-counter.cpspec" |
| }, |
| { |
| path = rebase_path("cpspec/arm64/l1.cpspec") |
| dest = "l1.cpspec" |
| }, |
| ] |
| } |
| } |
| |
| source_set("unittests") { |
| testonly = true |
| |
| sources = [ |
| "session_result_spec_unittest.cc", |
| "session_spec_unittest.cc", |
| ] |
| |
| deps = [ |
| ":session_result_spec", |
| ":session_spec", |
| "//src/lib/fxl", |
| "//third_party/googletest:gtest", |
| ] |
| } |