Skip to content

Commit 53e3f8e

Browse files
[XRay] Prefix setting XRAY_OPTIONS with env
So setting the environment variable works with the new internal shell. This does not fix all the XRay tests because some of them are using subshells and need to be rewritten to not use subshells.
1 parent 9fe0a70 commit 53e3f8e

14 files changed

+26
-26
lines changed

compiler-rt/test/xray/TestCases/Posix/basic-filtering.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// RUN: %clangxx_xray -std=c++11 %s -o %t -g
55
// RUN: rm -f basic-filtering-*
6-
// RUN: XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1 \
6+
// RUN: env XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1 \
77
// RUN: xray_logfile_base=basic-filtering- \
88
// RUN: xray_naive_log_func_duration_threshold_us=1000 \
99
// RUN: xray_naive_log_max_stack_depth=2" %run %t 2>&1 | \
@@ -14,9 +14,9 @@
1414
// RUN: rm -f basic-filtering-*
1515
//
1616
// Now check support for the XRAY_BASIC_OPTIONS environment variable.
17-
// RUN: XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1 \
17+
// RUN: env XRAY_OPTIONS="patch_premain=true xray_mode=xray-basic verbosity=1 \
1818
// RUN: xray_logfile_base=basic-filtering-" \
19-
// RUN: XRAY_BASIC_OPTIONS="func_duration_threshold_us=1000 max_stack_depth=2" \
19+
// RUN: env XRAY_BASIC_OPTIONS="func_duration_threshold_us=1000 max_stack_depth=2" \
2020
// RUN: %run %t 2>&1 | FileCheck %s
2121
// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t \
2222
// RUN: "`ls basic-filtering-* | head -1`" | \

compiler-rt/test/xray/TestCases/Posix/basic-mode-dso.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -shared -std=c++11 %t/testlib.cpp -o %t/testlib.so
55
// RUN: %clangxx_xray -g -fPIC -fxray-instrument -fxray-shared -std=c++11 %t/main.cpp %t/testlib.so -Wl,-rpath,%t -o %t/main.o
66

7-
// RUN: XRAY_OPTIONS="patch_premain=false,xray_mode=xray-basic,xray_logfile_base=basic-mode-dso-,verbosity=1" XRAY_BASIC_OPTIONS="func_duration_threshold_us=0" %run %t/main.o 2>&1 | FileCheck %s
7+
// RUN: env XRAY_OPTIONS="patch_premain=false,xray_mode=xray-basic,xray_logfile_base=basic-mode-dso-,verbosity=1" XRAY_BASIC_OPTIONS="func_duration_threshold_us=0" %run %t/main.o 2>&1 | FileCheck %s
88
// RUN: %llvm_xray account --format=csv --sort=funcid "`ls basic-mode-dso-* | head -1`" | FileCheck --check-prefix=ACCOUNT %s
99
// RUN: rm basic-mode-dso-*
1010

compiler-rt/test/xray/TestCases/Posix/c-test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang_xray -g -fxray-modes=xray-basic,xray-fdr,xray-profiling -o %t %s
22
// RUN: rm -f xray-log.c-test.*
3-
// RUN: XRAY_OPTIONS=patch_premain=true:verbosity=1:xray_mode=xray-basic %t \
3+
// RUN: env XRAY_OPTIONS=patch_premain=true:verbosity=1:xray_mode=xray-basic %t \
44
// RUN: 2>&1 | FileCheck %s
55
// RUN: rm -f xray-log.c-test.*
66
//

compiler-rt/test/xray/TestCases/Posix/common-trampoline-alignment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// expect 16-byte alignment of the stack.
33
//
44
// RUN: %clangxx_xray -std=c++11 %s -o %t
5-
// RUN: XRAY_OPTIONS="patch_premain=false verbosity=1" \
5+
// RUN: env XRAY_OPTIONS="patch_premain=false verbosity=1" \
66
// RUN: %run %t 2>&1
77
// REQUIRES: x86_64-target-arch
88
// REQUIRES: built-in-llvm-tree

compiler-rt/test/xray/TestCases/Posix/custom-event-handler-alignment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// calls.
33
//
44
// RUN: %clangxx_xray -std=c++11 %s -o %t
5-
// RUN: XRAY_OPTIONS="patch_premain=false verbosity=1" \
5+
// RUN: env XRAY_OPTIONS="patch_premain=false verbosity=1" \
66
// RUN: %run %t 2>&1
77
// REQUIRES: x86_64-target-arch
88
// REQUIRES: built-in-llvm-tree

