[tools] Profview fixes

- Use consistent names: Ignition, Sparkplug, Maglev, Turbofan
- Fix parsing Sparkpliug / Baseline entries
- Fix c++filt calls for recent MacOS versions
- Do not visualise Turboprop entries anymore

Change-Id: Id8fc83c0822383d4c552c898b15c720c44b95cd7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3865309
Reviewed-by: Jakob Linke <jgruber@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82822}
This commit is contained in:
Camillo Bruni 2022-08-30 13:42:19 +02:00 committed by V8 LUCI CQ
parent 2698ad44cf
commit f30f3815f6
3 changed files with 67 additions and 60 deletions

View File

@ -15,5 +15,5 @@ if [ "`which c++filt`" == "" ]; then
nm "$@" nm "$@"
else else
nm "$@" | sed -n "s/\([0-9a-fA-F]\{8,16\}\) [iItT] \(.*\)/\\1 \\2/p"\ nm "$@" | sed -n "s/\([0-9a-fA-F]\{8,16\}\) [iItT] \(.*\)/\\1 \\2/p"\
| c++filt -p -i | c++filt
fi fi

View File

@ -19,52 +19,56 @@ let codeKinds = [
"STUB", "STUB",
"BUILTIN", "BUILTIN",
"REGEXP", "REGEXP",
"JS_OPT", "JS_IGNITION",
"JS_UNOPT", "JS_SPARKPLUG",
"JS_TURBOPROP", "JS_MAGLEV",
"JS_BASELINE", "JS_TURBOFAN",
]; ];
function resolveCodeKind(code) { function resolveCodeKind(code) {
if (!code || !code.type) { if (!code || !code.type) {
return "UNKNOWN"; return "UNKNOWN";
} else if (code.type === "CPP") { }
const type = code.type;
if (type === "CPP") {
return "CPP"; return "CPP";
} else if (code.type === "SHARED_LIB") { } else if (type === "SHARED_LIB") {
return "LIB"; return "LIB";
} else if (code.type === "CODE") { }
if (code.kind === "LoadIC" || const kind = code.kind;
code.kind === "StoreIC" || if (type === "CODE") {
code.kind === "KeyedStoreIC" || if (kind === "LoadIC" ||
code.kind === "KeyedLoadIC" || kind === "StoreIC" ||
code.kind === "LoadGlobalIC" || kind === "KeyedStoreIC" ||
code.kind === "Handler") { kind === "KeyedLoadIC" ||
kind === "LoadGlobalIC" ||
kind === "Handler") {
return "IC"; return "IC";
} else if (code.kind === "BytecodeHandler") { } else if (kind === "BytecodeHandler") {
return "BC"; return "BC";
} else if (code.kind === "Stub") { } else if (kind === "Stub") {
return "STUB"; return "STUB";
} else if (code.kind === "Builtin") { } else if (kind === "Builtin") {
return "BUILTIN"; return "BUILTIN";
} else if (code.kind === "RegExp") { } else if (kind === "RegExp") {
return "REGEXP"; return "REGEXP";
} }
console.log("Unknown CODE: '" + code.kind + "'."); console.warn("Unknown CODE: '" + kind + "'.");
return "CODE"; return "CODE";
} else if (code.type === "JS") { } else if (type === "JS") {
if (code.kind === "Builtin") { if (kind === "Builtin" || kind == "Ignition" || kind === "Unopt") {
return "JS_UNOPT"; return "JS_IGNITION";
} else if (code.kind === "Opt") { } else if (kind === "Baseline" || kind === "Sparkplug") {
return "JS_OPT"; return "JS_SPARKPLUG";
} else if (code.kind === "Unopt") { } else if (kind === "Maglev") {
return "JS_UNOPT"; return "JS_MAGLEV";
} else if (code.kind === "Baseline") { } else if (kind === "Turboprop") {
return "JS_BASELINE";
} else if (code.kind === "Turboprop") {
return "JS_TURBOPROP"; return "JS_TURBOPROP";
} else if (kind === "Opt" || kind === "Turbofan") {
return "JS_TURBOFAN";
} }
} }
console.log("Unknown code type '" + type + "'."); console.warn("Unknown code type '" + kind + "'.");
} }
function resolveCodeKindAndVmState(code, vmState) { function resolveCodeKindAndVmState(code, vmState) {
@ -271,10 +275,10 @@ function buildCategoryTreeAndLookup() {
} }
root.children.push(n); root.children.push(n);
} }
addCategory("JS Optimized", [ "JS_OPT" ]); addCategory("JS Ignition", [ "JS_IGNITION", "BC" ]);
addCategory("JS Turboprop", [ "JS_TURBOPROP" ]); addCategory("JS Sparkplug", [ "JS_SPARKPLUG" ]);
addCategory("JS Baseline", [ "JS_BASELINE" ]); addCategory("JS Maglev", [ "JS_MAGLEV" ]);
addCategory("JS Unoptimized", [ "JS_UNOPT", "BC" ]); addCategory("JS Turbofan", [ "JS_TURBOFAN" ]);
addCategory("IC", [ "IC" ]); addCategory("IC", [ "IC" ]);
addCategory("RegExp", [ "REGEXP" ]); addCategory("RegExp", [ "REGEXP" ]);
addCategory("Other generated", [ "STUB", "BUILTIN" ]); addCategory("Other generated", [ "STUB", "BUILTIN" ]);

View File

@ -212,29 +212,30 @@ let main = {
const CATEGORY_COLOR = "#f5f5f5"; const CATEGORY_COLOR = "#f5f5f5";
const bucketDescriptors = const bucketDescriptors =
[{ [
kinds: ["JS_OPT"],
color: "#64dd17",
backgroundColor: "#80e27e",
text: "JS Optimized"
},
{ {
kinds: ["JS_TURBOPROP"], kinds: ["JS_IGNITION", "BC"],
color: "#693eb8",
backgroundColor: "#a6c452",
text: "JS Turboprop"
},
{
kinds: ["JS_BASELINE"],
color: "#b3005b",
backgroundColor: "#ff9e80",
text: "JS Baseline"
},
{
kinds: ["JS_UNOPT", "BC"],
color: "#dd2c00", color: "#dd2c00",
backgroundColor: "#ff9e80", backgroundColor: "#ff9e80",
text: "JS Unoptimized" text: "JS Ignition"
},
{
kinds: ["JS_SPARKPLUG"],
color: "#b3005b",
backgroundColor: "#ff9e80",
text: "JS Sparkplug"
},
{
kinds: ["JS_MAGLEV"],
color: "#693eb8",
backgroundColor: "#d80093",
text: "JS Maglev"
},
{
kinds: ["JS_TURBOFAN"],
color: "#64dd17",
backgroundColor: "#80e27e",
text: "JS Turbofan"
}, },
{ {
kinds: ["IC"], kinds: ["IC"],
@ -348,14 +349,16 @@ function codeTypeToText(type) {
return "Builtin"; return "Builtin";
case "REGEXP": case "REGEXP":
return "RegExp"; return "RegExp";
case "JS_OPT": case "JS_IGNITION":
return "JS opt"; return "JS Ignition";
case "JS_SPARKPLUG":
return "JS Sparkplug";
case "JS_TURBOPROP": case "JS_TURBOPROP":
return "JS Turboprop"; return "JS Turboprop";
case "JS_BASELINE": case "JS_MAGLEV":
return "JS Baseline"; return "JS Maglev";
case "JS_UNOPT": case "JS_TURBOFAN":
return "JS unopt"; return "JS Turbofan";
} }
console.error("Unknown type: " + type); console.error("Unknown type: " + type);
} }