[benchmarks] Move Inspect under zircon_benchmarks
move inspect.cc and inspector.cc from instrumentation_benchmarks
to zircon_benchmarks.
Rename them to expose.cc and inspect.cc respectively.
Remove instrumentation_benchmarks entirely, and remove it from
the packages.
Test: /pkgfs/packages/zircon_benchmarks/0/test/zircon_benchmarks -p --filter Inspect
/pkgfs/packages/zircon_benchmarks/0/test/zircon_benchmarks -p --filter Expose
CF-205 #done
Change-Id: I70beb285d96c803f95473799d0b22dd903f41e52
diff --git a/garnet/bin/instrumentation_benchmarks/BUILD.gn b/garnet/bin/instrumentation_benchmarks/BUILD.gn
deleted file mode 100644
index a47b74d..0000000
--- a/garnet/bin/instrumentation_benchmarks/BUILD.gn
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2016 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/fidl/fidl.gni")
-import("//build/package.gni")
-
-executable("bin") {
- output_name = "instrumentation_benchmarks"
- testonly = true
- sources = [
- "inspect.cc",
- "inspector.cc",
- "test_runner.cc",
- ]
- deps = [
- "//garnet/public/lib/component/cpp",
- "//zircon/public/lib/inspect-vmo",
- "//garnet/public/lib/fsl",
- "//garnet/public/lib/fxl",
- "//zircon/public/lib/fbl",
- "//zircon/public/lib/fdio",
- "//zircon/public/lib/fs",
- "//zircon/public/lib/zx",
- ]
- public_deps = [
- "//zircon/public/lib/perftest",
- ]
- libs = [ "zircon" ]
-}
-
-package("instrumentation_benchmarks") {
- testonly = true
-
- deps = [
- ":bin",
- ]
-
- tests = [
- {
- name = "instrumentation_benchmarks"
- },
- ]
-}
diff --git a/garnet/bin/instrumentation_benchmarks/README.md b/garnet/bin/instrumentation_benchmarks/README.md
deleted file mode 100644
index 966d2b3..0000000
--- a/garnet/bin/instrumentation_benchmarks/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-# Instrumentation Benchmarks
-
-Microbenchmarks for Inspect library (ExposedObject).
-
-## Writing Benchmarks
-
-This uses Zircon's
-[perftest](https://fuchsia.googlesource.com/fuchsia/+/master/zircon/system/ulib/perftest/)
-library.
-
-## Running Benchmarks
-
-There are two ways to run instrumentation_benchmarks:
-
-* perftest mode: This mode will record the times taken by each run of
- the benchmarks, allowing further analysis, which is useful for
- detecting performance regressions. It also prints some summary
- statistics. This uses the test runner provided by Zircon's perftest
- library.
-
- For this, run
- `/pkgfs/packages/instrumentation_benchmarks/0/test/instrumentation_benchmarks -p
- --out=output.json`. The result data will be written to
- `output.json` using our [perf test result schema].
-
- See Zircon's perftest library for details of the other command line
- options.
-
-* Test-only mode: This runs on the bots via `runtests`, and it just checks
- that each benchmark still works. It runs quickly -- it runs only a small
- number of iterations of each benchmark. It does not print any
- performance information.
-
- For this, run
- `/pkgfs/packages/instrumentation_benchmarks/0/test/instrumentation_benchmarks`.
-
-[perf test result schema]: https://fuchsia.googlesource.com/fuchsia/+/master/docs/development/benchmarking/results_schema.md
diff --git a/garnet/bin/instrumentation_benchmarks/test_runner.cc b/garnet/bin/instrumentation_benchmarks/test_runner.cc
deleted file mode 100644
index cf92e46..0000000
--- a/garnet/bin/instrumentation_benchmarks/test_runner.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2016 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.
-
-#include <perftest/perftest.h>
-
-int main(int argc, char** argv) {
-
- return perftest::PerfTestMain(argc, argv, "fuchsia.instrumentation_benchmarks");
-}
diff --git a/garnet/bin/instrumentation_benchmarks/test_runner.h b/garnet/bin/instrumentation_benchmarks/test_runner.h
deleted file mode 100644
index c59f5d7..0000000
--- a/garnet/bin/instrumentation_benchmarks/test_runner.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// 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.
-
-// TODO(CF-260): De-dup this and ../zircon_benchmarks/test_runner.cc/.h
-
-#pragma once
-
-#include <perftest/perftest.h>
-
-namespace fbenchmark {
-
-// Register a benchmark that is specified by a class.
-//
-// Any class may be used as long as it provides a Run() method that runs an
-// iteration of the test.
-template <class TestClass, typename... Args>
-void RegisterTest(const char* test_name, Args... args) {
- perftest::RegisterTest(test_name, [=](perftest::RepeatState* state) {
- TestClass test(args...);
- while (state->KeepRunning()) {
- test.Run();
- }
- return true;
- });
-}
-
-typedef void TestFunc();
-
-// Convenience routine for registering a benchmark that is specified by a
-// function. This is for benchmarks that don't set up any fixtures that
-// are shared across invocations of the function.
-//
-// This takes the function as a template parameter rather than as a value
-// parameter in order to avoid the potential cost of an indirect function
-// call and hence be consistent with RegisterTest() (which also avoids an
-// indirect function call).
-template <TestFunc test_func>
-void RegisterTestFunc(const char* test_name) {
- class TestClass {
- public:
- void Run() { test_func(); }
- };
- RegisterTest<TestClass>(test_name);
-}
-
-} // namespace fbenchmark
diff --git a/garnet/bin/zircon_benchmarks/BUILD.gn b/garnet/bin/zircon_benchmarks/BUILD.gn
index ac89422..dcfba5e 100644
--- a/garnet/bin/zircon_benchmarks/BUILD.gn
+++ b/garnet/bin/zircon_benchmarks/BUILD.gn
@@ -11,9 +11,11 @@
sources = [
"channels.cc",
"events.cc",
+ "expose.cc",
"fifos.cc",
"filesystem.cc",
"handle.cc",
+ "inspect.cc",
"lazy_dir.cc",
"mmu.cc",
"ports.cc",
@@ -30,6 +32,8 @@
]
deps = [
":fidl_interface",
+ "//garnet/public/lib/component/cpp",
+ "//zircon/public/lib/inspect-vmo",
"//garnet/public/lib/fsl",
"//garnet/public/lib/fxl",
"//zircon/public/lib/fbl",
diff --git a/garnet/bin/instrumentation_benchmarks/inspect.cc b/garnet/bin/zircon_benchmarks/expose.cc
similarity index 98%
rename from garnet/bin/instrumentation_benchmarks/inspect.cc
rename to garnet/bin/zircon_benchmarks/expose.cc
index 8ff131c..7e2f61e 100644
--- a/garnet/bin/instrumentation_benchmarks/inspect.cc
+++ b/garnet/bin/zircon_benchmarks/expose.cc
@@ -523,8 +523,6 @@
return true;
}
-// /pkgfs/packages/instrumentation_benchmarks/0/test/instrumentation_benchmarks -p
-
void RegisterTests() {
perftest::RegisterTest("Expose/ExposedObject/Lifecycle", TestExposedObjectLifecycle);
perftest::RegisterTest("Expose/ExposedObject/Increment", TestExposedObjectIncrement);
diff --git a/garnet/bin/instrumentation_benchmarks/inspector.cc b/garnet/bin/zircon_benchmarks/inspect.cc
similarity index 97%
rename from garnet/bin/instrumentation_benchmarks/inspector.cc
rename to garnet/bin/zircon_benchmarks/inspect.cc
index 897d0b7..d1b20c8 100644
--- a/garnet/bin/instrumentation_benchmarks/inspector.cc
+++ b/garnet/bin/zircon_benchmarks/inspect.cc
@@ -120,9 +120,6 @@
return true;
}
-
-// /pkgfs/packages/instrumentation_benchmarks/0/test/instrumentation_benchmarks -p
-
void RegisterTests() {
perftest::RegisterTest("Inspect/IntMetric/Lifecycle", TestIntMetricLifecycle);
perftest::RegisterTest("Inspect/IntMetric/Modify", TestIntMetricModify);
diff --git a/garnet/packages/benchmarks/all b/garnet/packages/benchmarks/all
index 2f01d74..5ec40c6 100644
--- a/garnet/packages/benchmarks/all
+++ b/garnet/packages/benchmarks/all
@@ -2,7 +2,6 @@
"imports": [
"garnet/packages/benchmarks/garnet",
"garnet/packages/benchmarks/buildbot",
- "garnet/packages/benchmarks/instrumentation",
"garnet/packages/benchmarks/zircon"
]
}
diff --git a/garnet/packages/benchmarks/instrumentation b/garnet/packages/benchmarks/instrumentation
deleted file mode 100644
index ec33dbb..0000000
--- a/garnet/packages/benchmarks/instrumentation
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "packages": [
- "//garnet/bin/instrumentation_benchmarks"
- ]
-}