summaryrefslogtreecommitdiff
path: root/test/xray
diff options
context:
space:
mode:
authorKeith Wyss <wyssman@gmail.com>2017-04-20 05:59:26 +0000
committerKeith Wyss <wyssman@gmail.com>2017-04-20 05:59:26 +0000
commit35ad9be15fc08a4ebcf312ba30becb8cc788a555 (patch)
treea9db9f0d4ea4563afbf4558a9fd8dc824b20aa07 /test/xray
parentea443214cce6273e3310755a56e5bb22087eae6f (diff)
[XRay] [compiler-rt] - Fix standalone and non-deterministic test issue
Summary: The thread order test fails sometimes my machine independently of standalone build. From testing both standalone and in-tree build, I see I configured it wrong. The other hypothesis for an issue is that cold starts can interfere with whether record unwriting happens. Once this happens more than once, we can naively FileCheck on the wrong test output, which compounds the issue. While "rm blah.* || true" will print to stderr if the glob can't expand, this is mostly harmless and makes sure earlier failing tests don't sabotage us. Example failure: --- header: version: 1 type: 1 constant-tsc: true nonstop-tsc: true cycle-frequency: 3800000000 records: - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-enter, tsc: 2413745203147228 } - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-exit, tsc: 2413745203304238 } ... The CMAKE related change fixes the expectation that COMPILER_RT_STANDALONE_BUILD will be explicitly FALSE instead of empty string when it is not "TRUE". Reviewers: dberris Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32259 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/xray')
-rw-r--r--test/xray/TestCases/Linux/fdr-mode.cc2
-rw-r--r--test/xray/TestCases/Linux/fdr-thread-order.cc3
-rw-r--r--test/xray/lit.site.cfg.in5
3 files changed, 8 insertions, 2 deletions
diff --git a/test/xray/TestCases/Linux/fdr-mode.cc b/test/xray/TestCases/Linux/fdr-mode.cc
index ae7ad863a..f1e087673 100644
--- a/test/xray/TestCases/Linux/fdr-mode.cc
+++ b/test/xray/TestCases/Linux/fdr-mode.cc
@@ -1,4 +1,6 @@
// RUN: %clangxx_xray -g -std=c++11 %s -o %t
+// RUN: rm fdr-logging-test-* || true
+// RUN: rm fdr-unwrite-test-* || true
// RUN: XRAY_OPTIONS="patch_premain=false xray_naive_log=false xray_logfile_base=fdr-logging-test- xray_fdr_log=true verbosity=1 xray_fdr_log_func_duration_threshold_us=0" %run %t 2>&1 | FileCheck %s
// RUN: XRAY_OPTIONS="patch_premain=false xray_naive_log=false xray_logfile_base=fdr-unwrite-test- xray_fdr_log=true verbosity=1 xray_fdr_log_func_duration_threshold_us=5000" %run %t 2>&1 | FileCheck %s
// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t "`ls fdr-logging-test-* | head -1`" | FileCheck %s --check-prefix=TRACE
diff --git a/test/xray/TestCases/Linux/fdr-thread-order.cc b/test/xray/TestCases/Linux/fdr-thread-order.cc
index 814fb70b0..b43a0fe40 100644
--- a/test/xray/TestCases/Linux/fdr-thread-order.cc
+++ b/test/xray/TestCases/Linux/fdr-thread-order.cc
@@ -1,5 +1,6 @@
// RUN: %clangxx_xray -g -std=c++11 %s -o %t
-// RUN: XRAY_OPTIONS="patch_premain=false xray_naive_log=false xray_logfile_base=fdr-thread-order. xray_fdr_log=true verbosity=1" %run %t 2>&1 | FileCheck %s
+// RUN: rm fdr-thread-order.* || true
+// RUN: XRAY_OPTIONS="patch_premain=false xray_naive_log=false xray_logfile_base=fdr-thread-order. xray_fdr_log=true verbosity=1 xray_fdr_log_func_duration_threshold_us=0" %run %t 2>&1 | FileCheck %s
// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t "`ls fdr-thread-order.* | head -1`" | FileCheck %s --check-prefix TRACE
// RUN: rm fdr-thread-order.*
// FIXME: Make llvm-xray work on non-x86_64 as well.
diff --git a/test/xray/lit.site.cfg.in b/test/xray/lit.site.cfg.in
index 32d9f7f39..73c4eff6e 100644
--- a/test/xray/lit.site.cfg.in
+++ b/test/xray/lit.site.cfg.in
@@ -5,8 +5,11 @@ config.name_suffix = "@XRAY_TEST_CONFIG_SUFFIX@"
config.xray_lit_source_dir = "@XRAY_LIT_SOURCE_DIR@"
config.target_cflags = "@XRAY_TEST_TARGET_CFLAGS@"
config.target_arch = "@XRAY_TEST_TARGET_ARCH@"
-config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" == "FALSE")
+config.built_with_llvm = ("@COMPILER_RT_STANDALONE_BUILD@" != "TRUE")
+# TODO: Look into whether we can run a capability test on the standalone build to
+# see whether it can run 'llvm-xray convert' instead of turning off tests for a
+# standalone build.
if config.built_with_llvm:
config.available_features.add('built-in-llvm-tree')