Commit 0ce8f19b authored by cbruni's avatar cbruni Committed by Commit bot

[tools] Improve matching Group-Compile in RuntimeCallStats

Drive-by-fix: support directly loading the results.json from chromeperf.

BUG=chromium:672024
NO_TRY=true

Review-Url: https://codereview.chromium.org/2555693007
Cr-Commit-Position: refs/heads/master@{#41586}
parent c522c6ba
...@@ -1103,7 +1103,23 @@ code is governed by a BSD-style license that can be found in the LICENSE file. ...@@ -1103,7 +1103,23 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return result; return result;
} }
function fixSinglePageJSON(json) {
// Try to detect the single-version case, where we're missing the toplevel
// version object. The incoming JSON is of the form:
// {"Page 1": [... data points ... ], "Page 2": [...], ...}
// Instead of the default multi-page JSON:
// {"Version 1": { "Page 1": ..., ...}, "Version 2": {...}, ...}
// In this case insert a single "Default" version as top-level entry.
var firstProperty = (object) => {
for (var key in object) return key;
};
var maybePage = json[firstProperty(json)];
if (!Array.isArray(maybePage)) return json;
return {"Default": json}
}
function handleLoadJSON(json) { function handleLoadJSON(json) {
json = fixSinglePageJSON(json);
var state = getStateFromParams(); var state = getStateFromParams();
pages = new Pages(); pages = new Pages();
versions = Versions.fromJSON(json); versions = Versions.fromJSON(json);
...@@ -1632,10 +1648,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file. ...@@ -1632,10 +1648,11 @@ code is governed by a BSD-style license that can be found in the LICENSE file.
return group; return group;
} }
Group.add('total', new Group('Total', /.*Total.*/, '#BBB')); Group.add('total', new Group('Total', /.*Total.*/, '#BBB'));
Group.add('ic', new Group('IC', /.*IC.*/, "#3366CC")); Group.add('ic', new Group('IC', /.*IC_.*/, "#3366CC"));
Group.add('optimize', new Group('Optimize', Group.add('optimize', new Group('Optimize',
/StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*/, "#DC3912")); /StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*/, "#DC3912"));
Group.add('compile', new Group('Compile', /.*Compile.*/, "#FFAA00")); Group.add('compile', new Group('Compile',
/(^Compile.*)|(.*_Compile.*)/, "#FFAA00"));
Group.add('parse-background', Group.add('parse-background',
new Group('Parse-Background', /.*ParseBackground.*/, "#af744d")); new Group('Parse-Background', /.*ParseBackground.*/, "#af744d"));
Group.add('parse', new Group('Parse', /.*Parse.*/, "#FF6600")); Group.add('parse', new Group('Parse', /.*Parse.*/, "#FF6600"));
......
...@@ -343,10 +343,10 @@ def read_stats(path, domain, args): ...@@ -343,10 +343,10 @@ def read_stats(path, domain, args):
groups = []; groups = [];
if args.aggregate: if args.aggregate:
groups = [ groups = [
('Group-IC', re.compile(".*IC.*")), ('Group-IC', re.compile(".*IC_.*")),
('Group-Optimize', ('Group-Optimize',
re.compile("StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*")), re.compile("StackGuard|.*Optimize.*|.*Deoptimize.*|Recompile.*")),
('Group-Compile', re.compile(".*Compile.*")), ('Group-Compile', re.compile("(^Compile.*)|(.*_Compile.*)")),
('Group-ParseBackground', re.compile(".*ParseBackground.*")), ('Group-ParseBackground', re.compile(".*ParseBackground.*")),
('Group-Parse', re.compile(".*Parse.*")), ('Group-Parse', re.compile(".*Parse.*")),
('Group-Callback', re.compile(".*Callback.*")), ('Group-Callback', re.compile(".*Callback.*")),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment