* @param {Array.<Object>} dispatchTable A table used for parsing and processing
* log records.
* @param {boolean} timedRange Ignore ticks outside timed range.
+ * @param {boolean} pairwiseTimedRange Ignore ticks outside pairs of timer
+ * markers.
* @constructor
*/
-function LogReader(dispatchTable, timedRange) {
+function LogReader(dispatchTable, timedRange, pairwiseTimedRange) {
/**
* @type {Array.<Object>}
*/
this.timedRange_ = timedRange;
/**
+ * @type {boolean}
+ */
+ this.pairwiseTimedRange_ = pairwiseTimedRange;
+ if (pairwiseTimedRange) {
+ this.timedRange_ = true;
+ }
+
+ /**
* Current line.
* @type {number}
*/
if (this.hasSeenTimerMarker_) {
this.processLog_(this.logLinesSinceLastTimerMarker_);
this.logLinesSinceLastTimerMarker_ = [];
+ // In pairwise mode, a "current-time" line ends the timed range.
+ if (this.pairwiseTimedRange_) {
+ this.hasSeenTimerMarker_ = false;
+ }
} else {
this.hasSeenTimerMarker_ = true;
}
distortion,
range,
sourceMap,
- timedRange) {
+ timedRange,
+ pairwiseTimedRange) {
LogReader.call(this, {
'shared-library': { parsers: [null, parseInt, parseInt],
processor: this.processSharedLibrary },
'code-allocate': null,
'begin-code-region': null,
'end-code-region': null },
- timedRange);
+ timedRange,
+ pairwiseTimedRange);
this.cppEntriesProvider_ = cppEntriesProvider;
this.callGraphSize_ = callGraphSize;
'--source-map': ['sourceMap', null,
'Specify the source map that should be used for output'],
'--timed-range': ['timedRange', true,
- 'Ignore ticks before first and after last Date.now() call']
+ 'Ignore ticks before first and after last Date.now() call'],
+ '--pairwise-timed-range': ['pairwiseTimedRange', true,
+ 'Ignore ticks outside pairs of Date.now() calls']
};
this.argsDispatch_['--js'] = this.argsDispatch_['-j'];
this.argsDispatch_['--gc'] = this.argsDispatch_['-g'];
this.argsDispatch_['--compiler'] = this.argsDispatch_['-c'];
this.argsDispatch_['--other'] = this.argsDispatch_['-o'];
this.argsDispatch_['--external'] = this.argsDispatch_['-e'];
+ this.argsDispatch_['--ptr'] = this.argsDispatch_['--pairwise-timed-range'];
};
nm: 'nm',
range: 'auto,auto',
distortion: 0,
- timedRange: false
+ timedRange: false,
+ pairwiseTimedRange: false
};
ArgumentsProcessor.prototype.parse = function() {
while (this.args_.length) {
- var arg = this.args_[0];
+ var arg = this.args_.shift();
if (arg.charAt(0) != '-') {
- break;
+ this.result_.logFileName = arg;
+ continue;
}
- this.args_.shift();
var userValue = null;
var eqPos = arg.indexOf('=');
if (eqPos != -1) {
return false;
}
}
-
- if (this.args_.length >= 1) {
- this.result_.logFileName = this.args_.shift();
- }
return true;
};
ArgumentsProcessor.DEFAULTS.logFileName + '".\n');
print('Options:');
for (var arg in this.argsDispatch_) {
- var synonims = [arg];
+ var synonyms = [arg];
var dispatch = this.argsDispatch_[arg];
for (var synArg in this.argsDispatch_) {
if (arg !== synArg && dispatch === this.argsDispatch_[synArg]) {
- synonims.push(synArg);
+ synonyms.push(synArg);
delete this.argsDispatch_[synArg];
}
}
- print(' ' + padRight(synonims.join(', '), 20) + dispatch[2]);
+ print(' ' + padRight(synonyms.join(', '), 20) + " " + dispatch[2]);
}
quit(2);
};