compiler-rt/test/xray/TestCases/Posix/custom-event-logging.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Use the clang feature for custom xray event logging.
22
//
33
// RUN: %clangxx_xray -std=c++11 %s -o %t
4-
// RUN: XRAY_OPTIONS="patch_premain=false verbosity=1 xray_logfile_base=custom-event-logging.xray-" %run %t 2>&1 | FileCheck %s
4+
// RUN: env XRAY_OPTIONS="patch_premain=false verbosity=1 xray_logfile_base=custom-event-logging.xray-" %run %t 2>&1 | FileCheck %s
55
// RUN: %clangxx_xray -std=c++11 -fpic -fpie %s -o %t
6-
// RUN: XRAY_OPTIONS="patch_premain=false verbosity=1 xray_logfile_base=custom-event-logging.xray-" %run %t 2>&1 | FileCheck %s
6+
// RUN: env XRAY_OPTIONS="patch_premain=false verbosity=1 xray_logfile_base=custom-event-logging.xray-" %run %t 2>&1 | FileCheck %s
77
// FIXME: Support this in non-x86_64 as well
88
// REQUIRES: target={{(aarch64|x86_64)-.*linux.*}}
99
// REQUIRES: built-in-llvm-tree

compiler-rt/test/xray/TestCases/Posix/fdr-mode-inmemory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// RUN: rm -rf %t.dir
33
// RUN: mkdir -p %t.dir
44
// RUN: cd %t.dir
5-
// RUN: XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-inmemory-test- \
5+
// RUN: env XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-inmemory-test- \
66
// RUN: verbosity=1" \
7-
// RUN: XRAY_FDR_OPTIONS="no_file_flush=true func_duration_threshold_us=0" \
7+
// RUN: env XRAY_FDR_OPTIONS="no_file_flush=true func_duration_threshold_us=0" \
88
// RUN: %run %t 2>&1 | FileCheck %s
99
// RUN: FILES=`find %t.dir -name 'fdr-inmemory-test-*' | wc -l`
1010
// RUN: [ $FILES -eq 0 ]

compiler-rt/test/xray/TestCases/Posix/fdr-mode-multiple.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
// RUN: rm -rf %t.dir
33
// RUN: mkdir -p %t.dir
44
// RUN: cd %t.dir
5-
// RUN: XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-inmemory-test- \
5+
// RUN: env XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-inmemory-test- \
66
// RUN: verbosity=1" \
7-
// RUN: XRAY_FDR_OPTIONS="no_file_flush=true func_duration_threshold_us=0" \
7+
// RUN: env XRAY_FDR_OPTIONS="no_file_flush=true func_duration_threshold_us=0" \
88
// RUN: %run %t 2>&1 | FileCheck %s
99
// RUN: FILES=`find %t.dir -name 'fdr-inmemory-test-*' | wc -l`
1010
// RUN: [ $FILES -eq 0 ]

compiler-rt/test/xray/TestCases/Posix/fdr-mode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// RUN: %clangxx_xray -g -std=c++11 %s -o %t
22
// RUN: rm -f fdr-logging-test-*
33
// RUN: rm -f fdr-unwrite-test-*
4-
// RUN: XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-logging-test- \
4+
// RUN: env XRAY_OPTIONS="patch_premain=false xray_logfile_base=fdr-logging-test- \
55
// RUN: xray_mode=xray-fdr verbosity=1" \
6-
// RUN: XRAY_FDR_OPTIONS="func_duration_threshold_us=0" \
6+
// RUN: env XRAY_FDR_OPTIONS="func_duration_threshold_us=0" \
77
// RUN: %run %t 2>&1 | FileCheck %s
8-
// RUN: XRAY_OPTIONS="patch_premain=false \
8+
// RUN: env XRAY_OPTIONS="patch_premain=false \
99
// RUN: xray_logfile_base=fdr-unwrite-test- xray_mode=xray-fdr \
1010
// RUN: verbosity=1" \
11-
// RUN: XRAY_FDR_OPTIONS="func_duration_threshold_us=5000" \
11+
// RUN: env XRAY_FDR_OPTIONS="func_duration_threshold_us=5000" \
1212
// RUN: %run %t 2>&1 | FileCheck %s
1313
// RUN: %llvm_xray convert --symbolize --output-format=yaml -instr_map=%t \
1414
// RUN: "`ls fdr-logging-test-* | head -1`" \

compiler-rt/test/xray/TestCases/Posix/fdr-thread-order.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: rm -rf %t && mkdir %t
22
// RUN: %clangxx_xray -g -std=c++11 %s -o %t.exe
3-
// RUN: XRAY_OPTIONS="patch_premain=false \
3+
// RUN: env XRAY_OPTIONS="patch_premain=false \
44
// RUN: xray_logfile_base=%t/ xray_mode=xray-fdr verbosity=1" \
55
// RUN: XRAY_FDR_OPTIONS=func_duration_threshold_us=0 %run %t.exe 2>&1 | \
66
// RUN: FileCheck %s

0 commit comments

Comments
 (0)