Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/tools/tickprocessor.js b/tools/tickprocessor.js
index 5534355..ec56d49 100644
--- a/tools/tickprocessor.js
+++ b/tools/tickprocessor.js
@@ -81,7 +81,8 @@
sourceMap,
timedRange,
pairwiseTimedRange,
- onlySummary) {
+ onlySummary,
+ runtimeTimerFilter) {
LogReader.call(this, {
'shared-library': { parsers: [null, parseInt, parseInt, parseInt],
processor: this.processSharedLibrary },
@@ -94,6 +95,9 @@
processor: this.processCodeDelete },
'sfi-move': { parsers: [parseInt, parseInt],
processor: this.processFunctionMove },
+ 'active-runtime-timer': {
+ parsers: [null],
+ processor: this.processRuntimeTimerEvent },
'tick': {
parsers: [parseInt, parseInt, parseInt,
parseInt, parseInt, 'var-args'],
@@ -124,6 +128,7 @@
this.callGraphSize_ = callGraphSize;
this.ignoreUnknown_ = ignoreUnknown;
this.stateFilter_ = stateFilter;
+ this.runtimeTimerFilter_ = runtimeTimerFilter;
this.sourceMap = sourceMap;
this.deserializedEntriesNames_ = [];
var ticks = this.ticks_ =
@@ -284,9 +289,18 @@
TickProcessor.prototype.includeTick = function(vmState) {
- return this.stateFilter_ == null || this.stateFilter_ == vmState;
+ if (this.stateFilter_ !== null) {
+ return this.stateFilter_ == vmState;
+ } else if (this.runtimeTimerFilter_ !== null) {
+ return this.currentRuntimeTimer == this.runtimeTimerFilter_;
+ }
+ return true;
};
+TickProcessor.prototype.processRuntimeTimerEvent = function(name) {
+ this.currentRuntimeTimer = name;
+}
+
TickProcessor.prototype.processTick = function(pc,
ns_since_start,
is_external_callback,
@@ -781,6 +795,8 @@
'Show only ticks from OTHER VM state'],
'-e': ['stateFilter', TickProcessor.VmStates.EXTERNAL,
'Show only ticks from EXTERNAL VM state'],
+ '--filter-runtime-timer': ['runtimeTimerFilter', null,
+ 'Show only ticks matching the given runtime timer scope'],
'--call-graph-size': ['callGraphSize', TickProcessor.CALL_GRAPH_SIZE,
'Set the call graph size'],
'--ignore-unknown': ['ignoreUnknown', true,
@@ -832,7 +848,8 @@
distortion: 0,
timedRange: false,
pairwiseTimedRange: false,
- onlySummary: false
+ onlySummary: false,
+ runtimeTimerFilter: null,
};