test: adapt test-linux-perf to V8 changes

Refs: https://github.com/v8/v8/commit/9a31804bbe6597bfb54b47958fd3839f2da51875

PR-URL: https://github.com/nodejs/node/pull/38273
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
This commit is contained in:
Michaël Zasso committed 2021-06-10 11:11:50 +02:00
1 parent f691deef26
commit ce4b4cc0af
1 file changed
+11 -8
+11 -8
View File
@@ -96,17 +96,20 @@ for (const perfArgs of perfArgsList) {
output += perfScript.stdout;
}
const interpretedFunctionOneRe = /InterpretedFunction:functionOne/;
const compiledFunctionOneRe = /LazyCompile:\*functionOne/;
const interpretedFunctionTwoRe = /InterpretedFunction:functionTwo/;
const compiledFunctionTwoRe = /LazyCompile:\*functionTwo/;
const interpretedFunctionOneRe = /~functionOne/;
const compiledFunctionOneRe = /\*functionOne/;
const interpretedFunctionTwoRe = /~functionTwo/;
const compiledFunctionTwoRe = /\*functionTwo/;
function makeAssertMessage(message) {
return message + '\nPerf output:\n\n' + output;
}
assert.ok(output.match(interpretedFunctionOneRe),
"Couldn't find interpreted functionOne()");
makeAssertMessage("Couldn't find interpreted functionOne()"));
assert.ok(output.match(compiledFunctionOneRe),
"Couldn't find compiled functionOne()");
makeAssertMessage("Couldn't find compiled functionOne()"));
assert.ok(output.match(interpretedFunctionTwoRe),
"Couldn't find interpreted functionTwo()");
makeAssertMessage("Couldn't find interpreted functionTwo()"));
assert.ok(output.match(compiledFunctionTwoRe),
"Couldn't find compiled functionTwo");
makeAssertMessage("Couldn't find compiled functionTwo"));