Skip to content

Commit ddf1249

Browse files
authored
[Test] Disable Linux perf test under WSL (#137822)
Linux perf_events is not implemented in WSL1, skip the test that requires it. There is just a single test that requires perf_events. It fails under WSL1 with: ```sh env JITDUMPDIR=/home/meinersbur/build/llvm-project/release/test/ExecutionEngine/JITLink/x86-64/Output/ELF_perf.s.tmp /home/meinersbur/build/llvm-project/release/bin/llvm-jitlink -perf-support /home/meinersbur/build/llvm-project/release/test/ExecutionEngine/JITLink/x86-64/Output/ELF_perf.s.tmp/ELF_x86-64_perf.o llvm-jitlink error: PerfState not initialized ``` WSL environment detection logic follows https://github.com/scivision/detect-windows-subsystem-for-linux/blob/main/is_wsl.py Also see WSL issue: microsoft/WSL#4595
1 parent 9b63bdd commit ddf1249

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

llvm/test/ExecutionEngine/JITLink/x86-64/ELF_perf.s

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# REQUIRES: native && x86_64-linux
22

3+
# Linux perf not supported by Windows Kernel's Linux syscall emulation layer
4+
# https://github.com/microsoft/WSL/issues/4595
5+
# UNSUPPORTED: wsl1
6+
37
# FIXME: Investigate why broken with MSAN
48
# UNSUPPORTED: msan
59

llvm/test/lit.cfg.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ def version_int(ver):
383383
# Others/can-execute.txt
384384
config.available_features.add("can-execute")
385385

386+
# Detect Windows Subsystem for Linux (WSL)
387+
uname_r = platform.uname().release
388+
if uname_r.endswith("-Microsoft"):
389+
config.available_features.add("wsl1")
390+
elif uname_r.endswith("microsoft-standard-WSL2"):
391+
config.available_features.add("wsl2")
392+
386393
# Loadable module
387394
if config.has_plugins:
388395
config.available_features.add("plugins")

0 commit comments

Comments
 (0)