Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(624)

Unified Diff: tools/tickprocessor.js

Issue 11359048: Extend tick-processor utility to generate an execution timeline based on the reported VM states Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/tools/tickprocessor-test.separate-ic ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor.js
===================================================================
--- tools/tickprocessor.js (revision 12764)
+++ tools/tickprocessor.js (working copy)
@@ -185,6 +185,7 @@
'begin-code-region': null,
'end-code-region': null });
+ this.timeline_ = "";
this.cppEntriesProvider_ = cppEntriesProvider;
this.callGraphSize_ = callGraphSize;
this.ignoreUnknown_ = ignoreUnknown;
@@ -347,6 +348,16 @@
return this.stateFilter_ == null || this.stateFilter_ == vmState;
};
+TickProcessor.prototype.recordTickTimeline = function(vmState) {
+ if (vmState == TickProcessor.VmStates.JS) this.timeline_ += "J";
+ else if (vmState == TickProcessor.VmStates.GC) this.timeline_ += "G";
+ else if (vmState == TickProcessor.VmStates.COMPILER) this.timeline_ += "C";
+ else if (vmState == TickProcessor.VmStates.PARALLEL_COMPILER_PROLOGUE) this.timeline_ += "|";
+ else if (vmState == TickProcessor.VmStates.OTHER) this.timeline_ += "O";
+ else if (vmState == TickProcessor.VmStates.EXTERNAL) this.timeline_ += ".";
+ else this.timeline_ += "U";
+}
+
TickProcessor.prototype.processTick = function(pc,
sp,
is_external_callback,
@@ -354,6 +365,7 @@
vmState,
stack) {
this.ticks_.total++;
+ this.recordTickTimeline(vmState);
if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
if (!this.includeTick(vmState)) {
this.ticks_.excluded++;
@@ -465,6 +477,14 @@
return rec2.totalTime - rec1.totalTime ||
(rec2.internalFuncName < rec1.internalFuncName ? -1 : 1); });
this.printHeavyProfile(heavyView.head.children);
+
+ print('Visual Execution Timeline: ');
+ var sliceLength = 80;
+ var sliceStart = 0;
+ while (sliceStart < this.timeline_.length) {
+ print(this.timeline_.slice(sliceStart, sliceStart + sliceLength));
+ sliceStart += sliceLength;
+ }
};
« no previous file with comments | « test/mjsunit/tools/tickprocessor-test.separate-ic ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698