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

Unified Diff: tools/tickprocessor.js

Issue 12077043: Add option to limit tick processor to a time range. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: git cl dcommit Created 7 years, 11 months 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 | « tools/plot-timer-events.js ('k') | tools/tickprocessor-driver.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/tickprocessor.js
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
index 7530c6b37dd8ae5c25b351fa6de742a63f5c5c2d..c9ee1011f066abfc1aae9353ac589e65cce03fcd 100644
--- a/tools/tickprocessor.js
+++ b/tools/tickprocessor.js
@@ -151,7 +151,9 @@ function TickProcessor(
callGraphSize,
ignoreUnknown,
stateFilter,
- snapshotLogProcessor) {
+ snapshotLogProcessor,
+ distortion,
+ range) {
LogReader.call(this, {
'shared-library': { parsers: [null, parseInt, parseInt],
processor: this.processSharedLibrary },
@@ -174,6 +176,10 @@ function TickProcessor(
processor: this.processHeapSampleBegin },
'heap-sample-end': { parsers: [null, null],
processor: this.processHeapSampleEnd },
+ 'timer-event-start' : { parsers: [null, null, null],
+ processor: this.advanceDistortion },
+ 'timer-event-end' : { parsers: [null, null, null],
+ processor: this.advanceDistortion },
// Ignored events.
'profiler': null,
'function-creation': null,
@@ -194,6 +200,17 @@ function TickProcessor(
var ticks = this.ticks_ =
{ total: 0, unaccounted: 0, excluded: 0, gc: 0 };
+ distortion = parseInt(distortion);
+ // Convert picoseconds to nanoseconds.
+ this.distortion_per_entry = isNaN(distortion) ? 0 : (distortion / 1000);
+ this.distortion = 0;
+ var rangelimits = range.split(",");
+ var range_start = parseInt(rangelimits[0]);
+ var range_end = parseInt(rangelimits[1]);
+ // Convert milliseconds to nanoseconds.
+ this.range_start = isNaN(range_start) ? -Infinity : (range_start * 1000);
+ this.range_end = isNaN(range_end) ? Infinity : (range_end * 1000)
+
V8Profile.prototype.handleUnknownCode = function(
operation, addr, opt_stackPos) {
var op = Profile.Operation;
@@ -355,6 +372,11 @@ TickProcessor.prototype.processTick = function(pc,
tos_or_external_callback,
vmState,
stack) {
+ this.distortion += this.distortion_per_entry;
+ ns_since_start -= this.distortion;
+ if (ns_since_start < this.range_start || ns_since_start > this.range_end) {
+ return;
+ }
this.ticks_.total++;
if (vmState == TickProcessor.VmStates.GC) this.ticks_.gc++;
if (!this.includeTick(vmState)) {
@@ -381,6 +403,11 @@ TickProcessor.prototype.processTick = function(pc,
};
+TickProcessor.prototype.advanceDistortion = function() {
+ this.distortion += this.distortion_per_entry;
+}
+
+
TickProcessor.prototype.processHeapSampleBegin = function(space, state, ticks) {
if (space != 'Heap') return;
this.currentProducerProfile_ = new CallTree();
@@ -795,7 +822,11 @@ function ArgumentsProcessor(args) {
'--target': ['targetRootFS', '',
'Specify the target root directory for cross environment'],
'--snapshot-log': ['snapshotLogFileName', 'snapshot.log',
- 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)']
+ 'Specify snapshot log file to use (e.g. --snapshot-log=snapshot.log)'],
+ '--range': ['range', 'auto,auto',
+ 'Specify the range limit as [start],[end]'],
+ '--distortion': ['distortion', 0,
+ 'Specify the logging overhead in picoseconds']
};
this.argsDispatch_['--js'] = this.argsDispatch_['-j'];
this.argsDispatch_['--gc'] = this.argsDispatch_['-g'];
@@ -814,7 +845,9 @@ ArgumentsProcessor.DEFAULTS = {
ignoreUnknown: false,
separateIc: false,
targetRootFS: '',
- nm: 'nm'
+ nm: 'nm',
+ range: 'auto,auto',
+ distortion: 0
};
« no previous file with comments | « tools/plot-timer-events.js ('k') | tools/tickprocessor-driver.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698