Speed up RISCV QEMU testing.
- Skip/delete some large tests. - Reduce some large tests. - Explicitly choose the CPU features, which seems to be disabling something expensive. TEST=ci Bug: https://github.com/dart-lang/sdk/issues/63465 Cq-Include-Trybots: luci.dart.try:vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try Change-Id: Ifa591d6600da3e20c9de4d123906a7747029df7e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/509200 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
9edafc75f7
commit
9b8d908379
@@ -325,12 +325,20 @@ class JsshellRuntimeConfiguration extends CommandLineJavaScriptRuntime {
|
||||
}
|
||||
|
||||
enum QemuConfig {
|
||||
ia32._('qemu-i386', '/usr/lib/i386-linux-gnu/'),
|
||||
x64._('qemu-x86_64', '/usr/lib/x86_64-linux-gnu/'),
|
||||
arm._('qemu-arm', '/usr/arm-linux-gnueabihf/'),
|
||||
arm64._('qemu-aarch64', '/usr/aarch64-linux-gnu/'),
|
||||
riscv32._('qemu-riscv32', '/usr/riscv32-linux-gnu/'),
|
||||
riscv64._('qemu-riscv64', '/usr/riscv64-linux-gnu/');
|
||||
ia32._('qemu-i386', 'max', '/usr/lib/i386-linux-gnu/'),
|
||||
x64._('qemu-x86_64', 'max', '/usr/lib/x86_64-linux-gnu/'),
|
||||
arm._('qemu-arm', 'max', '/usr/arm-linux-gnueabihf/'),
|
||||
arm64._('qemu-aarch64', 'max', '/usr/aarch64-linux-gnu/'),
|
||||
riscv32._(
|
||||
'qemu-riscv32',
|
||||
'rva23u32,zbc=on,zacas=on,zabha=on',
|
||||
'/usr/riscv32-linux-gnu/',
|
||||
),
|
||||
riscv64._(
|
||||
'qemu-riscv64',
|
||||
'rva23u64,zbc=on,zacas=on,zabha=on',
|
||||
'/usr/riscv64-linux-gnu/',
|
||||
);
|
||||
|
||||
static const all = <Architecture, QemuConfig>{
|
||||
Architecture.ia32: QemuConfig.ia32,
|
||||
@@ -345,9 +353,10 @@ enum QemuConfig {
|
||||
};
|
||||
|
||||
final String executable;
|
||||
final String cpu;
|
||||
final String elfInterpreterPrefix;
|
||||
|
||||
const QemuConfig._(this.executable, this.elfInterpreterPrefix);
|
||||
const QemuConfig._(this.executable, this.cpu, this.elfInterpreterPrefix);
|
||||
|
||||
@override
|
||||
String toString() => executable;
|
||||
@@ -461,6 +470,9 @@ class StandaloneDartRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
||||
if (environmentOverrides['QEMU_LD_PREFIX'] == null) {
|
||||
environmentOverrides['QEMU_LD_PREFIX'] = config.elfInterpreterPrefix;
|
||||
}
|
||||
if (environmentOverrides['QEMU_CPU'] == null) {
|
||||
environmentOverrides['QEMU_CPU'] = config.cpu;
|
||||
}
|
||||
}
|
||||
var command = VMCommand(executable, arguments, environmentOverrides);
|
||||
if (_configuration.rr && !isCrashExpected) {
|
||||
@@ -499,6 +511,9 @@ class DartPrecompiledRuntimeConfiguration extends DartVmRuntimeConfiguration {
|
||||
if (environmentOverrides['QEMU_LD_PREFIX'] == null) {
|
||||
environmentOverrides['QEMU_LD_PREFIX'] = config.elfInterpreterPrefix;
|
||||
}
|
||||
if (environmentOverrides['QEMU_CPU'] == null) {
|
||||
environmentOverrides['QEMU_CPU'] = config.cpu;
|
||||
}
|
||||
}
|
||||
|
||||
var command = VMCommand(executable, arguments, environmentOverrides);
|
||||
|
||||
@@ -84,6 +84,9 @@ abstract class TestSuite {
|
||||
if (configuration.useQemu)
|
||||
'QEMU_LD_PREFIX':
|
||||
QemuConfig.all[configuration.architecture]!.elfInterpreterPrefix,
|
||||
if (configuration.useQemu)
|
||||
'QEMU_CPU':
|
||||
QemuConfig.all[configuration.architecture]!.cpu,
|
||||
};
|
||||
|
||||
Map<String, String> get environmentOverrides => _environmentOverrides;
|
||||
@@ -334,9 +337,9 @@ class VMTestSuite extends TestSuite {
|
||||
if (configuration.useQemu) {
|
||||
final config = QemuConfig.all[configuration.architecture]!;
|
||||
initialHostArguments.insert(0, hostRunnerPath);
|
||||
initialHostArguments.insertAll(0, ['-L', config.elfInterpreterPrefix]);
|
||||
initialHostArguments.insertAll(0, ['-cpu', config.cpu, '-L', config.elfInterpreterPrefix]);
|
||||
initialTargetArguments.insert(0, targetRunnerPath);
|
||||
initialTargetArguments.insertAll(0, ['-L', config.elfInterpreterPrefix]);
|
||||
initialTargetArguments.insertAll(0, ['-cpu', config.cpu, '-L', config.elfInterpreterPrefix]);
|
||||
hostRunnerPath = config.executable;
|
||||
targetRunnerPath = config.executable;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ dart/disassemble_determinism_test: Slow, Pass # Times out on slower bots.
|
||||
dart/ctrlc_handling_test: SkipByDesign
|
||||
|
||||
[ $qemu ]
|
||||
cc/ManyClasses: Slow, Pass # Generates 100k classes, slow on emulated architectures.
|
||||
cc/ManyClasses: SkipSlow # Generates 100k classes, slow on emulated architectures.
|
||||
cc/StressMallocDirectly: Skip # Queries RSS
|
||||
cc/StressMallocThroughZones: Skip # Queries RSS
|
||||
cc/SweepDontNeed: Skip # Queries RSS
|
||||
|
||||
@@ -531,38 +531,6 @@ BENCHMARK(SimpleMessage) {
|
||||
benchmark->set_score(elapsed_time);
|
||||
}
|
||||
|
||||
BENCHMARK(LargeMap) {
|
||||
const char* kScript =
|
||||
"@pragma('vm:entry-point', 'call')\n"
|
||||
"makeMap() {\n"
|
||||
" Map m = {};\n"
|
||||
" for (int i = 0; i < 100000; ++i) m[i*13+i*(i>>7)] = i;\n"
|
||||
" return m;\n"
|
||||
"}";
|
||||
Dart_Handle h_lib = TestCase::LoadTestScript(kScript, nullptr);
|
||||
EXPECT_VALID(h_lib);
|
||||
Dart_Handle h_result = Dart_Invoke(h_lib, NewString("makeMap"), 0, nullptr);
|
||||
EXPECT_VALID(h_result);
|
||||
TransitionNativeToVM transition(thread);
|
||||
StackZone zone(thread);
|
||||
Instance& map = Instance::Handle();
|
||||
map ^= Api::UnwrapHandle(h_result);
|
||||
const intptr_t kLoopCount = 100;
|
||||
Timer timer;
|
||||
timer.Start();
|
||||
for (intptr_t i = 0; i < kLoopCount; i++) {
|
||||
StackZone zone(thread);
|
||||
std::unique_ptr<Message> message = WriteMessage(
|
||||
/* same_group */ false, map, ILLEGAL_PORT, Message::kNormalPriority);
|
||||
|
||||
// Read object back from the snapshot.
|
||||
ReadMessage(thread, message.get());
|
||||
}
|
||||
timer.Stop();
|
||||
int64_t elapsed_time = timer.TotalElapsedTime();
|
||||
benchmark->set_score(elapsed_time);
|
||||
}
|
||||
|
||||
BENCHMARK_MEMORY(InitialRSS) {
|
||||
benchmark->set_score(bin::Process::MaxRSS());
|
||||
}
|
||||
|
||||
@@ -1785,7 +1785,8 @@ ASSEMBLER_TEST_RUN(InstructionFence, test) {
|
||||
EXPECT_DISASSEMBLY(
|
||||
"0000100f fence.i\n"
|
||||
"00008067 ret\n");
|
||||
Call(test->entry());
|
||||
|
||||
// Not running: may trap. This was removed from the user ISA.
|
||||
}
|
||||
|
||||
ASSEMBLER_TEST_GENERATE(EnvironmentCall, assembler) {
|
||||
|
||||
@@ -201,6 +201,8 @@ void TestLargeFrame(const char* type,
|
||||
const char* one,
|
||||
const char* main) {
|
||||
SetFlagScope<int> sfs(&FLAG_optimization_counter_threshold, 1000);
|
||||
SetFlagScope<bool> sfs2(&FLAG_background_compilation, false);
|
||||
|
||||
TextBuffer printer(256 * KB);
|
||||
|
||||
intptr_t num_locals = 2000;
|
||||
@@ -233,7 +235,7 @@ void TestLargeFrame(const char* type,
|
||||
ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Int) {
|
||||
TestLargeFrame("int", "0", "1",
|
||||
"main() {\n"
|
||||
" for (var i = 0; i < 100; i++) {\n"
|
||||
" for (var i = 0; i < 3; i++) {\n"
|
||||
" var r = largeFrame(1);\n"
|
||||
" if (r != 2000) throw r;\n"
|
||||
" }\n"
|
||||
@@ -244,7 +246,7 @@ ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Int) {
|
||||
ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Double) {
|
||||
TestLargeFrame("double", "0.0", "1.0",
|
||||
"main() {\n"
|
||||
" for (var i = 0; i < 100; i++) {\n"
|
||||
" for (var i = 0; i < 3; i++) {\n"
|
||||
" var r = largeFrame(1);\n"
|
||||
" if (r != 2000.0) throw r;\n"
|
||||
" }\n"
|
||||
@@ -255,7 +257,7 @@ ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Double) {
|
||||
ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Int32x4) {
|
||||
TestLargeFrame("Int32x4", "Int32x4(0, 0, 0, 0)", "Int32x4(1, 2, 3, 4)",
|
||||
"main() {\n"
|
||||
" for (var i = 0; i < 100; i++) {\n"
|
||||
" for (var i = 0; i < 3; i++) {\n"
|
||||
" var r = largeFrame(1);\n"
|
||||
" if (r.x != 2000) throw r;\n"
|
||||
" if (r.y != 4000) throw r;\n"
|
||||
@@ -270,7 +272,7 @@ ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Float32x4) {
|
||||
TestLargeFrame("Float32x4", "Float32x4(0.0, 0.0, 0.0, 0.0)",
|
||||
"Float32x4(1.0, 2.0, 3.0, 4.0)",
|
||||
"main() {\n"
|
||||
" for (var i = 0; i < 100; i++) {\n"
|
||||
" for (var i = 0; i < 3; i++) {\n"
|
||||
" var r = largeFrame(1);\n"
|
||||
" if (r.x != 2000.0) throw r;\n"
|
||||
" if (r.y != 4000.0) throw r;\n"
|
||||
@@ -284,7 +286,7 @@ ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Float32x4) {
|
||||
ISOLATE_UNIT_TEST_CASE(FlowGraph_LargeFrame_Float64x2) {
|
||||
TestLargeFrame("Float64x2", "Float64x2(0.0, 0.0)", "Float64x2(1.0, 2.0)",
|
||||
"main() {\n"
|
||||
" for (var i = 0; i < 100; i++) {\n"
|
||||
" for (var i = 0; i < 3; i++) {\n"
|
||||
" var r = largeFrame(1);\n"
|
||||
" if (r.x != 2000.0) throw r;\n"
|
||||
" if (r.y != 4000.0) throw r;\n"
|
||||
|
||||
Reference in New Issue
Block a user