[test-suite] r318473 - [XRay] [test-suite] Add FDR mode microbenchmark
Eizan Miyamoto via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 15:38:29 PST 2017
Author: eizan
Date: Thu Nov 16 15:38:29 2017
New Revision: 318473
URL: http://llvm.org/viewvc/llvm-project?rev=318473&view=rev
Log:
[XRay] [test-suite] Add FDR mode microbenchmark
Summary:
Move retref-bench sources and support files into new subdir
Add XRay FDR mode microbenchmark
Reviewers: dberris
Reviewed By: dberris
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D40010
Added:
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/CMakeLists.txt
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench.cc
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test
test-suite/trunk/MicroBenchmarks/XRay/FDRMode/lit.local.cfg
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/CMakeLists.txt
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/lit.local.cfg
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench.cc
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_RDTSCP_Cost.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatched.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedUnPatched.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test
test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnNeverInstrumented.test
- copied, changed from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test
Removed:
test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg
test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test
test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test
Modified:
test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt
Modified: test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt?rev=318473&r1=318472&r2=318473&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt Thu Nov 16 15:38:29 2017
@@ -1,23 +1,2 @@
-check_cxx_compiler_flag(-fxray-instrument COMPILER_HAS_FXRAY_INSTRUMENT)
-if(ARCH STREQUAL "x86" AND COMPILER_HAS_FXRAY_INSTRUMENT)
- file(COPY lit.local.cfg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-
- list(APPEND CPPFLAGS -std=c++11 -Wl,--gc-sections -fxray-instrument)
- list(APPEND LDFLAGS -fxray-instrument)
- llvm_test_run(--benchmark_filter=dummy_skip_ignore)
- llvm_test_executable(retref-bench retref-bench.cc)
- target_link_libraries(retref-bench benchmark)
-
- file(COPY retref-bench_BM_ReturnNeverInstrumented.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedUnPatched.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatched.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_RDTSCP_Cost.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
- DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-endif()
+add_subdirectory(ReturnReference)
+add_subdirectory(FDRMode)
Copied: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/CMakeLists.txt (from r317962, test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/CMakeLists.txt?p2=test-suite/trunk/MicroBenchmarks/XRay/FDRMode/CMakeLists.txt&p1=test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/CMakeLists.txt Thu Nov 16 15:38:29 2017
@@ -5,19 +5,19 @@ if(ARCH STREQUAL "x86" AND COMPILER_HAS_
list(APPEND CPPFLAGS -std=c++11 -Wl,--gc-sections -fxray-instrument)
list(APPEND LDFLAGS -fxray-instrument)
llvm_test_run(--benchmark_filter=dummy_skip_ignore)
- llvm_test_executable(retref-bench retref-bench.cc)
- target_link_libraries(retref-bench benchmark)
+ llvm_test_executable(fdrmode-bench fdrmode-bench.cc)
+ target_link_libraries(fdrmode-bench benchmark)
- file(COPY retref-bench_BM_ReturnNeverInstrumented.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedUnPatched.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatched.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_RDTSCP_Cost.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
- file(COPY retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
+ file(COPY fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test
DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench.cc
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench.cc?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench.cc (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench.cc Thu Nov 16 15:38:29 2017
@@ -0,0 +1,86 @@
+//===- fdrmode-bench.cc - XRay Instrumentation Benchmarks ------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// Define benchmarks for measuring the cost of XRay instrumentation when using
+// flight data recorder mode.
+//
+//===----------------------------------------------------------------------===//
+
+#include <assert.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include "benchmark/benchmark.h"
+#include "xray/xray_interface.h"
+#include "xray/xray_log_interface.h"
+
+namespace {
+
+// This needs to be a global value so that the compiler doesn't end up writing
+// to data on the stack. We also mark it volatile to preserve all the loads and
+// stores performed on this variable.
+volatile int val = 0;
+
+__xray::FDRLoggingOptions Options;
+
+} // namespace
+
+// We define a multi-threaded benchmark which measures the overall costs
+// introduced by the XRay handlers upstream. This will exercise a tight loop
+// calling a single function that practically does nothing.
+[[clang::xray_always_instrument]] __attribute__((noinline)) __attribute__((weak)) int
+EmptyFunction() {
+ return 0;
+}
+
+volatile bool log_initialized = false;
+
+// Force installation of the FDR logging implementation upstream, with the
+// caveat that we're writing the log out to /dev/null.
+[[clang::xray_never_instrument]] void SetUpXRayFDRMultiThreaded(
+ benchmark::State& state) {
+ if (!log_initialized) {
+ Options.ReportErrors = true;
+ Options.Fd = open("/dev/null", O_WRONLY);
+ assert((Options.Fd != -1) && "Cannot open /dev/null!");
+ __xray_log_init(getpagesize(), 1 << 16, &Options,
+ sizeof(__xray::FDRLoggingOptions));
+ __xray_remove_customevent_handler();
+ __xray_patch();
+ log_initialized = true;
+ }
+}
+
+[[clang::xray_never_instrument]] void TearDownXRayFDRMultiThreaded(
+ benchmark::State& state) {
+ if (log_initialized) {
+ log_initialized = false;
+ __xray_log_finalize();
+ __xray_log_flushLog();
+ __xray_unpatch();
+ }
+}
+
+[[clang::xray_never_instrument]] static void BM_XRayFDRMultiThreaded(
+ benchmark::State& state) {
+ if (state.thread_index == 0) {
+ SetUpXRayFDRMultiThreaded(state);
+ }
+ while (state.KeepRunning()) {
+ val = EmptyFunction();
+ benchmark::DoNotOptimize(val);
+ }
+ if (state.thread_index == 0) {
+ TearDownXRayFDRMultiThreaded(state);
+ }
+}
+
+BENCHMARK(BM_XRayFDRMultiThreaded)
+ ->ThreadRange(1, 32); // Number of threads
+
+BENCHMARK_MAIN();
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_16_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:16$
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_1_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:1$
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_2_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:2$
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_32_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:32$
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_4_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:4$
Added: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test?rev=318473&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test (added)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/fdrmode-bench_BM_XRayFDRMultiThreaded_8_thread.test Thu Nov 16 15:38:29 2017
@@ -0,0 +1 @@
+RUN: %S/fdrmode-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_XRayFDRMultiThreaded/threads:8$
Copied: test-suite/trunk/MicroBenchmarks/XRay/FDRMode/lit.local.cfg (from r317962, test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/FDRMode/lit.local.cfg?p2=test-suite/trunk/MicroBenchmarks/XRay/FDRMode/lit.local.cfg&p1=test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/FDRMode/lit.local.cfg Thu Nov 16 15:38:29 2017
@@ -1,4 +1,4 @@
-config.environment['XRAY_OPTIONS'] = 'patch_premain=false xray_naive_log=false'
+config.environment['XRAY_OPTIONS'] = 'patch_premain=false xray_naive_log=false xray_fdr_log=true'
test_modules = config.test_modules
if 'run' in test_modules:
# Insert microbenchmark module behind 'run'
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/CMakeLists.txt (from r317962, test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/CMakeLists.txt?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/CMakeLists.txt&p1=test-suite/trunk/MicroBenchmarks/XRay/CMakeLists.txt&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/lit.local.cfg (from r317962, test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/lit.local.cfg?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/lit.local.cfg&p1=test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench.cc (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench.cc?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench.cc&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_RDTSCP_Cost.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_RDTSCP_Cost.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_RDTSCP_Cost.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatched.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatched.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatched.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedUnPatched.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedUnPatched.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnInstrumentedUnPatched.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Copied: test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnNeverInstrumented.test (from r317962, test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test)
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnNeverInstrumented.test?p2=test-suite/trunk/MicroBenchmarks/XRay/ReturnReference/retref-bench_BM_ReturnNeverInstrumented.test&p1=test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test&r1=317962&r2=318473&rev=318473&view=diff
==============================================================================
(empty)
Removed: test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/lit.local.cfg (removed)
@@ -1,8 +0,0 @@
-config.environment['XRAY_OPTIONS'] = 'patch_premain=false xray_naive_log=false'
-test_modules = config.test_modules
-if 'run' in test_modules:
- # Insert microbenchmark module behind 'run'
- test_modules.insert(test_modules.index('run')+1, 'microbenchmark')
- # Timeit results are not useful for microbenchmarks
- if 'timeit' in test_modules:
- test_modules.remove('timeit')
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench.cc (removed)
@@ -1,117 +0,0 @@
-//===- retref-bench.cc - XRay Instrumentation Benchmarks ------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// Define benchmarks for measuring the cost of XRay instrumentation (the sleds,
-// the trampolines).
-//
-//===----------------------------------------------------------------------===//
-
-#include <x86intrin.h>
-
-#include "benchmark/benchmark.h"
-#include "xray/xray_interface.h"
-
-[[clang::xray_never_instrument]] __attribute__((noinline)) int
-neverInstrumented() {
- benchmark::ClobberMemory();
- return 0;
-}
-
-[[clang::xray_never_instrument]] static void BM_ReturnNeverInstrumented(
- benchmark::State& state) {
- while (state.KeepRunning()) {
- benchmark::DoNotOptimize(neverInstrumented());
- }
-}
-
-BENCHMARK(BM_ReturnNeverInstrumented);
-
-[[clang::xray_always_instrument]] __attribute__((noinline)) int
-alwaysInstrumented() {
- benchmark::ClobberMemory();
- return 0;
-}
-
-[[clang::xray_never_instrument]] static void BM_ReturnInstrumentedUnPatched(
- benchmark::State& state) {
- __xray_unpatch();
- while (state.KeepRunning()) {
- int x;
- benchmark::DoNotOptimize(x = alwaysInstrumented());
- benchmark::ClobberMemory();
- }
-}
-
-BENCHMARK(BM_ReturnInstrumentedUnPatched);
-
-
-[[clang::xray_never_instrument]] static void BM_ReturnInstrumentedPatchedThenUnpatched(
- benchmark::State& state) {
- __xray_patch();
- __xray_unpatch();
- while (state.KeepRunning()) {
- int x;
- benchmark::DoNotOptimize(x = alwaysInstrumented());
- benchmark::ClobberMemory();
- }
-}
-
-BENCHMARK(BM_ReturnInstrumentedPatchedThenUnpatched);
-
-
-[[clang::xray_never_instrument]] static void BM_ReturnInstrumentedPatched(
- benchmark::State& state) {
- __xray_patch();
- while (state.KeepRunning()) {
- int x;
- benchmark::DoNotOptimize(alwaysInstrumented());
- benchmark::ClobberMemory();
- }
-}
-
-BENCHMARK(BM_ReturnInstrumentedPatched);
-
-[[clang::xray_never_instrument]] static void BM_RDTSCP_Cost(
- benchmark::State& state) {
- while (state.KeepRunning()) {
- unsigned cpu;
- unsigned tsc;
- benchmark::DoNotOptimize(tsc = __rdtscp(&cpu));
- benchmark::ClobberMemory();
- }
-}
-
-volatile unsigned global_cpu;
-volatile unsigned tsc;
-[[clang::xray_never_instrument]] void benchmark_handler(int32_t,
- XRayEntryType) {
- unsigned cpu;
- benchmark::DoNotOptimize(tsc = __rdtscp(&cpu));
- global_cpu = cpu;
- benchmark::ClobberMemory();
-}
-
-BENCHMARK(BM_RDTSCP_Cost);
-
-[[clang::xray_never_instrument]] static void
-BM_ReturnInstrumentedPatchedWithLogHandler(benchmark::State& state) {
- __xray_set_handler(benchmark_handler);
- __xray_patch();
- benchmark::ClobberMemory();
- while (state.KeepRunning()) {
- int x;
- benchmark::DoNotOptimize(x = alwaysInstrumented());
- benchmark::ClobberMemory();
- }
- __xray_remove_handler();
-}
-
-BENCHMARK(BM_ReturnInstrumentedPatchedWithLogHandler);
-
-BENCHMARK_MAIN();
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_RDTSCP_Cost.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_RDTSCP_Cost
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatched.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_ReturnInstrumentedPatched
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedThenUnpatched.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_ReturnInstrumentedPatchedThenUnpatched
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedPatchedWithLogHandler.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_ReturnInstrumentedPatchedWithLogHandler
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnInstrumentedUnPatched.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_ReturnInstrumentedUnPatched
Removed: test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test?rev=318472&view=auto
==============================================================================
--- test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test (original)
+++ test-suite/trunk/MicroBenchmarks/XRay/retref-bench_BM_ReturnNeverInstrumented.test (removed)
@@ -1 +0,0 @@
-RUN: %S/retref-bench --benchmark_repetitions=10 --benchmark_report_aggregates_only=true --benchmark_filter=BM_ReturnNeverInstrumented
More information about the llvm-commits
mailing list