aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-04-01 16:56:16 -0700
committerJeff Brown <jeffbrown@google.com>2013-04-01 16:56:16 -0700
commit4849cead45edf85cf2a61526c0b716eb637f74ba (patch)
tree2479438d2b33e77181f6d7e362f9ba18b3039025
parentb9a5fc88b96d2cd8f6b08c72cc35917e42367969 (diff)
downloadchromium-trace-4849cead45edf85cf2a61526c0b716eb637f74ba.tar.gz
systrace: update to trace-viewer rev 243
Change-Id: I1ef3bcc7228d2f681ea3b08e9bd7af6175865dd5
-rw-r--r--UPSTREAM_REVISION2
-rw-r--r--script.js107
-rw-r--r--style.css2
-rwxr-xr-xtrace-viewer/run_dev_server.py17
-rw-r--r--trace-viewer/src/about_tracing.html2
-rw-r--r--trace-viewer/src/about_tracing.js6
-rw-r--r--trace-viewer/src/deps.js18
-rw-r--r--trace-viewer/src/focus_outline_manager.js84
-rw-r--r--trace-viewer/src/importer/linux_perf/disk_parser.js177
-rw-r--r--trace-viewer/src/importer/linux_perf/disk_parser_test.html86
-rw-r--r--trace-viewer/src/importer/linux_perf_importer.js1
-rw-r--r--trace-viewer/src/importer/trace_event_importer.js2
-rw-r--r--trace-viewer/src/importer/trace_event_importer_test.html16
-rw-r--r--trace-viewer/src/profiling_view.js2
-rw-r--r--trace-viewer/src/settings.js5
-rw-r--r--trace-viewer/src/settings_test.html2
-rw-r--r--trace-viewer/src/tests.html3
-rw-r--r--trace-viewer/src/timeline.js16
-rw-r--r--trace-viewer/src/tracks/canvas_based_track.js6
-rw-r--r--trace-viewer/src/tracks/ruler_track.css (renamed from trace-viewer/src/tracks/viewport_track.css)6
-rw-r--r--trace-viewer/src/tracks/ruler_track.js (renamed from trace-viewer/src/tracks/viewport_track.js)20
-rw-r--r--trace-viewer/src/tracks/ruler_track_test.html (renamed from trace-viewer/src/tracks/viewport_track_test.html)6
22 files changed, 397 insertions, 189 deletions
diff --git a/UPSTREAM_REVISION b/UPSTREAM_REVISION
index 997def45..2c2b1af8 100644
--- a/UPSTREAM_REVISION
+++ b/UPSTREAM_REVISION
@@ -1 +1 @@
-237
+245
diff --git a/script.js b/script.js
index 559f1ddb..4dee3b62 100644
--- a/script.js
+++ b/script.js
@@ -1,17 +1,17 @@
window.FLATTENED={};window.FLATTENED.base=!0;window.FLATTENED.event_target=!0;window.FLATTENED.measuring_stick=!0;window.FLATTENED.filter=!0;window.FLATTENED.range=!0;window.FLATTENED.selection=!0;window.FLATTENED.timeline_viewport=!0;window.FLATTENED.ui=!0;window.FLATTENED["tracks.track"]=!0;window.FLATTENED["tracks.container_track"]=!0;window.FLATTENED.fast_rect_renderer=!0;window.FLATTENED.color_scheme=!0;window.FLATTENED["tracks.canvas_based_track"]=!0;window.FLATTENED.sorted_array_utils=!0;
window.FLATTENED["tracks.slice_track"]=!0;window.FLATTENED.guid=!0;window.FLATTENED.slice=!0;window.FLATTENED.slice_group=!0;window.FLATTENED.async_slice_group=!0;window.FLATTENED.sample=!0;window.FLATTENED.thread=!0;window.FLATTENED.counter=!0;window.FLATTENED.process_base=!0;window.FLATTENED.process=!0;window.FLATTENED.kernel=!0;window.FLATTENED.cpu=!0;window.FLATTENED.model=!0;window.FLATTENED["tracks.cpu_track"]=!0;window.FLATTENED["tracks.counter_track"]=!0;
-window.FLATTENED["tracks.slice_group_track"]=!0;window.FLATTENED["tracks.async_slice_group_track"]=!0;window.FLATTENED["tracks.thread_track"]=!0;window.FLATTENED["tracks.process_track"]=!0;window.FLATTENED["tracks.model_track"]=!0;window.FLATTENED["tracks.viewport_track"]=!0;window.FLATTENED.timeline=!0;window.FLATTENED["analysis.util"]=!0;window.FLATTENED.timeline_analysis_view=!0;window.FLATTENED.overlay=!0;window.FLATTENED.category_filter_dialog=!0;window.FLATTENED.find_control=!0;
-window.FLATTENED["importer.trace_event_importer"]=!0;window.FLATTENED["importer.linux_perf.parser"]=!0;window.FLATTENED["importer.linux_perf.bus_parser"]=!0;window.FLATTENED["importer.linux_perf.clock_parser"]=!0;window.FLATTENED["importer.linux_perf.cpufreq_parser"]=!0;window.FLATTENED["importer.linux_perf.drm_parser"]=!0;window.FLATTENED["importer.linux_perf.exynos_parser"]=!0;window.FLATTENED["importer.linux_perf.gesture_parser"]=!0;window.FLATTENED["importer.linux_perf.i915_parser"]=!0;
-window.FLATTENED["importer.linux_perf.mali_parser"]=!0;window.FLATTENED["importer.linux_perf.power_parser"]=!0;window.FLATTENED["importer.linux_perf.sched_parser"]=!0;window.FLATTENED["importer.linux_perf.workqueue_parser"]=!0;window.FLATTENED["importer.linux_perf.android_parser"]=!0;window.FLATTENED["importer.linux_perf_importer"]=!0;window.FLATTENED["importer.v8.log_reader"]=!0;window.FLATTENED["importer.v8.splaytree"]=!0;window.FLATTENED["importer.v8.codemap"]=!0;
-window.FLATTENED["importer.v8_log_importer"]=!0;window.FLATTENED.settings=!0;window.FLATTENED.timeline_view=!0;"use strict";var global=this;
+window.FLATTENED["tracks.slice_group_track"]=!0;window.FLATTENED["tracks.async_slice_group_track"]=!0;window.FLATTENED["tracks.thread_track"]=!0;window.FLATTENED["tracks.process_track"]=!0;window.FLATTENED["tracks.model_track"]=!0;window.FLATTENED["tracks.ruler_track"]=!0;window.FLATTENED.timeline=!0;window.FLATTENED["analysis.util"]=!0;window.FLATTENED.timeline_analysis_view=!0;window.FLATTENED.overlay=!0;window.FLATTENED.category_filter_dialog=!0;window.FLATTENED.find_control=!0;
+window.FLATTENED["importer.trace_event_importer"]=!0;window.FLATTENED["importer.linux_perf.parser"]=!0;window.FLATTENED["importer.linux_perf.bus_parser"]=!0;window.FLATTENED["importer.linux_perf.clock_parser"]=!0;window.FLATTENED["importer.linux_perf.cpufreq_parser"]=!0;window.FLATTENED["importer.linux_perf.disk_parser"]=!0;window.FLATTENED["importer.linux_perf.drm_parser"]=!0;window.FLATTENED["importer.linux_perf.exynos_parser"]=!0;window.FLATTENED["importer.linux_perf.gesture_parser"]=!0;
+window.FLATTENED["importer.linux_perf.i915_parser"]=!0;window.FLATTENED["importer.linux_perf.mali_parser"]=!0;window.FLATTENED["importer.linux_perf.power_parser"]=!0;window.FLATTENED["importer.linux_perf.sched_parser"]=!0;window.FLATTENED["importer.linux_perf.workqueue_parser"]=!0;window.FLATTENED["importer.linux_perf.android_parser"]=!0;window.FLATTENED["importer.linux_perf_importer"]=!0;window.FLATTENED["importer.v8.log_reader"]=!0;window.FLATTENED["importer.v8.splaytree"]=!0;
+window.FLATTENED["importer.v8.codemap"]=!0;window.FLATTENED["importer.v8_log_importer"]=!0;window.FLATTENED.settings=!0;window.FLATTENED.timeline_view=!0;"use strict";var global=this;
this.base=function(){function d(b){"/"==b[b.length-1]&&(b=b.substring(0,b.length-1));q=b}function c(b,a){r[b]||(r[b]=[]);for(var f=r[b],e=!1,g=0;g<f.length;g++)f[g]==a&&(e=!0);e||f.push(a)}function a(b,a){s[b]||(s[b]=[]);for(var f=s[b],e=!1,g=0;g<s.length;g++)f[g]==a&&(e=!0);e||f.push(a)}function b(b,a){t[b]||(t[b]=[]);for(var f=t[b],e=!1,g=0;g<f.length;g++)f[g]==a&&(e=!0);e||f.push(a)}function f(){if(!p){p=!0;var f=new XMLHttpRequest,e=q+"/deps.js";f.open("GET",e,!1);f.send(null);if(200!=f.status)throw Error("Could not find "+
e+". Run calcdeps.py and try again.");base.addModuleDependency=c;base.addModuleRawScriptDependency=a;base.addModuleStylesheet=b;try{eval(f.responseText)}catch(g){throw Error("When loading deps, got "+g.stack?g.stack:g);}delete base.addModuleStylesheet;delete base.addModuleRawScriptDependency;delete base.addModuleDependency}}function e(b,a){var c=a||0;if(window.FLATTENED){if(!window.FLATTENED[b])throw Error("Somehow, module "+b+" didn't get stored in the flattened js file! You may need to rerun build/calcdeps.py");
-}else if(f(),"APPENDED"!=u[b]){if("RESOLVING"==u[b])throw Error("Circular dependency betwen modules. Cannot continue!");u[b]="RESOLVING";for(var j=t[b]||[],k=0;k<j.length;k++)g(j[k]);j=s[b]||[];for(k=0;k<j.length;k++){var d=j[k];if(!v[d]){var h=q+"/"+d,h='<script type="text/javascript" src="'+h+'">\x3c/script>';base.doc.write(h);v[d]="APPENDED"}}j=r[b]||[];for(k=0;k<j.length;k++)e(j[k],c+1);c=b.replace(/\./g,"/")+".js";h=q+"/"+c;base.doc.write('<script type="text/javascript" src="'+h+'">\x3c/script>');
+}else if(f(),"APPENDED"!=u[b]){if("RESOLVING"==u[b])throw Error("Circular dependency betwen modules. Cannot continue!");u[b]="RESOLVING";for(var j=t[b]||[],d=0;d<j.length;d++)g(j[d]);j=s[b]||[];for(d=0;d<j.length;d++){var k=j[d];if(!v[k]){var h=q+"/"+k,h='<script type="text/javascript" src="'+h+'">\x3c/script>';base.doc.write(h);v[k]="APPENDED"}}j=r[b]||[];for(d=0;d<j.length;d++)e(j[d],c+1);c=b.replace(/\./g,"/")+".js";h=q+"/"+c;base.doc.write('<script type="text/javascript" src="'+h+'">\x3c/script>');
u[b]="APPENDED"}}function g(b){if(!window.FLATTENED&&!x[b]){x[b]=!0;b=b.replace(/\./g,"/")+".css";b=q+"/"+b;var a=document.createElement("link");a.setAttribute("rel","stylesheet");a.setAttribute("href",b);base.doc.head.appendChild(a)}}function j(b,a,f,e){var g=new base.Event(a+"Change");g.propertyName=a;g.newValue=f;g.oldValue=e;b.dispatchEvent(g)}function h(b){return b.replace(/([A-Z])/g,"-$1").toLowerCase()}function k(b,a){switch(a){case y.JS:var f=b+"_";return function(){return this[f]};case y.ATTR:var e=
h(b);return function(){return this.getAttribute(e)};case y.BOOL_ATTR:return e=h(b),function(){return this.hasAttribute(e)}}}function l(b,a,f){switch(a){case y.JS:var e=b+"_";return function(a){var g=this[e];a!==g&&(this[e]=a,f&&f.call(this,a,g),j(this,b,a,g))};case y.ATTR:var g=h(b);return function(a){var e=this[g];a!==e&&(void 0==a?this.removeAttribute(g):this.setAttribute(g,a),f&&f.call(this,a,e),j(this,b,a,e))};case y.BOOL_ATTR:return g=h(b),function(a){var e=this[g];a!==e&&(a?this.setAttribute(g,
b):this.removeAttribute(g),f&&f.call(this,a,e),j(this,b,a,e))}}}function w(b,a,f){var e=base.doc.createEvent("Event");e.initEvent(b,!!a,!!f);e.__proto__=global.Event.prototype;return e}function m(){this.types=[];this.values=[]}var q=".",p=!1,r={},t={},s={},u={},v={},x={},y={JS:"js",ATTR:"attr",BOOL_ATTR:"boolAttr"},z=1;m.prototype={__proto__:Object.prototype,add:function(b,a){this.types.push(b);this.values.push(a)},get:function(b){for(var a=0;a<this.types.length;a++)if(b instanceof this.types[a])return this.values[a]}};
return{set moduleBasePath(b){d(b)},get moduleBasePath(){return q},require:e,requireStylesheet:g,requireRawScript:function(b){if(window.FLATTENED_RAW_SCRIPTS){if(!window.FLATTENED_RAW_SCRIPTS[b])throw Error("Somehow, "+b+" didn't get stored in the flattened js file! You may need to rerun build/calcdeps.py");}else if(!v[b])throw Error(b+" should already have been loaded. Did you forget to run calcdeps.py?");},exportTo:function(b,a){var f;f=b.split(".");for(var e=global,g;f.length&&(g=f.shift());)e=
-g in e?e[g]:e[g]={};f=e;try{var c=a()}catch(j){console.log("While running exports for ",name,":");console.log(j.stack||j);return}for(var k in c)(e=Object.getOwnPropertyDescriptor(c,k))&&Object.defineProperty(f,k,e)},addSingletonGetter:function(b){b.getInstance=function(){return b.instance_||(b.instance_=new b)}},createUid:function(){return z++},defineProperty:function(b,a,f,e){"function"==typeof b&&(b=b.prototype);f=f||y.JS;b.__lookupGetter__(a)||b.__defineGetter__(a,k(a,f));b.__lookupSetter__(a)||
+g in e?e[g]:e[g]={};f=e;try{var c=a()}catch(j){console.log("While running exports for ",name,":");console.log(j.stack||j);return}for(var d in c)(e=Object.getOwnPropertyDescriptor(c,d))&&Object.defineProperty(f,d,e)},addSingletonGetter:function(b){b.getInstance=function(){return b.instance_||(b.instance_=new b)}},createUid:function(){return z++},defineProperty:function(b,a,f,e){"function"==typeof b&&(b=b.prototype);f=f||y.JS;b.__lookupGetter__(a)||b.__defineGetter__(a,k(a,f));b.__lookupSetter__(a)||
b.__defineSetter__(a,l(a,f,e))},dispatchPropertyChange:j,dispatchSimpleEvent:function(b,a,f,e){a=new base.Event(a,f,e);return b.dispatchEvent(a)},Event:w,getUid:function(b){return b.hasOwnProperty("uid")?b.uid:b.uid=z++},initialize:function(){if(global.document)w.prototype={__proto__:global.Event.prototype},base.doc=document,base.isMac=/Mac/.test(navigator.platform),base.isWindows=/Win/.test(navigator.platform),base.isChromeOS=/CrOS/.test(navigator.userAgent),base.isLinux=/Linux/.test(navigator.userAgent),
base.isGTK=/GTK/.test(chrome.toolkit),base.isViews=/views/.test(chrome.toolkit),d("/src");else{var b=cr;Object.defineProperty(global,"cr",{get:function(){Object.defineProperty(global,"cr",{value:b});originalBase.initialize();return b},configurable:!0})}},PropertyKind:y,asArray:function(b){for(var a=[],f=0;f<b.length;f++)a.push(b[f]);return a},concatenateArrays:function(){for(var b=[],a=0;a<arguments.length;a++){if(!(arguments[a]instanceof Array))throw Error("Arguments "+a+"is not an array");b.push.apply(b,
arguments[a])}return b},dictionaryKeys:function(b){var a=[],f;for(f in b)a.push(f);return a},dictionaryValues:function(b){var a=[],f;for(f in b)a.push(b[f]);return a},TypeMap:m}}();base.initialize();
@@ -58,7 +58,7 @@ base.require("tracks.track");base.require("fast_rect_renderer");base.require("co
base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks.Track);d.prototype={__proto__:tracing.tracks.Track.prototype,decorate:function(){this.className="canvas-based-track";this.slices_=null;this.headingDiv_=document.createElement("div");this.headingDiv_.className="canvas-based-track-title";this.appendChild(this.headingDiv_);this.canvasContainer_=document.createElement("div");this.canvasContainer_.className="canvas-based-track-canvas-container";this.appendChild(this.canvasContainer_);
this.canvas_=document.createElement("canvas");this.canvas_.className="canvas-based-track-canvas";this.canvasContainer_.appendChild(this.canvas_);this.ctx_=this.canvas_.getContext("2d")},detach:function(){this.viewport_&&(this.viewport_.removeEventListener("change",this.viewportChangeBoundToThis_),this.viewport_.removeEventListener("markersChange",this.viewportMarkersChangeBoundToThis_))},set headingWidth(c){this.headingDiv_.style.width=c},get heading(){return this.headingDiv_.textContent},set heading(c){this.headingDiv_.textContent=
c},set tooltip(c){this.headingDiv_.title=c},get viewport(){return this.viewport_},set viewport(c){if(this.viewport_=c)this.viewport_.removeEventListener("change",this.viewportChangeBoundToThis_),this.viewport_.removeEventListener("markersChange",this.viewportMarkersChangeBoundToThis_);if(this.viewport_=c)this.viewportChangeBoundToThis_=this.viewportChange_.bind(this),this.viewport_.addEventListener("change",this.viewportChangeBoundToThis_),this.viewportMarkersChangeBoundToThis_=this.viewportMarkersChange_.bind(this),
-this.viewport_.addEventListener("markersChange",this.viewportMarkersChangeBoundToThis_),this.isAttachedToDocument_&&this.updateCanvasSizeIfNeeded_();this.invalidate()},viewportChange_:function(){this.invalidate()},viewportMarkersChange_:function(){2>this.viewport_.markers.length?this.classList.remove("viewport-track-with-distance-measurements"):this.classList.add("viewport-track-with-distance-measurements")},invalidate:function(){this.rafPending_||(webkitRequestAnimationFrame(function(){this.rafPending_=
+this.viewport_.addEventListener("markersChange",this.viewportMarkersChangeBoundToThis_),this.isAttachedToDocument_&&this.updateCanvasSizeIfNeeded_();this.invalidate()},viewportChange_:function(){this.invalidate()},viewportMarkersChange_:function(){2>this.viewport_.markers.length?this.classList.remove("ruler-track-with-distance-measurements"):this.classList.add("ruler-track-with-distance-measurements")},invalidate:function(){this.rafPending_||(webkitRequestAnimationFrame(function(){this.rafPending_=
!1;this.viewport_&&(this.updateCanvasSizeIfNeeded_(),this.redraw())}.bind(this),this),this.rafPending_=!0)},get isAttachedToDocument_(){var c=this.parentNode;if(c){for(;c.parentNode;)c=c.parentNode;return c==this.ownerDocument}},updateCanvasSizeIfNeeded_:function(){var c=window.getComputedStyle(this.canvasContainer_),a=parseInt(c.width)-parseInt(c.paddingLeft)-parseInt(c.paddingRight)-parseInt(c.borderLeftWidth)-parseInt(c.borderRightWidth),c=parseInt(c.height)-parseInt(c.paddingTop)-parseInt(c.paddingBottom)-
parseInt(c.borderTopWidth)-parseInt(c.borderBottomWidth),b=window.devicePixelRatio||1;this.canvas_.width!=a&&(this.canvas_.width=a*b,this.canvas_.style.width=a+"px");this.canvas_.height!=c&&(this.canvas_.height=c*b,this.canvas_.style.height=c+"px")},get firstCanvas(){return this.canvas_}};return{CanvasBasedTrack:d}});
base.exportTo("tracing",function(){function d(a,b,f){if(0==a.length)return 1;for(var e=0,g=a.length-1,c,d,k=-1;e<=g;)c=Math.floor((e+g)/2),d=b(a[c])-f,0>d?e=c+1:(0<d||(k=c),g=c-1);return-1!=k?k:e}function c(a,b,f,e,g,c){if(0!=a.length&&!(e>g)){var h=d(a,b,e);if(-1!=h&&(0<h&&b(a[h-1])+f(a[h-1])>=e&&c(a[h-1]),h!=a.length))for(f=a.length;h<f&&!(b(a[h])>=g);h++)c(a[h])}}return{findLowIndexInSortedArray:d,findLowIndexInSortedIntervals:function(a,b,f,e){var g=d(a,b,e);return 0==g?e>=b(a[0])&&e<b(a[0]+f(a[0]))?
@@ -129,21 +129,21 @@ if(this.process_){var c=[],a;for(a in this.process.counters)c.push(this.process.
return{ProcessTrack:d}});"use strict";base.requireStylesheet("tracks.model_track");base.require("tracks.container_track");base.require("tracks.cpu_track");base.require("tracks.process_track");base.require("ui");
base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks.ContainerTrack);d.prototype={__proto__:tracing.tracks.ContainerTrack.prototype,decorate:function(){this.classList.add("model-track");this.measuringStick_=new tracing.MeasuringStick;this.measuringStick_.attach()},detach:function(){tracing.tracks.ContainerTrack.prototype.detach.call(this);this.measuringStick_.detach()},get model(){return this.model_},set model(c){this.model_=c;this.updateHeadingWidth_();this.updateChildTracks_()},
updateHeadingWidth_:function(){var c=[];this.model.getAllThreads().forEach(function(b){c.push(b.userFriendlyName)});this.model.getAllCounters().forEach(function(b){c.push(b.name)});this.model.getAllCpus().forEach(function(b){c.push("CPU "+b.cpuNumber)});var a=0,b=document.createElement("div");b.style.position="fixed";b.className="canvas-based-track-title";for(var f=0;f<c.length;f++){b.textContent=c[f]+":__";var e=this.measuringStick_.measure(b).width;300<e&&(e=300);e>a&&(a=e)}this.headingWidth=a+
-"px"},updateChildTracks_:function(){this.detachAllChildren();if(this.model_){var c=this.model_.getAllCpus();c.sort(tracing.Cpu.compare);for(var a=0;a<c.length;++a){var b=c[a],f=new tracing.tracks.CpuTrack;f.heading="CPU "+b.cpuNumber+":";f.cpu=b;this.addTrack_(f)}c=this.model_.getAllProcesses();c.sort(tracing.Process.compare);for(a=0;a<c.length;++a)b=c[a],f=new tracing.tracks.ProcessTrack,f.process=b,this.addTrack_(f)}}};return{ModelTrack:d}});"use strict";base.requireStylesheet("tracks.viewport_track");
+"px"},updateChildTracks_:function(){this.detachAllChildren();if(this.model_){var c=this.model_.getAllCpus();c.sort(tracing.Cpu.compare);for(var a=0;a<c.length;++a){var b=c[a],f=new tracing.tracks.CpuTrack;f.heading="CPU "+b.cpuNumber+":";f.cpu=b;this.addTrack_(f)}c=this.model_.getAllProcesses();c.sort(tracing.Process.compare);for(a=0;a<c.length;++a)b=c[a],f=new tracing.tracks.ProcessTrack,f.process=b,this.addTrack_(f)}}};return{ModelTrack:d}});"use strict";base.requireStylesheet("tracks.ruler_track");
base.require("tracks.track");base.require("tracks.canvas_based_track");base.require("ui");
-base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks.CanvasBasedTrack),c=Math.log(10);d.prototype={__proto__:tracing.tracks.CanvasBasedTrack.prototype,decorate:function(){this.classList.add("viewport-track");this.strings_secs_=[];this.strings_msecs_=[];this.addEventListener("mousedown",this.onMouseDown)},onMouseDown:function(a){0==a.button&&this.placeAndBeginDraggingMarker(a.clientX)},placeAndBeginDraggingMarker:function(a){var b=window.devicePixelRatio||1;a=this.viewport_.xViewToWorld((a-
+base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks.CanvasBasedTrack),c=Math.log(10);d.prototype={__proto__:tracing.tracks.CanvasBasedTrack.prototype,decorate:function(){this.classList.add("ruler-track");this.strings_secs_=[];this.strings_msecs_=[];this.addEventListener("mousedown",this.onMouseDown)},onMouseDown:function(a){0==a.button&&this.placeAndBeginDraggingMarker(a.clientX)},placeAndBeginDraggingMarker:function(a){var b=window.devicePixelRatio||1;a=this.viewport_.xViewToWorld((a-
this.canvasContainer_.offsetLeft)*b);var f=this.viewport_.findMarkerNear(a,6),e=!1,c=!1;f||(f=this.viewport_.addMarker(a),e=!0);f.selected=!0;var d=this,h=function(a){a=d.viewport_.xViewToWorld((a.clientX-d.canvasContainer_.offsetLeft)*b);f.positionWorld=a;c=!0},k=function(){f.selected=!1;!c&&!e&&d.viewport_.removeMarker(f);document.removeEventListener("mouseup",k);document.removeEventListener("mousemove",h)};document.addEventListener("mouseup",k);document.addEventListener("mousemove",h)},drawLine_:function(a,
b,f,e,c,d){a.beginPath();a.moveTo(b,f);a.lineTo(e,c);a.closePath();a.strokeStyle=d;a.stroke()},drawArrow_:function(a,b,f,e,c,d,h){this.drawLine_(a,b,f,e,c,h);var k=e-b,l=c-f,w=Math.sqrt(k*k+l*l),m=(w-10)/w;b+=m*k;f+=m*l;l=l/w*d;d*=-(k/w);a.beginPath();a.fillStyle=h;a.moveTo(b+l,f+d);a.lineTo(e,c);a.lineTo(b-l,f-d);a.lineTo(b+l,f+d);a.closePath();a.fill()},redraw:function(){var a=this.ctx_,b=this.canvas_.width,f=this.canvas_.height;a.clearRect(0,0,b,f);var e=this.viewport_;e.xViewVectorToWorld(1);
-for(var g=e.xViewToWorld(0),d=e.xViewToWorld(b),h=this.classList.contains("viewport-track-with-distance-measurements"),k=h?f/2:f,l=0;l<e.markers.length;++l)e.markers[l].drawTriangle_(a,g,d,f,k,e);var w=window.devicePixelRatio||1,m=150*w,l=e.xViewVectorToWorld(m),q,p,r;p=Math.pow(10,Math.ceil(Math.log(l)/c));w=[10,5,2,1];for(l=0;l<w.length;++l)if(!(e.xWorldVectorToView(p/w[l])<m)){q=p/w[l-1];break}r=void 0;100>q?(m="ms",p=1,r=this.strings_msecs_):(m="s",p=1E3,r=this.strings_secs_);var t=e.xWorldVectorToView(q/
+for(var g=e.xViewToWorld(0),d=e.xViewToWorld(b),h=this.classList.contains("ruler-track-with-distance-measurements"),k=h?f/2:f,l=0;l<e.markers.length;++l)e.markers[l].drawTriangle_(a,g,d,f,k,e);var w=window.devicePixelRatio||1,m=150*w,l=e.xViewVectorToWorld(m),q,p,r;p=Math.pow(10,Math.ceil(Math.log(l)/c));w=[10,5,2,1];for(l=0;l<w.length;++l)if(!(e.xWorldVectorToView(p/w[l])<m)){q=p/w[l-1];break}r=void 0;100>q?(m="ms",p=1,r=this.strings_msecs_):(m="s",p=1E3,r=this.strings_secs_);var t=e.xWorldVectorToView(q/
5),l=Math.floor(g/q)*q,f=Math.floor(0.25*f);a.fillStyle="rgb(0, 0, 0)";a.strokeStyle="rgb(0, 0, 0)";a.textAlign="left";a.textBaseline="top";w=window.devicePixelRatio||1;a.font=9*w+"px sans-serif";for(g=l;g<d;g+=q){var s=Math.floor(e.xWorldToView(g)),l=Math.floor(1E5*(g/p))/1E5;r[l]||(r[l]=l+" "+m);a.fillText(r[l],s+2*w,0);a.beginPath();a.moveTo(s,0);a.lineTo(s,k);for(l=1;5>l;++l){var u=Math.floor(s+t*l);a.moveTo(u,k-f);a.lineTo(u,k)}a.stroke()}if(h){a.moveTo(0,k);a.lineTo(b,k);a.stroke();b=e.markers.slice();
b.sort(function(b,a){return b.positionWorld_-a.positionWorld_});k+=2;d=k+4;for(l=0;l<b.length-1;l++)w=b[l+1],r=b[l],t=w.positionWorld-r.positionWorld,q=e.xWorldVectorToView(t),h=e.xWorldToView(r.positionWorld+t/2),100>t?(m="ms",p=1):(m="s",p=1E3),p=t/p,m=Math.abs(Math.floor(1E3*p)/1E3)+" "+m,p=a.measureText(m).width,f=e.xViewVectorToWorld(p),p=p+26+10,g=r.positionWorld+t/2-f/2,s=g+f,t=k,f=e.xWorldToView(g),g=e.xWorldToView(s),r=e.xWorldToView(r.positionWorld),w=e.xWorldToView(w.positionWorld),s=!1,
-p<=q&&(a.fillStyle="rgb(0,0,0)",a.fillText(m,f,t),s=!0),26<=q&&(s?(m=f-10,p=g+10):p=m=h,this.drawArrow_(a,m,d,r,d,3,"rgb(128,121,121)"),this.drawArrow_(a,p,d,w,d,3,"rgb(128,121,121)"))}},addIntersectingItemsToSelection:function(){},addIntersectingItemsInRangeToSelection:function(){},addAllObjectsMatchingFilterToSelection:function(){}};return{ViewportTrack:d}});"use strict";base.requireStylesheet("timeline");base.require("event_target");base.require("measuring_stick");base.require("filter");base.require("selection");
-base.require("timeline_viewport");base.require("tracks.model_track");base.require("tracks.viewport_track");base.require("ui");
-base.exportTo("tracing",function(){var d=tracing.Selection,c=tracing.TimelineViewport,a=tracing.ui.define("div");a.prototype={__proto__:HTMLDivElement.prototype,model_:null,decorate:function(){this.classList.add("timeline");this.categoryFilter_=new tracing.CategoryFilter;this.viewport_=new c(this);this.viewportTrack_=new tracing.tracks.ViewportTrack;this.viewportTrack_.viewport=this.viewport_;this.appendChild(this.viewportTrack_);this.modelTrackContainer_=document.createElement("div");this.modelTrackContainer_.className=
+p<=q&&(a.fillStyle="rgb(0,0,0)",a.fillText(m,f,t),s=!0),26<=q&&(s?(m=f-10,p=g+10):p=m=h,this.drawArrow_(a,m,d,r,d,3,"rgb(128,121,121)"),this.drawArrow_(a,p,d,w,d,3,"rgb(128,121,121)"))}},addIntersectingItemsToSelection:function(){},addIntersectingItemsInRangeToSelection:function(){},addAllObjectsMatchingFilterToSelection:function(){}};return{RulerTrack:d}});"use strict";base.requireStylesheet("timeline");base.require("event_target");base.require("measuring_stick");base.require("filter");base.require("selection");
+base.require("timeline_viewport");base.require("tracks.model_track");base.require("tracks.ruler_track");base.require("ui");
+base.exportTo("tracing",function(){var d=tracing.Selection,c=tracing.TimelineViewport,a=tracing.ui.define("div");a.prototype={__proto__:HTMLDivElement.prototype,model_:null,decorate:function(){this.classList.add("timeline");this.categoryFilter_=new tracing.CategoryFilter;this.viewport_=new c(this);this.rulerTrack_=new tracing.tracks.RulerTrack;this.rulerTrack_.viewport=this.viewport_;this.appendChild(this.rulerTrack_);this.modelTrackContainer_=document.createElement("div");this.modelTrackContainer_.className=
"model-track-container";this.appendChild(this.modelTrackContainer_);this.modelTrack_=new tracing.tracks.ModelTrack;this.modelTrackContainer_.appendChild(this.modelTrack_);this.dragBox_=this.ownerDocument.createElement("div");this.dragBox_.className="drag-box";this.appendChild(this.dragBox_);this.hideDragBox_();this.bindEventListener_(document,"keypress",this.onKeypress_,this);this.bindEventListener_(document,"keydown",this.onKeydown_,this);this.bindEventListener_(document,"keyup",this.onKeyup_,this);
this.bindEventListener_(document,"mousemove",this.onMouseMove_,this);this.bindEventListener_(document,"mouseup",this.onMouseUp_,this);this.addEventListener("mousewheel",this.onMouseWheel_);this.addEventListener("mousedown",this.onMouseDown_);this.addEventListener("dblclick",this.onDblClick_);this.lastMouseViewPos_={x:0,y:0};this.maxHeadingWidth_=0;this.selection_=new d},bindEventListener_:function(b,a,e,c){this.boundListeners_||(this.boundListeners_=[]);e=e.bind(c);this.boundListeners_.push({object:b,
event:a,boundFunc:e});b.addEventListener(a,e)},detach:function(){this.modelTrack_.detach();for(var b=0;b<this.boundListeners_.length;b++){var a=this.boundListeners_[b];a.object.removeEventListener(a.event,a.boundFunc)}this.boundListeners_=void 0;this.viewport_.detach()},get viewport(){return this.viewport_},get categoryFilter(){return this.categoryFilter_},set categoryFilter(b){this.categoryFilter_=b;this.modelTrack_.categoryFilter=b},get model(){return this.model_},set model(b){if(!b)throw Error("Model cannot be null");
-var a=this.model_!=b;this.model_=b;this.modelTrack_.model=b;this.modelTrack_.viewport=this.viewport_;this.modelTrack_.categoryFilter=this.categoryFilter;this.viewportTrack_.headingWidth=this.modelTrack_.headingWidth;a&&this.viewport_.setWhenPossible(this.setInitialViewport_.bind(this))},get numVisibleTracks(){return this.modelTrack_.numVisibleTracks},setInitialViewport_:function(){var b=0.15*(this.model_.bounds.max-this.model_.bounds.min);this.viewport_.xSetWorldBounds(this.model_.bounds.min-b,this.model_.bounds.max+
+var a=this.model_!=b;this.model_=b;this.modelTrack_.model=b;this.modelTrack_.viewport=this.viewport_;this.modelTrack_.categoryFilter=this.categoryFilter;this.rulerTrack_.headingWidth=this.modelTrack_.headingWidth;a&&this.viewport_.setWhenPossible(this.setInitialViewport_.bind(this))},get numVisibleTracks(){return this.modelTrack_.numVisibleTracks},setInitialViewport_:function(){var b=0.15*(this.model_.bounds.max-this.model_.bounds.min);this.viewport_.xSetWorldBounds(this.model_.bounds.min-b,this.model_.bounds.max+
b,this.firstCanvas.width)},addAllObjectsMatchingFilterToSelection:function(b,a){this.modelTrack_.addAllObjectsMatchingFilterToSelection(b,a)},get focusElement(){return this.focusElement_?this.focusElement_:this.parentElement},set focusElement(b){this.focusElement_=b},get listenToKeys_(){return!this.viewport_.isAttachedToDocument_||this.activeElement instanceof tracing.FindControl?!1:!this.focusElement_?!0:0<=this.focusElement.tabIndex?document.activeElement==this.focusElement:!0},onKeypress_:function(b){var a=
this.viewport_;if(this.firstCanvas&&this.listenToKeys_&&"INPUT"!=document.activeElement.nodeName){var e=this.firstCanvas.clientWidth;switch(b.keyCode){case 119:case 44:this.zoomBy_(1.5);break;case 115:case 111:this.zoomBy_(1/1.5);break;case 103:this.onGridToggle_(!0);break;case 71:this.onGridToggle_(!1);break;case 87:case 60:this.zoomBy_(10);break;case 83:case 79:this.zoomBy_(0.1);break;case 97:a.panX+=a.xViewVectorToWorld(0.1*e);break;case 100:case 101:a.panX-=a.xViewVectorToWorld(0.1*e);break;case 65:a.panX+=
a.xViewVectorToWorld(0.5*e);break;case 68:a.panX-=a.xViewVectorToWorld(0.5*e);break;case 48:case 122:this.setInitialViewport_();break;case 102:this.zoomToSelection_()}}},onMouseWheel_:function(b){if(b.altKey){var a=Math.pow(1.5,b.wheelDeltaY/120);this.zoomBy_(a);b.preventDefault()}},onKeydown_:function(b){if(this.listenToKeys_){var a,e=this.viewport_,c=this.firstCanvas.clientWidth;switch(b.keyCode){case 37:if(a=this.selection.getShiftedSelection(-1))this.setSelectionAndMakeVisible(a),b.preventDefault();
@@ -152,14 +152,14 @@ this.dragBoxXEnd_,this.dragBoxYEnd_,b))}},onKeyup_:function(b){this.listenToKeys
a=b.min+0.5*(b.max-b.min),b=0.5*(b.max-b.min),e=0.15*b;this.viewport_.xSetWorldBounds(a-b-e,a+b+e,this.firstCanvas.width)}},get keyHelp(){var b="Qwerty Controls\n w/s : Zoom in/out (with shift: go faster)\n a/d : Pan left/right\n\nDvorak Controls\n ,/o : Zoom in/out (with shift: go faster)\n a/e : Pan left/right\n\nMouse Controls\n drag : Select slices (with "+(0==navigator.platform.indexOf("Mac")?"cmd":"ctrl")+": zoom to slices)\n drag + shift : Select all slices vertically\n\n",
b=this.focusElement.tabIndex?b+" <- : Select previous event on current timeline\n -> : Select next event on current timeline\n":b+"General Navigation\n g/General : Shows grid at the start/end of the selected task\n <-,^TAB : Select previous event on current timeline\n ->, TAB : Select next event on current timeline\n";return b+"\nAlt + Scroll to zoom in/out\nDbl-click to zoom in; Shift dbl-click to zoom out\nf to zoom into selection\nz to reset zoom and pan to initial view\n"},
get selection(){return this.selection_},set selection(b){if(!(b instanceof d))throw Error("Expected Selection");var a;for(a=0;a<this.selection_.length;a++)this.selection_[a].selected=!1;this.selection_=b;base.dispatchSimpleEvent(this,"selectionChange");for(a=0;a<this.selection_.length;a++)this.selection_[a].selected=!0;this.viewport_.dispatchChangeEvent()},setSelectionAndMakeVisible:function(b,a){if(!(b instanceof d))throw Error("Expected Selection");this.selection=b;var e=this.selection.bounds,c=
-this.viewport_.xWorldVectorToView(e.max-e.min);a&&50>c?(c=e.min+0.5*(e.max-e.min),e=5*(e.max-e.min),this.viewport_.xSetWorldBounds(c-0.5*e,c+0.5*e,this.firstCanvas.width)):this.viewport_.xPanWorldBoundsIntoView(e.min,e.max,this.firstCanvas.width)},get firstCanvas(){if(this.viewportTrack_)return this.viewportTrack_.firstCanvas;if(this.modelTrack_)return this.modelTrack_.firstCanvas},hideDragBox_:function(){this.dragBox_.style.left="-1000px";this.dragBox_.style.top="-1000px";this.dragBox_.style.width=
-0;this.dragBox_.style.height=0},setDragBoxPosition_:function(b,a,e,c,d){var h=Math.min(b,e);b=Math.max(b,e);e=this.modelTrack_.getBoundingClientRect();d?(d=e.top,e=e.bottom):(d=Math.min(a,c),e=Math.max(a,c));a=d;c=h+(b-h);d=a+(e-d);var k=this.modelTrackContainer_.getBoundingClientRect();e=k.left;var l=k.top,w=k.right,k=k.bottom,m=parseInt(this.modelTrack_.headingWidth);e+=m;m={};h>w||c<e||a>k||d<l?a=!1:(m.left=Math.max(e,h),m.top=Math.max(l,a),m.right=Math.min(w,c),m.bottom=Math.min(k,d),m.width=
-m.right-m.left,m.height=m.bottom-m.top,a=m);this.dragBox_.style.left=a.left+"px";this.dragBox_.style.width=a.width+"px";this.dragBox_.style.top=a.top+"px";this.dragBox_.style.height=a.height+"px";a=window.devicePixelRatio||1;c=this.firstCanvas;h=this.viewport_.xViewToWorld((h-c.offsetLeft)*a);b=this.viewport_.xViewToWorld((b-c.offsetLeft)*a);a=Math.round(100*(b-h))/100;this.dragBox_.textContent=a+"ms";a=new base.Event("selectionChanging");a.loWX=h;a.hiWX=b;this.dispatchEvent(a)},onGridToggle_:function(b){b=
-b?this.selection_.bounds.min:this.selection_.bounds.max;var a=Math.ceil((b-this.model_.bounds.min)/this.viewport_.gridStep_);this.viewport_.gridTimebase=b-(a+1)*this.viewport_.gridStep_;this.viewport_.gridEnabled=!0},isChildOfThis_:function(b){if(b!=this){for(;b.parentNode;){if(b==this)return!0;b=b.parentNode}return!1}},onMouseDown_:function(b){if(0===b.button)if(b.shiftKey)this.viewportTrack_.placeAndBeginDraggingMarker(b.clientX);else{var a=this.firstCanvas,e=this.modelTrack_.getBoundingClientRect(),
-c=this.firstCanvas.getBoundingClientRect();e&&(b.clientX>=e.left&&b.clientX<e.right&&b.clientY>=e.top&&b.clientY<e.bottom&&b.clientX>=c.left&&b.clientX<c.right)&&(this.viewport_.xViewToWorld(b.clientX-a.offsetLeft),this.dragBeginEvent_=b,b.preventDefault(),document.activeElement&&document.activeElement.blur(),0<=this.focusElement.tabIndex&&this.focusElement.focus())}},onMouseMove_:function(b){if(this.firstCanvas){var a=this.firstCanvas;this.lastMouseViewPos_={x:b.clientX-a.offsetLeft,y:b.clientY-
-a.offsetTop};this.dragBeginEvent_&&(this.dragBoxXStart_=this.dragBeginEvent_.clientX,this.dragBoxXEnd_=b.clientX,this.dragBoxYStart_=this.dragBeginEvent_.clientY,this.dragBoxYEnd_=b.clientY,this.setDragBoxPosition_(this.dragBoxXStart_,this.dragBoxYStart_,this.dragBoxXEnd_,this.dragBoxYEnd_,b.shiftKey))}},onMouseUp_:function(b){if(this.dragBeginEvent_){this.hideDragBox_();var a=this.dragBeginEvent_;this.dragBeginEvent_=null;var e,c=Math.min(a.clientX,b.clientX),j=Math.max(a.clientX,b.clientX);this.modelTrackContainer_.getBoundingClientRect();
-b.shiftKey?(a=this.modelTrack_.getBoundingClientRect(),e=a.top,a=a.bottom):(e=Math.min(a.clientY,b.clientY),a=Math.max(a.clientY,b.clientY));var h=this.firstCanvas,c=c-h.offsetLeft,j=j-h.offsetLeft,h=new d;this.modelTrack_.addIntersectingItemsInRangeToSelection(c,j,e,a,h);this.selection=h;(base.isMac&&b.metaKey||!base.isMac&&b.ctrlKey)&&this.zoomToSelection_()}},onDblClick_:function(b){var a=this.modelTrackContainer_.getBoundingClientRect(),e=a.left,a=a.right,c=parseInt(this.modelTrack_.headingWidth);
-b.clientX<e+c||b.clientX>a||(e=4,b.shiftKey&&(e=1/e),this.zoomBy_(e),b.preventDefault())}};base.defineProperty(a,"model",base.PropertyKind.JS);return{Timeline:a}});"use strict";base.exportTo("tracing.analysis",function(){return{tsRound:function(d){return Math.round(1E3*d)/1E3}}});"use strict";base.require("analysis.util");base.require("ui");base.requireStylesheet("timeline_analysis_view");
+this.viewport_.xWorldVectorToView(e.max-e.min);a&&50>c?(c=e.min+0.5*(e.max-e.min),e=5*(e.max-e.min),this.viewport_.xSetWorldBounds(c-0.5*e,c+0.5*e,this.firstCanvas.width)):this.viewport_.xPanWorldBoundsIntoView(e.min,e.max,this.firstCanvas.width)},get firstCanvas(){if(this.rulerTrack_)return this.rulerTrack_.firstCanvas;if(this.modelTrack_)return this.modelTrack_.firstCanvas},hideDragBox_:function(){this.dragBox_.style.left="-1000px";this.dragBox_.style.top="-1000px";this.dragBox_.style.width=0;this.dragBox_.style.height=
+0},setDragBoxPosition_:function(b,a,e,c,d){var h=Math.min(b,e);b=Math.max(b,e);e=this.modelTrack_.getBoundingClientRect();d?(d=e.top,e=e.bottom):(d=Math.min(a,c),e=Math.max(a,c));a=d;c=h+(b-h);d=a+(e-d);var k=this.modelTrackContainer_.getBoundingClientRect();e=k.left;var l=k.top,w=k.right,k=k.bottom,m=parseInt(this.modelTrack_.headingWidth);e+=m;m={};h>w||c<e||a>k||d<l?a=!1:(m.left=Math.max(e,h),m.top=Math.max(l,a),m.right=Math.min(w,c),m.bottom=Math.min(k,d),m.width=m.right-m.left,m.height=m.bottom-
+m.top,a=m);this.dragBox_.style.left=a.left+"px";this.dragBox_.style.width=a.width+"px";this.dragBox_.style.top=a.top+"px";this.dragBox_.style.height=a.height+"px";a=window.devicePixelRatio||1;c=this.firstCanvas;h=this.viewport_.xViewToWorld((h-c.offsetLeft)*a);b=this.viewport_.xViewToWorld((b-c.offsetLeft)*a);a=Math.round(100*(b-h))/100;this.dragBox_.textContent=a+"ms";a=new base.Event("selectionChanging");a.loWX=h;a.hiWX=b;this.dispatchEvent(a)},onGridToggle_:function(b){b=b?this.selection_.bounds.min:
+this.selection_.bounds.max;var a=Math.ceil((b-this.model_.bounds.min)/this.viewport_.gridStep_);this.viewport_.gridTimebase=b-(a+1)*this.viewport_.gridStep_;this.viewport_.gridEnabled=!0},isChildOfThis_:function(b){if(b!=this){for(;b.parentNode;){if(b==this)return!0;b=b.parentNode}return!1}},onMouseDown_:function(b){if(0===b.button)if(b.shiftKey)this.rulerTrack_.placeAndBeginDraggingMarker(b.clientX);else{var a=this.firstCanvas,e=this.modelTrack_.getBoundingClientRect(),c=this.firstCanvas.getBoundingClientRect();
+e&&(b.clientX>=e.left&&b.clientX<e.right&&b.clientY>=e.top&&b.clientY<e.bottom&&b.clientX>=c.left&&b.clientX<c.right)&&(this.viewport_.xViewToWorld(b.clientX-a.offsetLeft),this.dragBeginEvent_=b,b.preventDefault(),document.activeElement&&document.activeElement.blur(),0<=this.focusElement.tabIndex&&this.focusElement.focus())}},onMouseMove_:function(b){if(this.firstCanvas){var a=this.firstCanvas;this.lastMouseViewPos_={x:b.clientX-a.offsetLeft,y:b.clientY-a.offsetTop};this.dragBeginEvent_&&(this.dragBoxXStart_=
+this.dragBeginEvent_.clientX,this.dragBoxXEnd_=b.clientX,this.dragBoxYStart_=this.dragBeginEvent_.clientY,this.dragBoxYEnd_=b.clientY,this.setDragBoxPosition_(this.dragBoxXStart_,this.dragBoxYStart_,this.dragBoxXEnd_,this.dragBoxYEnd_,b.shiftKey))}},onMouseUp_:function(b){if(this.dragBeginEvent_){this.hideDragBox_();var a=this.dragBeginEvent_;this.dragBeginEvent_=null;var e,c=Math.min(a.clientX,b.clientX),j=Math.max(a.clientX,b.clientX);this.modelTrackContainer_.getBoundingClientRect();b.shiftKey?
+(a=this.modelTrack_.getBoundingClientRect(),e=a.top,a=a.bottom):(e=Math.min(a.clientY,b.clientY),a=Math.max(a.clientY,b.clientY));var h=this.firstCanvas,c=c-h.offsetLeft,j=j-h.offsetLeft,h=new d;this.modelTrack_.addIntersectingItemsInRangeToSelection(c,j,e,a,h);this.selection=h;(base.isMac&&b.metaKey||!base.isMac&&b.ctrlKey)&&this.zoomToSelection_()}},onDblClick_:function(b){var a=this.modelTrackContainer_.getBoundingClientRect(),e=a.left,a=a.right,c=parseInt(this.modelTrack_.headingWidth);b.clientX<
+e+c||b.clientX>a||(e=4,b.shiftKey&&(e=1/e),this.zoomBy_(e),b.preventDefault())}};base.defineProperty(a,"model",base.PropertyKind.JS);return{Timeline:a}});"use strict";base.exportTo("tracing.analysis",function(){return{tsRound:function(d){return Math.round(1E3*d)/1E3}}});"use strict";base.require("analysis.util");base.require("ui");base.requireStylesheet("timeline_analysis_view");
base.exportTo("tracing",function(){function d(b,a){var e=a.getSliceHitsAsSelection(),c=a.getCounterSampleHitsAsSelection();if(1==e.length){var d=e[0].slice,h=b.appendTable("analysis-slice-table",2);b.appendTableHeader(h,"Selected slice:");b.appendSummaryRow(h,"Title",d.title);d.category&&b.appendSummaryRow(h,"Category",d.category);b.appendSummaryRowTime(h,"Start",d.start);b.appendSummaryRowTime(h,"Duration",d.duration);d.durationInUserTime&&b.appendSummaryRowTime(h,"Duration (U)",d.durationInUserTime);
var e=0,k;for(k in d.args)e+=1;if(0<e)for(k in b.appendSummaryRow(h,"Args"),d.args)b.appendSummaryRow(h," "+k,d.args[k])}else if(1<e.length){var l=e.bounds.min,w=e.bounds.max;e.map(function(b){return b.slice.title});var h=0,m={};for(k=0;k<e.length;k++)d=e[k].slice,m[d.title]||(m[d.title]={slices:[]},h++),m[d.title].slices.push(d);h=b.appendTable("analysis-slices-table",3);b.appendTableHeader(h,"Slices:");var d=0,q;for(q in m){var p=m[q],r=0;k=0;var t=Number.MAX_VALUE,s=-Number.MAX_VALUE,u=Number.MAX_VALUE,
v=-Number.MAX_VALUE;for(k=0;k<p.slices.length;k++)r+=p.slices[k].duration,t=Math.min(p.slices[k].start,t),s=Math.max(p.slices[k].start,s),u=Math.min(p.slices[k].duration,u),v=Math.max(p.slices[k].duration,v);d+=r;0==p.slices.length&&(k=0);k=r/p.slices.length;u={min:u,max:v,avg:k,avg_stddev:void 0,frequency:void 0,frequency_stddev:void 0};for(k=v=0;k<p.slices.length;k++)var x=u.avg-p.slices[k].duration,v=v+x*x;u.avg_stddev=Math.sqrt(v/(p.slices.length-1));k=s-t;if(2<p.slices.length&&0<k){t=p.slices.length-
@@ -193,21 +193,26 @@ base.exportTo("tracing.importer",function(){function d(c,a){this.importPriority=
value:b[fieldName]})}this.allAsyncEvents_=[]}d.canImport=function(c){return"string"===typeof c||c instanceof String?"{"==c[0]||"["==c[0]:c instanceof Array&&c.length&&c[0].ph?!0:c.traceEvents?c.traceEvents instanceof Array&&c.traceEvents[0].ph:!1};d.prototype={__proto__:Object.prototype,processAsyncEvent:function(c,a){var b=this.model_.getOrCreateProcess(a.pid).getOrCreateThread(a.tid);this.allAsyncEvents_.push({event:a,thread:b})},processCounterEvent:function(c){var a;a=void 0!==c.id?c.name+"["+
c.id+"]":c.name;a=this.model_.getOrCreateProcess(c.pid).getOrCreateCounter(c.cat,a);if(0==a.numSeries){for(var b in c.args)a.seriesNames.push(b),a.seriesColors.push(tracing.getStringColorId(a.name+"."+b));if(0==a.numSeries){this.model_.importErrors.push("Expected counter "+c.name+" to have at least one argument to use as a value.");delete a.parent.counters[a.name];return}}a.timestamps.push(c.ts/1E3);for(var f=0;f<a.numSeries;f++)b=a.seriesNames[f],void 0===c.args[b]?a.samples.push(0):a.samples.push(c.args[b])},
importEvents:function(){for(var c=this.events_,a=0;a<c.length;a++){var b=c[a];if("B"==b.ph){var f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid);f.isTimestampValidForBeginOrEnd(b.ts/1E3)?f.beginSlice(b.cat,b.name,b.ts/1E3,b.args):this.model_.importErrors.push("Timestamps are moving backward.")}else if("E"==b.ph)if(f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid),f.isTimestampValidForBeginOrEnd(b.ts/1E3))if(f.openSliceCount){var f=f.endSlice(b.ts/1E3),e;for(e in b.args)void 0!==
-f.args[e]&&this.model_.importErrors.push("Both the B and E phases of "+f.name+"provided values for argument "+e+". The value of the E phase event will be used."),f.args[e]=b.args[e]}else this.model_.importErrors.push("E phase event without a matching B phase event.");else this.model_.importErrors.push("Timestamps are moving backward.");else"S"==b.ph?this.processAsyncEvent(a,b):"F"==b.ph?this.processAsyncEvent(a,b):"T"==b.ph?this.processAsyncEvent(a,b):"I"==b.ph?(f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid),
+f.args[e]&&this.model_.importErrors.push("Both the B and E phases of "+f.name+"provided values for argument "+e+". The value of the E phase event will be used."),f.args[e]=b.args[e]}else this.model_.importErrors.push("E phase event without a matching B phase event.");else this.model_.importErrors.push("Timestamps are moving backward.");else"S"==b.ph?this.processAsyncEvent(a,b):"F"==b.ph?this.processAsyncEvent(a,b):"T"==b.ph?this.processAsyncEvent(a,b):"I"==b.ph||"i"==b.ph?(f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid),
f.beginSlice(b.cat,b.name,b.ts/1E3,b.args),f.endSlice(b.ts/1E3)):"P"==b.ph?(f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid),f.addSample(b.cat,b.name,b.ts/1E3,b.args)):"C"==b.ph?this.processCounterEvent(b):"M"==b.ph?"thread_name"==b.name?(f=this.model_.getOrCreateProcess(b.pid).getOrCreateThread(b.tid),f.name=b.args.name):this.model_.importErrors.push("Unrecognized metadata name: "+b.name):"s"!=b.ph&&"t"!=b.ph&&"f"!=b.ph&&this.model_.importErrors.push("Unrecognized event phase: "+
-b.ph+"("+b.name+")")}},finalizeImport:function(){this.createAsyncSlices_()},createAsyncSlices_:function(){if(0!=this.allAsyncEvents_.length){this.allAsyncEvents_.sort(function(b,a){return b.event.ts-a.event.ts});for(var c={},a=this.allAsyncEvents_,b=0;b<a.length;b++){var f=a[b],e=f.event,d=e.name;if(void 0===d)this.model_.importErrors.push("Async events (ph: S, T or F) require an name parameter.");else{var j=e.id;if(void 0===j)this.model_.importErrors.push("Async events (ph: S, T or F) require an id parameter.");
+b.ph+"("+b.name+")")}},finalizeImport:function(){this.createAsyncSlices_()},createAsyncSlices_:function(){if(0!=this.allAsyncEvents_.length){this.allAsyncEvents_.sort(function(a,b){return a.event.ts-b.event.ts});for(var c={},a=this.allAsyncEvents_,b=0;b<a.length;b++){var f=a[b],e=f.event,d=e.name;if(void 0===d)this.model_.importErrors.push("Async events (ph: S, T or F) require an name parameter.");else{var j=e.id;if(void 0===j)this.model_.importErrors.push("Async events (ph: S, T or F) require an id parameter.");
else if("S"==e.ph)void 0===c[d]&&(c[d]={}),c[d][j]?this.model_.importErrors.push("At "+e.ts+", a slice of the same id "+j+" was alrady open."):(c[d][j]=[],c[d][j].push(f));else if(void 0===c[d])this.model_.importErrors.push("At "+e.ts+", no slice named "+d+" was open.");else if(void 0===c[d][j])this.model_.importErrors.push("At "+e.ts+", no slice named "+d+" with id="+j+" was open.");else{var h=c[d][j];h.push(f);if("F"==e.ph){var k=new tracing.AsyncSlice(h[0].event.cat,d,tracing.getStringColorId(d),
h[0].event.ts/1E3);k.duration=e.ts/1E3-h[0].event.ts/1E3;k.startThread=h[0].thread;k.endThread=f.thread;k.id=j;k.args=h[0].event.args;k.subSlices=[];for(f=1;f<h.length;++f){var l=d;"T"==h[f-1].event.ph&&(l=d+":"+h[f-1].event.args.step);l=new tracing.AsyncSlice(h[0].event.cat,l,tracing.getStringColorId(d+f),h[f-1].event.ts/1E3);l.duration=h[f].event.ts/1E3-h[f-1].event.ts/1E3;l.startThread=h[f-1].thread;l.endThread=h[f].thread;l.id=j;l.args=h[f-1].event.args;k.subSlices.push(l)}var h=k.subSlices[k.subSlices.length-
1],w;for(w in e.args)h.args[w]=e.args[w];k.startThread.asyncSlices.push(k);delete c[d][j]}}}}}}};tracing.Model.registerImporter(d);return{TraceEventImporter:d}});base.exportTo("tracing.importer.linux_perf",function(){function d(a){this.importer=a;this.model=a.model}var c=[];d.registerSubtype=function(a){c.push(a)};d.getSubtypeConstructors=function(){return c};d.prototype={__proto__:Object.prototype};return{Parser:d}});base.require("importer.linux_perf.parser");
base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("memory_bus_usage",d.prototype.traceMarkWriteBusEvent.bind(this));this.model_=a.model_;this.ppids_={}}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,traceMarkWriteBusEvent:function(a,b,f,e,c){c=/bus=(\S+) rw_bytes=(\d+) r_bytes=(\d+) w_bytes=(\d+) cycles=(\d+) ns=(\d+)/.exec(c.details);a=c[1];parseInt(c[2]);f=parseInt(c[3]);b=parseInt(c[4]);parseInt(c[5]);c=parseInt(c[6]);
f=1E9*f/c/1048576;b=1E9*b/c/1048576;c=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,"bus "+a+" read");0==c.numSeries&&(c.seriesNames.push("value"),c.seriesColors.push(tracing.getStringColorId(c.name+".value")));c.timestamps.push(e);c.samples.push(f);c=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,"bus "+a+" write");0==c.numSeries&&(c.seriesNames.push("value"),c.seriesColors.push(tracing.getStringColorId(c.name+".value")));c.timestamps.push(e);c.samples.push(b);return!0}};c.registerSubtype(d);
return{BusParser:d}});base.require("importer.linux_perf.parser");
-base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("clock_set_rate",d.prototype.traceMarkWriteClockEvent.bind(this));this.model_=a.model_;this.ppids_={}}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,traceMarkWriteClockEvent:function(a,b,c,e,d){b=/(\S+) state=(\d+) cpu_id=(\d+)/.exec(d.details);a=b[1];b=parseInt(b[2]);a=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,a);0==a.numSeries&&(a.seriesNames.push("value"),
-a.seriesColors.push(tracing.getStringColorId(a.name+".value")));a.timestamps.push(e);a.samples.push(b);return!0}};c.registerSubtype(d);return{ClockParser:d}});base.require("importer.linux_perf.parser");
+base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("clock_set_rate",d.prototype.traceMarkWriteClockEvent.bind(this));this.model_=a.model_;this.ppids_={}}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,traceMarkWriteClockEvent:function(a,b,f,c,d){b=/(\S+) state=(\d+) cpu_id=(\d+)/.exec(d.details);a=b[1];b=parseInt(b[2]);a=this.model_.getOrCreateProcess(0).getOrCreateCounter(null,a);0==a.numSeries&&(a.seriesNames.push("value"),
+a.seriesColors.push(tracing.getStringColorId(a.name+".value")));a.timestamps.push(c);a.samples.push(b);return!0}};c.registerSubtype(d);return{ClockParser:d}});base.require("importer.linux_perf.parser");
base.exportTo("tracing.importer.linux_perf",function(){function d(b){a.call(this,b);b.registerEventHandler("cpufreq_interactive_up",d.prototype.cpufreqUpDownEvent.bind(this));b.registerEventHandler("cpufreq_interactive_down",d.prototype.cpufreqUpDownEvent.bind(this));b.registerEventHandler("cpufreq_interactive_already",d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_notyet",d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_setspeed",
-d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_target",d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_boost",d.prototype.cpufreqBoostUnboostEvent.bind(this));b.registerEventHandler("cpufreq_interactive_unboost",d.prototype.cpufreqBoostUnboostEvent.bind(this))}function c(b){var a={};b=b.split(/\s+/);for(var c=b.length,d=0;d<c;d++){var j=b[d].split("=");a[j[0]]=parseInt(j[1])}return a}var a=tracing.importer.linux_perf.Parser;
-d.prototype={__proto__:a.prototype,cpufreqSlice:function(b,a,c,d){c=this.importer.getOrCreatePseudoThread("cpufreq");c.openSlice=a;b=new tracing.Slice("",c.openSlice,tracing.getStringColorId(c.openSlice),b,d,0);c.thread.pushSlice(b)},cpufreqBoostSlice:function(b,a,c){var d=this.importer.getOrCreatePseudoThread("cpufreq_boost");d.openSlice=a;b=new tracing.Slice("",d.openSlice,tracing.getStringColorId(d.openSlice),b,c,0);d.thread.pushSlice(b)},cpufreqUpDownEvent:function(b,a,e,d,j){a=c(j.details);this.cpufreqSlice(d,
-b,a.cpu,a);return!0},cpufreqTargetEvent:function(b,a,e,d,j){a=c(j.details);this.cpufreqSlice(d,b,a.cpu,a);return!0},cpufreqBoostUnboostEvent:function(b,a,c,d,j){this.cpufreqBoostSlice(d,b,{type:j.details});return!0}};a.registerSubtype(d);return{CpufreqParser:d}});base.require("importer.linux_perf.parser");
+d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_target",d.prototype.cpufreqTargetEvent.bind(this));b.registerEventHandler("cpufreq_interactive_boost",d.prototype.cpufreqBoostUnboostEvent.bind(this));b.registerEventHandler("cpufreq_interactive_unboost",d.prototype.cpufreqBoostUnboostEvent.bind(this))}function c(a){var f={};a=a.split(/\s+/);for(var c=a.length,d=0;d<c;d++){var j=a[d].split("=");f[j[0]]=parseInt(j[1])}return f}var a=tracing.importer.linux_perf.Parser;
+d.prototype={__proto__:a.prototype,cpufreqSlice:function(a,f,c,d){c=this.importer.getOrCreatePseudoThread("cpufreq");c.openSlice=f;a=new tracing.Slice("",c.openSlice,tracing.getStringColorId(c.openSlice),a,d,0);c.thread.pushSlice(a)},cpufreqBoostSlice:function(a,f,c){var d=this.importer.getOrCreatePseudoThread("cpufreq_boost");d.openSlice=f;a=new tracing.Slice("",d.openSlice,tracing.getStringColorId(d.openSlice),a,c,0);d.thread.pushSlice(a)},cpufreqUpDownEvent:function(a,f,e,d,j){f=c(j.details);this.cpufreqSlice(d,
+a,f.cpu,f);return!0},cpufreqTargetEvent:function(a,f,e,d,j){f=c(j.details);this.cpufreqSlice(d,a,f.cpu,f);return!0},cpufreqBoostUnboostEvent:function(a,f,c,d,j){this.cpufreqBoostSlice(d,a,{type:j.details});return!0}};a.registerSubtype(d);return{CpufreqParser:d}});base.require("importer.linux_perf.parser");
+base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("ext4_sync_file_enter",d.prototype.ext4SyncFileEnterEvent.bind(this));a.registerEventHandler("ext4_sync_file_exit",d.prototype.ext4SyncFileExitEvent.bind(this));a.registerEventHandler("block_rq_issue",d.prototype.blockRqIssueEvent.bind(this));a.registerEventHandler("block_rq_complete",d.prototype.blockRqCompleteEvent.bind(this))}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,
+openAsyncSlice:function(a,b,f,c,d,j){f=this.importer.getOrCreateKernelThread(b+":"+f,c);a=new tracing.AsyncSlice(b,j,tracing.getStringColorId(j),a);a.startThread=f.thread;f.openAsyncSlices||(f.openAsyncSlices={});f.openAsyncSlices[d]=a},closeAsyncSlice:function(a,b,f,c,d,j){f=this.importer.getOrCreateKernelThread(b+":"+f,c);if(f.openAsyncSlices&&(c=f.openAsyncSlices[d]))c.duration=a-c.start,c.args=j,c.endThread=f.thread,c.subSlices=[new tracing.Slice(b,c.title,c.colorId,c.start,c.args,c.duration)],
+f.thread.asyncSlices.push(c),delete f.openAsyncSlices[d]},ext4SyncFileEnterEvent:function(a,b,c,e,d){a=/dev (\d+,\d+) ino (\d+) parent (\d+) datasync (\d+)/.exec(d.details);if(!a)return!1;b=a[1];c=parseInt(a[2]);this.openAsyncSlice(e,"ext4",d.threadName,d.pid,b+"-"+c,1==a[4]?"fdatasync":"fsync");return!0},ext4SyncFileExitEvent:function(a,b,c,e,d){c=/dev (\d+,\d+) ino (\d+) ret (\d+)/.exec(d.details);if(!c)return!1;a=c[1];b=parseInt(c[2]);c=parseInt(c[3]);this.closeAsyncSlice(e,"ext4",d.threadName,
+d.pid,a+"-"+b,{device:a,inode:b,error:c});return!0},blockRqIssueEvent:function(a,b,c,e,d){var j=/(\d+,\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? \d+ \(.*\) (\d+) \+ (\d+) \[.*\]/.exec(d.details);if(!j)return!1;switch(j[3]){case "D":a="discard";break;case "W":a="write";break;case "R":a="read";break;case "N":a="none";break;default:a="unknown"}j[2]&&(a+=" flush");"F"==j[4]&&(a+=" fua");"A"==j[5]&&(a+=" ahead");"S"==j[6]&&(a+=" sync");"M"==j[7]&&(a+=" meta");b=j[1];c=parseInt(j[8]);j=parseInt(j[9]);this.openAsyncSlice(e,
+"block",d.threadName,d.pid,b+"-"+c+"-"+j,a);return!0},blockRqCompleteEvent:function(a,b,c,e,d){var j=/(\d+,\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? \(.*\) (\d+) \+ (\d+) \[(.*)\]/.exec(d.details);if(!j)return!1;a=j[1];b=parseInt(j[8]);c=parseInt(j[9]);j=parseInt(j[10]);this.closeAsyncSlice(e,"block",d.threadName,d.pid,a+"-"+b+"-"+c,{device:a,sector:b,numSectors:c,error:j});return!0}};c.registerSubtype(d);return{DiskParser:d}});base.require("importer.linux_perf.parser");
base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("drm_vblank_event",d.prototype.vblankEvent.bind(this))}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,drmVblankSlice:function(a,b,c){var e=this.importer.getOrCreatePseudoThread("drm_vblank");e.openSlice=b;a=new tracing.Slice("",e.openSlice,tracing.getStringColorId(e.openSlice),a,c,0);e.thread.pushSlice(a)},vblankEvent:function(a,b,c,e,d){b=/crtc=(\d+), seq=(\d+)/.exec(d.details);
if(!b)return!1;a=parseInt(b[1]);b=parseInt(b[2]);this.drmVblankSlice(e,"vblank:"+a,{crtc:a,seq:b});return!0}};c.registerSubtype(d);return{DrmParser:d}});base.require("importer.linux_perf.parser");
base.exportTo("tracing.importer.linux_perf",function(){function d(a){c.call(this,a);a.registerEventHandler("exynos_flip_request",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_flip_complete",d.prototype.flipEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_int",d.prototype.busfreqTargetIntEvent.bind(this));a.registerEventHandler("exynos_busfreq_target_mif",d.prototype.busfreqTargetMifEvent.bind(this))}var c=tracing.importer.linux_perf.Parser;d.prototype={__proto__:c.prototype,
@@ -272,29 +277,29 @@ void 0;return!0},executeQueueWork:function(){return!0},executeActivateWork:funct
base.exportTo("tracing.importer.linux_perf",function(){function d(b){a.call(this,b);b.registerEventHandler("tracing_mark_write:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));b.registerEventHandler("0:android",d.prototype.traceMarkWriteAndroidEvent.bind(this));this.model_=b.model_;this.ppids_={}}function c(a){var c={};if(a){a=a.split(";");for(var e=0;e<a.length;++e){var d=a[e].split("=");d[0]&&(c[d.shift()]=d.join("="))}}return c}var a=tracing.importer.linux_perf.Parser;d.prototype={__proto__:a.prototype,
traceMarkWriteAndroidEvent:function(a,d,e,g,j){a=j.details.split("|");switch(a[0]){case "B":d=parseInt(a[1]);var h=a[4],k=a[2],l=this.model_.getOrCreateProcess(d).getOrCreateThread(e);l.name=j.threadName;if(!l.isTimestampValidForBeginOrEnd(g))return this.model_.importErrors.push("Timestamps are moving backward."),!1;this.ppids_[e]=d;l.beginSlice(h,k,g,c(a[3]));break;case "E":d=this.ppids_[e];if(void 0===d)break;l=this.model_.getOrCreateProcess(d).getOrCreateThread(e);if(!l.openSliceCount)break;g=
l.endSlice(g);a=c(a[3]);for(h in a)void 0!==g.args[h]&&this.model_.importErrors.push("Both the B and E events of "+g.title+"provided values for argument "+h+". The value of the E event will be used."),g.args[h]=a[h];break;case "C":d=parseInt(a[1]);j=a[2];e=parseInt(a[3]);h=a[4];a=this.model_.getOrCreateProcess(d).getOrCreateCounter(h,j);0==a.numSeries&&(a.seriesNames.push("value"),a.seriesColors.push(tracing.getStringColorId(a.name+".value")));a.timestamps.push(g);a.samples.push(e);break;default:return!1}return!0}};
-a.registerSubtype(d);return{AndroidParser:d}});"use strict";base.require("model");base.require("color_scheme");base.require("importer.linux_perf.bus_parser");base.require("importer.linux_perf.clock_parser");base.require("importer.linux_perf.cpufreq_parser");base.require("importer.linux_perf.drm_parser");base.require("importer.linux_perf.exynos_parser");base.require("importer.linux_perf.gesture_parser");base.require("importer.linux_perf.i915_parser");base.require("importer.linux_perf.mali_parser");
-base.require("importer.linux_perf.power_parser");base.require("importer.linux_perf.sched_parser");base.require("importer.linux_perf.workqueue_parser");base.require("importer.linux_perf.android_parser");
+a.registerSubtype(d);return{AndroidParser:d}});"use strict";base.require("model");base.require("color_scheme");base.require("importer.linux_perf.bus_parser");base.require("importer.linux_perf.clock_parser");base.require("importer.linux_perf.cpufreq_parser");base.require("importer.linux_perf.disk_parser");base.require("importer.linux_perf.drm_parser");base.require("importer.linux_perf.exynos_parser");base.require("importer.linux_perf.gesture_parser");base.require("importer.linux_perf.i915_parser");
+base.require("importer.linux_perf.mali_parser");base.require("importer.linux_perf.power_parser");base.require("importer.linux_perf.sched_parser");base.require("importer.linux_perf.workqueue_parser");base.require("importer.linux_perf.android_parser");
base.exportTo("tracing.importer",function(){function d(a){this.cpu=a}function c(a,b){this.importPriority=2;this.model_=a;this.events_=b;this.clockSyncRecords_=[];this.cpuStates_={};this.wakeups_=[];this.kernelThreadStates_={};this.buildMapFromLinuxPidsToThreads();this.lineNumberBase=0;this.lineNumber=-1;this.pseudoThreadCounter=1;this.parsers_=[];this.eventHandlers_={}}function a(a){return b.test(a)?f:e.test(a)?g:j.test(a)?h:null}d.prototype={__proto__:Object.prototype,switchRunningLinuxPid:function(a,
-b,c,e,d,f){if(void 0!==this.lastActivePid&&0!=this.lastActivePid){var g=c-this.lastActiveTs;a=(a=a.threadsByLinuxPid[this.lastActivePid])?a.userFriendlyName:this.lastActiveComm;b=new tracing.Slice("",a,tracing.getStringColorId(a),this.lastActiveTs,{comm:this.lastActiveComm,tid:this.lastActivePid,prio:this.lastActivePrio,stateWhenDescheduled:b},g);this.cpu.slices.push(b)}this.lastActiveTs=c;this.lastActivePid=e;this.lastActiveComm=d;this.lastActivePrio=f}};TestExports={};var b=RegExp("^\\s*(.+)-(\\d+)\\s+\\(\\s*(\\d+|-+)\\)\\s\\[(\\d+)\\]\\s+[dX.][N.][Hhs.][0-9a-f.]\\s+(\\d+\\.\\d+):\\s+(\\S+):\\s(.*)$"),
+b,c,d,e,f){if(void 0!==this.lastActivePid&&0!=this.lastActivePid){var g=c-this.lastActiveTs;a=(a=a.threadsByLinuxPid[this.lastActivePid])?a.userFriendlyName:this.lastActiveComm;b=new tracing.Slice("",a,tracing.getStringColorId(a),this.lastActiveTs,{comm:this.lastActiveComm,tid:this.lastActivePid,prio:this.lastActivePrio,stateWhenDescheduled:b},g);this.cpu.slices.push(b)}this.lastActiveTs=c;this.lastActivePid=d;this.lastActiveComm=e;this.lastActivePrio=f}};TestExports={};var b=RegExp("^\\s*(.+)-(\\d+)\\s+\\(\\s*(\\d+|-+)\\)\\s\\[(\\d+)\\]\\s+[dX.][N.][Hhs.][0-9a-f.]\\s+(\\d+\\.\\d+):\\s+(\\S+):\\s(.*)$"),
f=function(a){a=b.exec(a);if(!a)return a;var c=a[3];"-"===c[0]&&(c=void 0);return{threadName:a[1],pid:a[2],tgid:c,cpuNumber:a[4],timestamp:a[5],eventName:a[6],details:a[7]}};TestExports.lineParserWithTGID=f;var e=/^\s*(.+)-(\d+)\s+\[(\d+)\]\s+[dX.][N.][Hhs.][0-9a-f.]\s+(\d+\.\d+):\s+(\S+):\s(.*)$/,g=function(a){a=e.exec(a);return!a?a:{threadName:a[1],pid:a[2],cpuNumber:a[3],timestamp:a[4],eventName:a[5],details:a[6]}};TestExports.lineParserWithIRQInfo=g;var j=/^\s*(.+)-(\d+)\s+\[(\d+)\]\s*(\d+\.\d+):\s+(\S+):\s(.*)$/,
-h=function(a){a=j.exec(a);return!a?a:{threadName:a[1],pid:a[2],cpuNumber:a[3],timestamp:a[4],eventName:a[5],details:a[6]}};TestExports.lineParserWithLegacyFmt=h;TestExports.traceEventClockSyncRE=/trace_event_clock_sync: parent_ts=(\d+\.?\d*)/;TestExports.autoDetectLineParser=a;c.canImport=function(b){if(!("string"===typeof b||b instanceof String))return!1;if(c._extractEventsFromSystraceHTML(b,!1).ok||/^# tracer:/.test(b))return!0;var e=/^(.+)\n/.exec(b);e&&(b=e[1]);return a(b)?!0:!1};c._extractEventsFromSystraceHTML=
-function(a,b){function c(a){for(;g<f.length;g++)if(a.test(f[g]))return!0;return!1}function e(a,b){return-1===a.indexOf(b,a.length-b.length)?a:a.substring(a,a.length-b.length)}var d={ok:!1};void 0===b&&(b=!0);if(!1==/^<!DOCTYPE HTML>/.test(a))return d;var f=a.split("\n"),g=1;if(!c(/^ <script>$/)||!c(/^ var linuxPerfData = "\\$/))return d;var h=g+1;if(!c(/^ <\/script>$/))return d;var j=g;if(!c(/^<\/body>$/)||!c(/^<\/html>$/))return d;var u=f.slice(h,j),j=[];if(b)for(var v=0;v<u.length;v++){var x=
-u[v],x=e(x,"\\n\\");j.push(x)}else j=[u[u.length-1]];u=j[j.length-1];v=e(u,'\\n";');if(v==u)return d;j[j.length-1]=v;return{ok:!0,lines:b?j:void 0,events_begin_at_line:h}};c.prototype={__proto__:Object.prototype,get model(){return this.model_},buildMapFromLinuxPidsToThreads:function(){this.threadsByLinuxPid={};this.model_.getAllThreads().forEach(function(a){this.threadsByLinuxPid[a.tid]=a}.bind(this))},getOrCreateCpuState:function(a){if(!this.cpuStates_[a]){var b=this.model_.getOrCreateCpu(a);this.cpuStates_[a]=
+h=function(a){a=j.exec(a);return!a?a:{threadName:a[1],pid:a[2],cpuNumber:a[3],timestamp:a[4],eventName:a[5],details:a[6]}};TestExports.lineParserWithLegacyFmt=h;TestExports.traceEventClockSyncRE=/trace_event_clock_sync: parent_ts=(\d+\.?\d*)/;TestExports.autoDetectLineParser=a;c.canImport=function(b){if(!("string"===typeof b||b instanceof String))return!1;if(c._extractEventsFromSystraceHTML(b,!1).ok||/^# tracer:/.test(b))return!0;var d=/^(.+)\n/.exec(b);d&&(b=d[1]);return a(b)?!0:!1};c._extractEventsFromSystraceHTML=
+function(a,b){function c(a){for(;g<f.length;g++)if(a.test(f[g]))return!0;return!1}function d(a,b){return-1===a.indexOf(b,a.length-b.length)?a:a.substring(a,a.length-b.length)}var e={ok:!1};void 0===b&&(b=!0);if(!1==/^<!DOCTYPE HTML>/.test(a))return e;var f=a.split("\n"),g=1;if(!c(/^ <script>$/)||!c(/^ var linuxPerfData = "\\$/))return e;var h=g+1;if(!c(/^ <\/script>$/))return e;var j=g;if(!c(/^<\/body>$/)||!c(/^<\/html>$/))return e;var u=f.slice(h,j),j=[];if(b)for(var v=0;v<u.length;v++){var x=
+u[v],x=d(x,"\\n\\");j.push(x)}else j=[u[u.length-1]];u=j[j.length-1];v=d(u,'\\n";');if(v==u)return e;j[j.length-1]=v;return{ok:!0,lines:b?j:void 0,events_begin_at_line:h}};c.prototype={__proto__:Object.prototype,get model(){return this.model_},buildMapFromLinuxPidsToThreads:function(){this.threadsByLinuxPid={};this.model_.getAllThreads().forEach(function(a){this.threadsByLinuxPid[a.tid]=a}.bind(this))},getOrCreateCpuState:function(a){if(!this.cpuStates_[a]){var b=this.model_.getOrCreateCpu(a);this.cpuStates_[a]=
new d(b)}return this.cpuStates_[a]},getOrCreateKernelThread:function(a,b,c){this.kernelThreadStates_[a]||(c=this.model_.getOrCreateProcess(b).getOrCreateThread(c),c.name=a,this.kernelThreadStates_[a]={pid:b,thread:c,openSlice:void 0,openSliceTS:void 0},this.threadsByLinuxPid[b]=c);return this.kernelThreadStates_[a]},getOrCreatePseudoThread:function(a){var b=this.kernelThreadStates_[a];b||(b=this.getOrCreateKernelThread(a,0,this.pseudoThreadCounter),this.pseudoThreadCounter++);return b},importEvents:function(a){this.createParsers();
-this.importCpuData();this.alignClocks(a)&&(this.buildMapFromLinuxPidsToThreads(),this.buildPerThreadCpuSlicesFromCpuState())},finalizeImport:function(){},buildPerThreadCpuSlicesFromCpuState:function(){for(var a in this.cpuStates_)for(var b=this.cpuStates_[a].cpu,c=0;c<b.slices.length;c++){var e=b.slices[c],d=this.threadsByLinuxPid[e.args.tid];d&&(d.tempCpuSlices||(d.tempCpuSlices=[]),d.tempCpuSlices.push(e))}for(c in this.wakeups_)if(a=this.wakeups_[c],d=this.threadsByLinuxPid[a.tid])d.tempWakeups=
-d.tempWakeups||[],d.tempWakeups.push(a);var f=tracing.getColorIdByName("running"),g=tracing.getColorIdByName("runnable"),h=tracing.getColorIdByName("sleeping"),j=tracing.getColorIdByName("iowait");this.model_.getAllThreads().forEach(function(a){if(void 0!==a.tempCpuSlices){var b=a.tempCpuSlices;delete a.tempCpuSlices;b.sort(function(a,b){return a.start-b.start});var c=a.tempWakeups||[];delete a.tempWakeups;c.sort(function(a,b){return a.ts-b.ts});var e=[];if(b.length){var d=b[0];e.push(new tracing.Slice("",
-"Running",f,d.start,{},d.duration))}for(var k=void 0,d=1;d<b.length;d++){for(var l=b[d-1],m=b[d],q=m.start-l.end;c.length&&c[0].ts<m.start;)k=c.shift();var w=function(a,b){void 0!==k&&(q=k.ts-l.end);e.push(new tracing.Slice("",a,b,l.end,{},q));void 0!==k&&(e.push(new tracing.Slice("","Runnable",g,k.ts,{"wakeup from tid":k.fromTid},m.start-k.ts)),k=void 0)};if("S"==l.args.stateWhenDescheduled)w("Sleeping",h);else if("R"==l.args.stateWhenDescheduled||"R+"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("",
-"Runnable",g,l.end,{},q));else if("D"==l.args.stateWhenDescheduled)w("Uninterruptible Sleep",j);else if("T"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("","__TASK_STOPPED",j,l.end,{},q));else if("t"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("","debug",j,l.end,{},q));else if("Z"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("","Zombie",j,l.end,{},q));else if("X"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("","Exit Dead",j,l.end,{},q));else if("x"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("",
-"Task Dead",j,l.end,{},q));else if("W"==l.args.stateWhenDescheduled)e.push(new tracing.Slice("","WakeKill",j,l.end,{},q));else if("D|W"==l.args.stateWhenDescheduled)w("Uninterruptable Sleep | WakeKill",j);else throw Error("Unrecognized state: ")+l.args.stateWhenDescheduled;e.push(new tracing.Slice("","Running",f,m.start,{},m.duration))}a.cpuSlices=e}})},alignClocks:function(a){if(0==this.clockSyncRecords_.length){if(!a)return!0;this.abortImport();return!1}a=this.clockSyncRecords_[0];if(0==a.parentTS||
-a.parentTS==a.perfTS)return!0;a=a.parentTS-a.perfTS;for(var b in this.cpuStates_){for(var c=this.cpuStates_[b].cpu,e=0;e<c.slices.length;e++){var d=c.slices[e];d.start+=a;d.duration=d.duration}for(var f in c.counters){e=c.counters[f];for(d=0;d<e.timestamps.length;d++)e.timestamps[d]+=a}}for(var g in this.kernelThreadStates_)this.kernelThreadStates_[g].thread.shiftTimestampsForward(a);return!0},abortImport:function(){if(this.pushedEventsToThreads)throw Error("Cannot abort, have alrady pushedCpuDataToThreads.");
+this.importCpuData();this.alignClocks(a)&&(this.buildMapFromLinuxPidsToThreads(),this.buildPerThreadCpuSlicesFromCpuState())},finalizeImport:function(){},buildPerThreadCpuSlicesFromCpuState:function(){for(var a in this.cpuStates_)for(var b=this.cpuStates_[a].cpu,c=0;c<b.slices.length;c++){var d=b.slices[c],e=this.threadsByLinuxPid[d.args.tid];e&&(e.tempCpuSlices||(e.tempCpuSlices=[]),e.tempCpuSlices.push(d))}for(c in this.wakeups_)if(a=this.wakeups_[c],e=this.threadsByLinuxPid[a.tid])e.tempWakeups=
+e.tempWakeups||[],e.tempWakeups.push(a);var f=tracing.getColorIdByName("running"),g=tracing.getColorIdByName("runnable"),h=tracing.getColorIdByName("sleeping"),j=tracing.getColorIdByName("iowait");this.model_.getAllThreads().forEach(function(a){if(void 0!==a.tempCpuSlices){var b=a.tempCpuSlices;delete a.tempCpuSlices;b.sort(function(a,b){return a.start-b.start});var c=a.tempWakeups||[];delete a.tempWakeups;c.sort(function(a,b){return a.ts-b.ts});var d=[];if(b.length){var e=b[0];d.push(new tracing.Slice("",
+"Running",f,e.start,{},e.duration))}for(var k=void 0,e=1;e<b.length;e++){for(var l=b[e-1],m=b[e],q=m.start-l.end;c.length&&c[0].ts<m.start;)k=c.shift();var w=function(a,b){void 0!==k&&(q=k.ts-l.end);d.push(new tracing.Slice("",a,b,l.end,{},q));void 0!==k&&(d.push(new tracing.Slice("","Runnable",g,k.ts,{"wakeup from tid":k.fromTid},m.start-k.ts)),k=void 0)};if("S"==l.args.stateWhenDescheduled)w("Sleeping",h);else if("R"==l.args.stateWhenDescheduled||"R+"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("",
+"Runnable",g,l.end,{},q));else if("D"==l.args.stateWhenDescheduled)w("Uninterruptible Sleep",j);else if("T"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("","__TASK_STOPPED",j,l.end,{},q));else if("t"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("","debug",j,l.end,{},q));else if("Z"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("","Zombie",j,l.end,{},q));else if("X"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("","Exit Dead",j,l.end,{},q));else if("x"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("",
+"Task Dead",j,l.end,{},q));else if("W"==l.args.stateWhenDescheduled)d.push(new tracing.Slice("","WakeKill",j,l.end,{},q));else if("D|W"==l.args.stateWhenDescheduled)w("Uninterruptable Sleep | WakeKill",j);else throw Error("Unrecognized state: ")+l.args.stateWhenDescheduled;d.push(new tracing.Slice("","Running",f,m.start,{},m.duration))}a.cpuSlices=d}})},alignClocks:function(a){if(0==this.clockSyncRecords_.length){if(!a)return!0;this.abortImport();return!1}a=this.clockSyncRecords_[0];if(0==a.parentTS||
+a.parentTS==a.perfTS)return!0;a=a.parentTS-a.perfTS;for(var b in this.cpuStates_){for(var c=this.cpuStates_[b].cpu,d=0;d<c.slices.length;d++){var e=c.slices[d];e.start+=a;e.duration=e.duration}for(var f in c.counters){d=c.counters[f];for(e=0;e<d.timestamps.length;e++)d.timestamps[e]+=a}}for(var g in this.kernelThreadStates_)this.kernelThreadStates_[g].thread.shiftTimestampsForward(a);return!0},abortImport:function(){if(this.pushedEventsToThreads)throw Error("Cannot abort, have alrady pushedCpuDataToThreads.");
for(var a in this.cpuStates_)delete this.model_.cpus[a];for(var b in this.kernelThreadStates_){a=this.kernelThreadStates_[b].thread;var c=a.parent;delete c.threads[a.tid];delete this.model_.processes[c.pid]}this.model_.importErrors.push("Cannot import kernel trace without a clock sync.")},createParsers:function(){for(var a=tracing.importer.linux_perf.Parser.getSubtypeConstructors(),b=0;b<a.length;++b)this.parsers_.push(new a[b](this));this.registerEventHandler("tracing_mark_write:trace_event_clock_sync",
-c.prototype.traceClockSyncEvent.bind(this));this.registerEventHandler("tracing_mark_write",c.prototype.traceMarkingWriteEvent.bind(this));this.registerEventHandler("0:trace_event_clock_sync",c.prototype.traceClockSyncEvent.bind(this));this.registerEventHandler("0",c.prototype.traceMarkingWriteEvent.bind(this))},registerEventHandler:function(a,b){this.eventHandlers_[a]=b},markPidRunnable:function(a,b,c,e,d){this.wakeups_.push({ts:a,tid:b,fromTid:d})},importError:function(a){this.model_.importErrors.push("Line "+
-(this.lineNumberBase+this.lineNumber+1)+": "+a)},traceClockSyncEvent:function(a,b,c,e,d){a=/parent_ts=(\d+\.?\d*)/.exec(d.details);if(!a)return!1;this.clockSyncRecords_.push({perfTS:e,parentTS:1E3*a[1]});return!0},traceMarkingWriteEvent:function(a,b,c,e,d,f){var g=/^\s*(\w+):\s*(.*)$/.exec(d.details);if(g)d.subEventName=g[1],d.details=g[2];else if(g=d.details.substring(0,2),"B|"==g||"E"==g||"E|"==g||"C|"==g)d.subEventName="android";else return!1;a=a+":"+d.subEventName;g=this.eventHandlers_[a];return!g?
-(this.importError("Unknown trace_marking_write event "+a),!0):g(a,b,c,e,d,f)},importCpuData:function(){var b=c._extractEventsFromSystraceHTML(this.events_,!0);b.ok?(this.lineNumberBase=b.events_begin_at_line,this.lines_=b.lines):(this.lineNumberBase=0,this.lines_=this.events_.split("\n"));b=null;for(this.lineNumber=0;this.lineNumber<this.lines_.length;++this.lineNumber){var e=this.lines_[this.lineNumber];if(!(0==e.length||/^#/.test(e))){if(null==b&&(b=a(e),null==b)){this.importError("Cannot parse line: "+
-e);continue}var d=b(e);if(d){var f=parseInt(d.pid),g=parseInt(d.cpuNumber),h=1E3*parseFloat(d.timestamp),j=d.eventName,t=this.eventHandlers_[j];t?t(j,g,f,h,d)||this.importError("Malformed "+j+" event ("+e+")"):this.importError("Unknown event "+j+" ("+e+")")}else this.importError("Unrecognized line: "+e)}}}};tracing.Model.registerImporter(c);return{LinuxPerfImporter:c,_LinuxPerfImporterTestExports:TestExports}});
+c.prototype.traceClockSyncEvent.bind(this));this.registerEventHandler("tracing_mark_write",c.prototype.traceMarkingWriteEvent.bind(this));this.registerEventHandler("0:trace_event_clock_sync",c.prototype.traceClockSyncEvent.bind(this));this.registerEventHandler("0",c.prototype.traceMarkingWriteEvent.bind(this))},registerEventHandler:function(a,b){this.eventHandlers_[a]=b},markPidRunnable:function(a,b,c,d,e){this.wakeups_.push({ts:a,tid:b,fromTid:e})},importError:function(a){this.model_.importErrors.push("Line "+
+(this.lineNumberBase+this.lineNumber+1)+": "+a)},traceClockSyncEvent:function(a,b,c,d,e){a=/parent_ts=(\d+\.?\d*)/.exec(e.details);if(!a)return!1;this.clockSyncRecords_.push({perfTS:d,parentTS:1E3*a[1]});return!0},traceMarkingWriteEvent:function(a,b,c,d,e,f){var g=/^\s*(\w+):\s*(.*)$/.exec(e.details);if(g)e.subEventName=g[1],e.details=g[2];else if(g=e.details.substring(0,2),"B|"==g||"E"==g||"E|"==g||"C|"==g)e.subEventName="android";else return!1;a=a+":"+e.subEventName;g=this.eventHandlers_[a];return!g?
+(this.importError("Unknown trace_marking_write event "+a),!0):g(a,b,c,d,e,f)},importCpuData:function(){var b=c._extractEventsFromSystraceHTML(this.events_,!0);b.ok?(this.lineNumberBase=b.events_begin_at_line,this.lines_=b.lines):(this.lineNumberBase=0,this.lines_=this.events_.split("\n"));b=null;for(this.lineNumber=0;this.lineNumber<this.lines_.length;++this.lineNumber){var d=this.lines_[this.lineNumber];if(!(0==d.length||/^#/.test(d))){if(null==b&&(b=a(d),null==b)){this.importError("Cannot parse line: "+
+d);continue}var e=b(d);if(e){var f=parseInt(e.pid),g=parseInt(e.cpuNumber),h=1E3*parseFloat(e.timestamp),j=e.eventName,t=this.eventHandlers_[j];t?t(j,g,f,h,e)||this.importError("Malformed "+j+" event ("+d+")"):this.importError("Unknown event "+j+" ("+d+")")}else this.importError("Unrecognized line: "+d)}}}};tracing.Model.registerImporter(c);return{LinuxPerfImporter:c,_LinuxPerfImporterTestExports:TestExports}});
base.exportTo("tracing.importer.v8",function(){function d(){}function c(a){this.dispatchTable_=a;this.lineNum_=0;this.csvParser_=new d}d.CSV_FIELD_RE_=/^"((?:[^"]|"")*)"|([^,]*)/;d.DOUBLE_QUOTE_RE_=/""/g;d.prototype.parseLine=function(a){var b=d.CSV_FIELD_RE_,c=d.DOUBLE_QUOTE_RE_,e=0,g=a.length,j=[];if(0<g){do{var h=b.exec(a.substr(e));"string"===typeof h[1]?(h=h[1],e+=h.length+3,j.push(h.replace(c,'"'))):(h=h[2],e+=h.length+1,j.push(h))}while(e<=g)}return j};c.prototype.printError=function(){};c.prototype.processLogChunk=
-function(a){this.processLog_(a.split("\n"))};c.prototype.processLogLine=function(a){this.processLog_([a])};c.prototype.processStack=function(a,b,c){b=b?[a,b]:[a];for(var e=0,d=c.length;e<d;++e){var j=c[e],h=j.charAt(0);"+"==h||"-"==h?(a+=parseInt(j,16),b.push(a)):"o"!=h&&b.push(parseInt(j,16))}return b};c.prototype.skipDispatch=function(){return!1};c.prototype.dispatchLogRow_=function(a){var b=a[0];if(b in this.dispatchTable_&&(b=this.dispatchTable_[b],!(null===b||this.skipDispatch(b)))){for(var c=
-[],e=0;e<b.parsers.length;++e){var d=b.parsers[e];if(null===d)c.push(a[1+e]);else if("function"==typeof d)c.push(d(a[1+e]));else{c.push(a.slice(1+e));break}}b.processor.apply(this,c)}};c.prototype.processLog_=function(a){for(var b=0,c=a.length;b<c;++b,++this.lineNum_){var e=a[b];if(e)try{var d=this.csvParser_.parseLine(e);this.dispatchLogRow_(d)}catch(j){this.printError("line "+(this.lineNum_+1)+": "+(j.message||j))}}};return{LogReader:c}});
+function(a){this.processLog_(a.split("\n"))};c.prototype.processLogLine=function(a){this.processLog_([a])};c.prototype.processStack=function(a,b,c){b=b?[a,b]:[a];for(var d=0,g=c.length;d<g;++d){var j=c[d],h=j.charAt(0);"+"==h||"-"==h?(a+=parseInt(j,16),b.push(a)):"o"!=h&&b.push(parseInt(j,16))}return b};c.prototype.skipDispatch=function(){return!1};c.prototype.dispatchLogRow_=function(a){var b=a[0];if(b in this.dispatchTable_&&(b=this.dispatchTable_[b],!(null===b||this.skipDispatch(b)))){for(var c=
+[],d=0;d<b.parsers.length;++d){var g=b.parsers[d];if(null===g)c.push(a[1+d]);else if("function"==typeof g)c.push(g(a[1+d]));else{c.push(a.slice(1+d));break}}b.processor.apply(this,c)}};c.prototype.processLog_=function(a){for(var b=0,c=a.length;b<c;++b,++this.lineNum_){var d=a[b];if(d)try{var g=this.csvParser_.parseLine(d);this.dispatchLogRow_(g)}catch(j){this.printError("line "+(this.lineNum_+1)+": "+(j.message||j))}}};return{LogReader:c}});
base.exportTo("tracing.importer.v8",function(){function d(){}d.prototype.root_=null;d.prototype.isEmpty=function(){return!this.root_};d.prototype.insert=function(c,a){if(this.isEmpty())this.root_=new d.Node(c,a);else if(this.splay_(c),this.root_.key!=c){var b=new d.Node(c,a);c>this.root_.key?(b.left=this.root_,b.right=this.root_.right,this.root_.right=null):(b.right=this.root_,b.left=this.root_.left,this.root_.left=null);this.root_=b}};d.prototype.remove=function(c){if(this.isEmpty())throw Error("Key not found: "+
c);this.splay_(c);if(this.root_.key!=c)throw Error("Key not found: "+c);var a=this.root_;if(this.root_.left){var b=this.root_.right;this.root_=this.root_.left;this.splay_(c);this.root_.right=b}else this.root_=this.root_.right;return a};d.prototype.find=function(c){if(this.isEmpty())return null;this.splay_(c);return this.root_.key==c?this.root_:null};d.prototype.findMin=function(){if(this.isEmpty())return null;for(var c=this.root_;c.left;)c=c.left;return c};d.prototype.findMax=function(c){if(this.isEmpty())return null;
for(c=c||this.root_;c.right;)c=c.right;return c};d.prototype.findGreatestLessThan=function(c){if(this.isEmpty())return null;this.splay_(c);return this.root_.key<=c?this.root_:this.root_.left?this.findMax(this.root_.left):null};d.prototype.exportKeysAndValues=function(){var c=[];this.traverse_(function(a){c.push([a.key,a.value])});return c};d.prototype.exportValues=function(){var c=[];this.traverse_(function(a){c.push(a.value)});return c};d.prototype.splay_=function(c){if(!this.isEmpty()){var a,b,
@@ -308,16 +313,16 @@ d.prototype.getAllStaticEntries=function(){return this.statics_.exportValues()};
0,c;var a=++this.knownNames_[c];return c+" {"+a+"}"};return{CodeMap:d}});base.require("model");base.require("slice");base.require("color_scheme");base.require("importer.v8.log_reader");base.require("importer.v8.codemap");
base.exportTo("tracing.importer",function(){function d(a,c){this.importPriority=3;this.model_=a;this.logData_=c;this.code_map_=new tracing.importer.v8.CodeMap;this.v8_samples_thread_=this.v8_stack_thread_=this.v8_timer_thread_=void 0}var c=["/d8","/libv8.so"],a={"V8.Execute":{pause:!1,no_execution:!1},"V8.External":{pause:!1,no_execution:!0},"V8.CompileFullCode":{pause:!0,no_execution:!0},"V8.RecompileSynchronous":{pause:!0,no_execution:!0},"V8.RecompileParallel":{pause:!1,no_execution:!1},"V8.CompileEval":{pause:!0,
no_execution:!0},"V8.Parse":{pause:!0,no_execution:!0},"V8.PreParse":{pause:!0,no_execution:!0},"V8.ParseLazy":{pause:!0,no_execution:!0},"V8.GCScavenger":{pause:!0,no_execution:!0},"V8.GCCompactor":{pause:!0,no_execution:!0},"V8.GCContext":{pause:!0,no_execution:!0}};d.canImport=function(a){return"string"!==typeof a&&!(a instanceof String)?!1:"timer-event,"==a.substring(0,12)||"tick,"==a.substring(0,5)||"shared-library,"==a.substring(0,15)||"profiler,"==a.substring(0,9)};d.prototype={__proto__:Object.prototype,
-processTimerEvent_:function(b,c,e){var d=a[b];if(void 0!==d){c/=1E3;e/=1E3;var j=tracing.getStringColorId(b);b=new tracing.Slice("v8",b,j,c,d,e);this.v8_timer_thread_.pushSlice(b)}},processTimerEventStart_:function(b,c){debugger;var d=a[b];void 0!==d&&this.v8_timer_thread_.beginSlice("v8",b,c/1E3,d)},processTimerEventEnd_:function(a,c){debugger;this.v8_timer_thread_.endSlice(c/1E3)},processCodeCreateEvent_:function(a,c,d,g,j){a=new tracing.importer.v8.CodeMap.CodeEntry(g,j);a.kind=c;this.code_map_.addCode(d,
+processTimerEvent_:function(b,c,d){var g=a[b];if(void 0!==g){c/=1E3;d/=1E3;var j=tracing.getStringColorId(b);b=new tracing.Slice("v8",b,j,c,g,d);this.v8_timer_thread_.pushSlice(b)}},processTimerEventStart_:function(b,c){debugger;var d=a[b];void 0!==d&&this.v8_timer_thread_.beginSlice("v8",b,c/1E3,d)},processTimerEventEnd_:function(a,c){debugger;this.v8_timer_thread_.endSlice(c/1E3)},processCodeCreateEvent_:function(a,c,d,g,j){a=new tracing.importer.v8.CodeMap.CodeEntry(g,j);a.kind=c;this.code_map_.addCode(d,
a)},processCodeMoveEvent_:function(a,c){this.code_map_.moveCode(a,c)},processCodeDeleteEvent_:function(a){this.code_map_.deleteCode(a)},processSharedLibrary_:function(a,d,e){e=new tracing.importer.v8.CodeMap.CodeEntry(e-d,a);e.kind=-3;for(var g=0;g<c.length;g++){var j=c[g];if(0<=a.indexOf(j,a.length-j.length)){e.kind=-1;break}}this.code_map_.addLibrary(d,e)},findCodeKind_:function(a){for(name in CodeKinds)if(0<=CodeKinds[name].kinds.indexOf(a))return CodeKinds[name]},nameForCodeEntry_:function(a){return a?
a.name:"UnknownCode"},processTickEvent_:function(a,c,d,g,j,h,k){c=this.code_map_.findEntry(a);c=this.nameForCodeEntry_(c);d/=1E3;this.v8_samples_thread_.addSample("v8",c,d);if(k&&k.length)for(a=0;8>a&&k[a];a++)c=this.code_map_.findEntry(k[a]),c=this.nameForCodeEntry_(c),g=tracing.getStringColorId(c),c=new tracing.Slice("v8",c,g,d,{},0),this.v8_stack_thread_.pushSlice(c)},processDistortion_:function(a){distortion_per_entry=a/1E6},processPlotRange_:function(a,c){xrange_start_override=a;xrange_end_override=
c},importEvents:function(){var a=new tracing.importer.v8.LogReader({"timer-event":{parsers:[null,parseInt,parseInt],processor:this.processTimerEvent_.bind(this)},"shared-library":{parsers:[null,parseInt,parseInt],processor:this.processSharedLibrary_.bind(this)},"timer-event-start":{parsers:[null,parseInt],processor:this.processTimerEventStart_.bind(this)},"timer-event-end":{parsers:[null,parseInt],processor:this.processTimerEventEnd_.bind(this)},"code-creation":{parsers:[null,parseInt,parseInt,parseInt,
null],processor:this.processCodeCreateEvent_.bind(this)},"code-move":{parsers:[parseInt,parseInt],processor:this.processCodeMoveEvent_.bind(this)},"code-delete":{parsers:[parseInt],processor:this.processCodeDeleteEvent_.bind(this)},tick:{parsers:[parseInt,parseInt,parseInt,null,null,parseInt,"var-args"],processor:this.processTickEvent_.bind(this)},distortion:{parsers:[parseInt],processor:this.processDistortion_.bind(this)},"plot-range":{parsers:[parseInt,parseInt],processor:this.processPlotRange_.bind(this)}});
this.v8_timer_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(1);this.v8_timer_thread_.name="V8 Timers";this.v8_stack_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(2);this.v8_stack_thread_.name="V8 JavaScript";this.v8_samples_thread_=this.model_.getOrCreateProcess(-32).getOrCreateThread(3);this.v8_samples_thread_.name="V8 PC";for(var c=this.logData_.split("\n"),d=0;d<c.length;d++)a.processLogLine(c[d])},finalizeImport:function(){}};tracing.Model.registerImporter(d);return{V8LogImporter:d}});
"use strict";
-base.exportTo("base",function(){function d(){this.storage_=a?a:"G_testRunner"in global?new c:localStorage}function c(){}var a=void 0;d.setAlternativeStorageInstance=function(b){a=b};d.prototype={get:function(a,c,d){a=this.namespace_(a,d);a=this.storage_.getItem(a);return void 0===a?c:String(a)},set:function(a,c,d){this.storage_.setItem(this.namespace_(a,d),String(c))},keys:function(a){var c=[];a=a||"";for(var d=0;d<this.storage_.length;d++){var g=this.storage_.key(d);this.isnamespaced_(g,a)&&c.push(this.unnamespace_(g,
-a))}return c},isnamespaced_:function(a,c){return 0==a.indexOf(this.normalize_(c))},namespace_:function(a,c){return this.normalize_(c)+a},unnamespace_:function(a,c){return a.replace(this.normalize_(c),"")},normalize_:function(a){return d.NAMESPACE+(a?a+".":"")}};d.NAMESPACE="trace-viewer";c.prototype={__proto__:Object.prototype,getItem:function(a){return this[a]},setItem:function(a,c){this[a]=c},key:function(a){return Object.keys(this).sort()[a]},get length(){return Object.keys(this).length}};return{Settings:d}});
-"use strict";base.requireStylesheet("timeline_view");base.require("timeline");base.require("timeline_analysis_view");base.require("category_filter_dialog");base.require("filter");base.require("find_control");base.require("overlay");base.require("importer.trace_event_importer");base.require("importer.linux_perf_importer");base.require("importer.v8_log_importer");base.require("settings");
+base.exportTo("base",function(){function d(){this.storage_=a?a:"G_testRunner"in global?new c:localStorage}function c(){}var a=void 0;d.setAlternativeStorageInstance=function(b){a=b};d.prototype={get:function(a,c,d){a=this.namespace_(a,d);a=this.storage_.getItem(a);return null===a||void 0===a?c:String(a)},set:function(a,c,d){this.storage_.setItem(this.namespace_(a,d),String(c))},keys:function(a){var c=[];a=a||"";for(var d=0;d<this.storage_.length;d++){var g=this.storage_.key(d);this.isnamespaced_(g,a)&&
+c.push(this.unnamespace_(g,a))}return c},isnamespaced_:function(a,c){return 0==a.indexOf(this.normalize_(c))},namespace_:function(a,c){return this.normalize_(c)+a},unnamespace_:function(a,c){return a.replace(this.normalize_(c),"")},normalize_:function(a){return d.NAMESPACE+(a?a+".":"")}};d.NAMESPACE="trace-viewer";c.prototype={__proto__:Object.prototype,getItem:function(a){return void 0===this[a]||null===this[a]?null:this[a]},setItem:function(a,c){this[a]=c},key:function(a){return Object.keys(this).sort()[a]},
+get length(){return Object.keys(this).length}};return{Settings:d}});"use strict";base.requireStylesheet("timeline_view");base.require("timeline");base.require("timeline_analysis_view");base.require("category_filter_dialog");base.require("filter");base.require("find_control");base.require("overlay");base.require("importer.trace_event_importer");base.require("importer.linux_perf_importer");base.require("importer.v8_log_importer");base.require("settings");
base.exportTo("tracing",function(){var d=tracing.ui.define("div");d.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){this.classList.add("view");this.titleEl_=document.createElement("div");this.titleEl_.textContent="Tracing: ";this.titleEl_.className="title";this.controlDiv_=document.createElement("div");this.controlDiv_.className="control";this.leftControlsEl_=document.createElement("div");this.leftControlsEl_.className="controls";this.rightControlsEl_=document.createElement("div");
this.rightControlsEl_.className="controls";var a=document.createElement("div");a.className="spacer";this.timelineContainer_=document.createElement("div");this.timelineContainer_.className="container";var b=document.createElement("div");b.className="analysis-container";this.analysisEl_=new tracing.TimelineAnalysisView;this.dragEl_=new c;this.dragEl_.target=b;this.findCtl_=new tracing.FindControl;this.findCtl_.controller=new tracing.FindController;this.importErrorsButton_=this.createImportErrorsButton_();
this.categoryFilterButton_=this.createCategoryFilterButton_();this.categoryFilterButton_.callback=this.updateCategoryFilterFromSettings_.bind(this);this.metadataButton_=this.createMetadataButton_();this.rightControls.appendChild(this.importErrorsButton_);this.rightControls.appendChild(this.categoryFilterButton_);this.rightControls.appendChild(this.metadataButton_);this.rightControls.appendChild(this.findCtl_);this.controlDiv_.appendChild(this.titleEl_);this.controlDiv_.appendChild(this.leftControlsEl_);
diff --git a/style.css b/style.css
index 12a0c751..6b2d353a 100644
--- a/style.css
+++ b/style.css
@@ -1 +1 @@
-* WARNING:This file is generated by generate_standalone_timeline_view.py * * Do not edit directly. */.track-button{background-color:rgba(255,255,255,0.5);border:1px solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.2);font-size:10px;height:12px;text-align:center;width:12px}.track-button:hover{background-color:rgba(255,255,255,1.0);border:1px solid rgba(0,0,0,0.5);box-shadow:0 0 .05em rgba(0,0,0,0.4);color:rgba(0,0,0,1)}.track-close-button{left:2px;position:absolute;top:2px}.track-collapse-button{left:17px;position:absolute;top:2px}.canvas-based-track{-webkit-box-align:stretch;-webkit-box-orient:horizontal;background-color:white;display:-webkit-box;margin:0;padding:0 5px 0 0}.canvas-based-track-title{background-color:#d6dde5;border-right:1px solid #8e8e8e;overflow:hidden;padding-right:5px;padding-left:18px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.canvas-based-track-canvas-container{-webkit-box-flex:1;width:100%}.canvas-based-track-canvas{-webkit-box-flex:1;display:block}.slice-track{height:18px}.counter-track{height:30px;position:relative}.thread-track{-webkit-box-orient:vertical;display:-webkit-box;position:relative}.thread-track>.slice-group-track.first-visible-child>.slice-track.first-visible-child .canvas-based-track-canvas-container{border-top:1px solid #d8d8d8;height:21px;padding-top:2px}.process-track.first-visible-child>.thread-track.first-visible-child>.slice-group-track.first-visible-child>.slice-track.first-visible-child .canvas-based-track-canvas-container{border-top:0}.thread-track>.slice-group-track.first-visible-child .canvas-based-track:first-child{height:21px}.thread-track .canvas-based-track:last-child .canvas-based-track-canvas-container{margin-bottom:4px}.thread-track .canvas-based-track:last-child{height:22px}.thread-track>.slice-group-track.first-visible-child .canvas-based-track:first-child:last-child{height:22px}.model-track{-webkit-box-flex:1}.viewport-track{height:12px}.viewport-track-with-distance-measurements{height:24px}.viewport-track .canvas-based-track-canvas-container{border-bottom:1px solid #8e8e8e}.timeline *{-webkit-user-select:none;cursor:default}.timeline{-webkit-box-orient:vertical;display:-webkit-box}.model-track-container{-webkit-box-flex:1;overflow:auto}.drag-box{background-color:rgba(0,0,255,0.25);border:1px solid #000060;font-size:75%;position:fixed}.analysis{font-family:monospace;white-space:pre}.analysis *{-webkit-user-select:text!important;cursor:text}.analysis-table{border-collapse:collapse;border-width:0}.analysis-table>tr>td:first-child{padding-left:2px}.analysis-table>tr>td{padding:2px 4px 2px 4px}.analysis-table-header{text-align:left}.analysis-table-row{vertical-align:top}.analysis-table-row:nth-child(2n+0){background-color:#e2e2e2}.analysis-slices-table-col-1{text-align:right}.analysis-slices-table-col-2{text-align:right}.overlay-root *{-webkit-user-select:none;box-sizing:border-box}.overlay-root{-webkit-box-align:stretch;-webkit-box-orient:horizontal;-webkit-box-pack:center;-webkit-user-select:none;background:rgba(0,0,0,0.8);display:-webkit-box;font-family:sans-serif;height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.overlay-root:not([visible]),.overlay:not([visible]){display:none}.overlay-root>.content-host{-webkit-box-align:stretch;-webkit-box-orient:vertical;-webkit-box-pack:center;-webkit-user-select:auto;display:-webkit-box}.overlay-root>.content-host>*{background:#fff}.overlay{max-height:500px;overflow:auto;padding:8px}.view *{-webkit-user-select:none;box-sizing:border-box}.view{-webkit-box-flex:1;-webkit-box-orient:vertical;cursor:default;display:-webkit-box;font-family:sans-serif;padding:0}.view>.control>.title{font-size:14px;height:19px;padding-left:2px;padding-right:8px;padding-top:2px}.view>.control{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#e5e5e5),to(#d1d1d1));background-color:#e6e6e6;border-bottom:1px solid #8e8e8e;display:-webkit-box}.view>.control>.controls{display:-webkit-box}.view>.control>span{padding-left:5px;padding-right:10px}.view>.control>.controls>button,.view>.control>.controls>label{font-size:11px;margin:1px 2px 1px 2px;height:19px}.view>.control>.spacer{-webkit-box-flex:1}.view>.container{-webkit-box-flex:1;display:-webkit-box;border-bottom:1px solid #8e8e8e}.view>.container>*{-webkit-box-flex:1}.drag-handle{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#e5e5e5),to(#d1d1d1));height:8px;border-top:1px solid white;border-bottom:1px solid #8e8e8e;cursor:ns-resize}.view>.analysis-container{height:250px;overflow:auto;padding-left:2px;padding-right:2px}.view .selection{margin:2px}.view .selection ul{margin:0}.find-control{-webkit-user-select:none;display:-webkit-box;position:relative}.find-control .hit-count-label{left:0;opacity:.25;pointer-events:none;position:absolute;text-align:right;top:2px;width:170px;z-index:1}.find-control input{-webkit-user-select:auto;background-color:#f8f8f8;border:1px solid rgba(0,0,0,0.5);box-sizing:border-box;height:19px;margin-bottom:1px;margin-left:0;margin-right:0;margin-top:1px;padding:0;width:170px}.find-control input:focus{background-color:white}.button.find-previous{border-left:none;margin-left:0;margin-right:0}.button.find-next{border-left:none;margin-left:0}.view-help-overlay{padding:6px}.button{background-color:#f8f8f8;border:1px solid rgba(0,0,0,0.5);color:rgba(0,0,0,0.8);font-size:14px;height:19px;margin:1px;text-align:center;width:23px}.button:hover{background-color:rgba(255,255,255,1.0);border:1px solid rgba(0,0,0,0.8);box-shadow:0 0 .05em rgba(0,0,0,0.4);color:rgba(0,0,0,1)}.view-info-button{width:auto;padding-left:4px;padding-right:4px}.view-info-button:hover{border:solid 1px}.view-import-errors-button{color:darkred;border:solid 1px rgba(128,0,0,0.2)}.view-import-errors-button:hover{color:red;border:solid 1px red}.import-errors-dialog{overflow:auto;min-width:400px;min-height:200px;max-width:800px;max-height:500px}.import-errors-dialog-text{white-space:pre;font-family:monospace;margin:8px}.metadata-dialog{overflow:auto;min-width:400px;min-height:200px;max-width:800px;max-height:500px}.metadata-dialog-text{white-space:pre;font-family:monospace;margin:8px}.category-filter-dialog{min-width:400px;min-height:200px;padding:20px}.category-filter-dialog-form{padding:10px;font-size:80%}.category-filter-dialog-form input{margin-right:7px} \ No newline at end of file
+* WARNING:This file is generated by generate_standalone_timeline_view.py * * Do not edit directly. */.track-button{background-color:rgba(255,255,255,0.5);border:1px solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.2);font-size:10px;height:12px;text-align:center;width:12px}.track-button:hover{background-color:rgba(255,255,255,1.0);border:1px solid rgba(0,0,0,0.5);box-shadow:0 0 .05em rgba(0,0,0,0.4);color:rgba(0,0,0,1)}.track-close-button{left:2px;position:absolute;top:2px}.track-collapse-button{left:17px;position:absolute;top:2px}.canvas-based-track{-webkit-box-align:stretch;-webkit-box-orient:horizontal;background-color:white;display:-webkit-box;margin:0;padding:0 5px 0 0}.canvas-based-track-title{background-color:#d6dde5;border-right:1px solid #8e8e8e;overflow:hidden;padding-right:5px;padding-left:18px;text-align:left;text-overflow:ellipsis;white-space:nowrap}.canvas-based-track-canvas-container{-webkit-box-flex:1;width:100%}.canvas-based-track-canvas{-webkit-box-flex:1;display:block}.slice-track{height:18px}.counter-track{height:30px;position:relative}.thread-track{-webkit-box-orient:vertical;display:-webkit-box;position:relative}.thread-track>.slice-group-track.first-visible-child>.slice-track.first-visible-child .canvas-based-track-canvas-container{border-top:1px solid #d8d8d8;height:21px;padding-top:2px}.process-track.first-visible-child>.thread-track.first-visible-child>.slice-group-track.first-visible-child>.slice-track.first-visible-child .canvas-based-track-canvas-container{border-top:0}.thread-track>.slice-group-track.first-visible-child .canvas-based-track:first-child{height:21px}.thread-track .canvas-based-track:last-child .canvas-based-track-canvas-container{margin-bottom:4px}.thread-track .canvas-based-track:last-child{height:22px}.thread-track>.slice-group-track.first-visible-child .canvas-based-track:first-child:last-child{height:22px}.model-track{-webkit-box-flex:1}.ruler-track{height:12px}.ruler-track-with-distance-measurements{height:24px}.ruler-track .canvas-based-track-canvas-container{border-bottom:1px solid #8e8e8e}.timeline *{-webkit-user-select:none;cursor:default}.timeline{-webkit-box-orient:vertical;display:-webkit-box}.model-track-container{-webkit-box-flex:1;overflow:auto}.drag-box{background-color:rgba(0,0,255,0.25);border:1px solid #000060;font-size:75%;position:fixed}.analysis{font-family:monospace;white-space:pre}.analysis *{-webkit-user-select:text!important;cursor:text}.analysis-table{border-collapse:collapse;border-width:0}.analysis-table>tr>td:first-child{padding-left:2px}.analysis-table>tr>td{padding:2px 4px 2px 4px}.analysis-table-header{text-align:left}.analysis-table-row{vertical-align:top}.analysis-table-row:nth-child(2n+0){background-color:#e2e2e2}.analysis-slices-table-col-1{text-align:right}.analysis-slices-table-col-2{text-align:right}.overlay-root *{-webkit-user-select:none;box-sizing:border-box}.overlay-root{-webkit-box-align:stretch;-webkit-box-orient:horizontal;-webkit-box-pack:center;-webkit-user-select:none;background:rgba(0,0,0,0.8);display:-webkit-box;font-family:sans-serif;height:100%;left:0;position:fixed;top:0;width:100%;z-index:1000}.overlay-root:not([visible]),.overlay:not([visible]){display:none}.overlay-root>.content-host{-webkit-box-align:stretch;-webkit-box-orient:vertical;-webkit-box-pack:center;-webkit-user-select:auto;display:-webkit-box}.overlay-root>.content-host>*{background:#fff}.overlay{max-height:500px;overflow:auto;padding:8px}.view *{-webkit-user-select:none;box-sizing:border-box}.view{-webkit-box-flex:1;-webkit-box-orient:vertical;cursor:default;display:-webkit-box;font-family:sans-serif;padding:0}.view>.control>.title{font-size:14px;height:19px;padding-left:2px;padding-right:8px;padding-top:2px}.view>.control{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#e5e5e5),to(#d1d1d1));background-color:#e6e6e6;border-bottom:1px solid #8e8e8e;display:-webkit-box}.view>.control>.controls{display:-webkit-box}.view>.control>span{padding-left:5px;padding-right:10px}.view>.control>.controls>button,.view>.control>.controls>label{font-size:11px;margin:1px 2px 1px 2px;height:19px}.view>.control>.spacer{-webkit-box-flex:1}.view>.container{-webkit-box-flex:1;display:-webkit-box;border-bottom:1px solid #8e8e8e}.view>.container>*{-webkit-box-flex:1}.drag-handle{background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#e5e5e5),to(#d1d1d1));height:8px;border-top:1px solid white;border-bottom:1px solid #8e8e8e;cursor:ns-resize}.view>.analysis-container{height:250px;overflow:auto;padding-left:2px;padding-right:2px}.view .selection{margin:2px}.view .selection ul{margin:0}.find-control{-webkit-user-select:none;display:-webkit-box;position:relative}.find-control .hit-count-label{left:0;opacity:.25;pointer-events:none;position:absolute;text-align:right;top:2px;width:170px;z-index:1}.find-control input{-webkit-user-select:auto;background-color:#f8f8f8;border:1px solid rgba(0,0,0,0.5);box-sizing:border-box;height:19px;margin-bottom:1px;margin-left:0;margin-right:0;margin-top:1px;padding:0;width:170px}.find-control input:focus{background-color:white}.button.find-previous{border-left:none;margin-left:0;margin-right:0}.button.find-next{border-left:none;margin-left:0}.view-help-overlay{padding:6px}.button{background-color:#f8f8f8;border:1px solid rgba(0,0,0,0.5);color:rgba(0,0,0,0.8);font-size:14px;height:19px;margin:1px;text-align:center;width:23px}.button:hover{background-color:rgba(255,255,255,1.0);border:1px solid rgba(0,0,0,0.8);box-shadow:0 0 .05em rgba(0,0,0,0.4);color:rgba(0,0,0,1)}.view-info-button{width:auto;padding-left:4px;padding-right:4px}.view-info-button:hover{border:solid 1px}.view-import-errors-button{color:darkred;border:solid 1px rgba(128,0,0,0.2)}.view-import-errors-button:hover{color:red;border:solid 1px red}.import-errors-dialog{overflow:auto;min-width:400px;min-height:200px;max-width:800px;max-height:500px}.import-errors-dialog-text{white-space:pre;font-family:monospace;margin:8px}.metadata-dialog{overflow:auto;min-width:400px;min-height:200px;max-width:800px;max-height:500px}.metadata-dialog-text{white-space:pre;font-family:monospace;margin:8px}.category-filter-dialog{min-width:400px;min-height:200px;padding:20px}.category-filter-dialog-form{padding:10px;font-size:80%}.category-filter-dialog-form input{margin-right:7px} \ No newline at end of file
diff --git a/trace-viewer/run_dev_server.py b/trace-viewer/run_dev_server.py
index cd377fea..a082d703 100755
--- a/trace-viewer/run_dev_server.py
+++ b/trace-viewer/run_dev_server.py
@@ -5,6 +5,7 @@
import optparse
import os
import sys
+import time
import SimpleHTTPServer
import BaseHTTPServer
@@ -12,20 +13,22 @@ import BaseHTTPServer
from build import calcdeps
DEFAULT_PORT = 8003
+DEPS_CHECK_DELAY = 5
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == '/src/deps.js':
- self.log_message('Regenerating deps')
- calcdeps.regenerate_deps()
+ current_time = time.time()
+ if self.server.next_deps_check < current_time:
+ self.log_message('Regenerating deps')
+ self.server.next_deps_check = current_time + DEPS_CHECK_DELAY
+ calcdeps.regenerate_deps()
return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
class Server(BaseHTTPServer.HTTPServer):
- def handle_one_request(self):
- try:
- HTTPServer.handle_one_request(self)
- except KeyboardInterrupt:
- sys.exit(255)
+ def __init__(self, *args, **kwargs):
+ BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
+ self.next_deps_check = -1
def Main(args):
parser = optparse.OptionParser()
diff --git a/trace-viewer/src/about_tracing.html b/trace-viewer/src/about_tracing.html
index 1650f5eb..fbfe3e76 100644
--- a/trace-viewer/src/about_tracing.html
+++ b/trace-viewer/src/about_tracing.html
@@ -38,7 +38,7 @@ body {
<link rel="stylesheet" href="tracks/counter_track.css">
<link rel="stylesheet" href="tracks/thread_track.css">
<link rel="stylesheet" href="tracks/model_track.css">
-<link rel="stylesheet" href="tracks/viewport_track.css">
+<link rel="stylesheet" href="tracks/ruler_track.css">
<link rel="stylesheet" href="timeline.css">
<link rel="stylesheet" href="timeline_analysis_view.css">
<link rel="stylesheet" href="overlay.css">
diff --git a/trace-viewer/src/about_tracing.js b/trace-viewer/src/about_tracing.js
index 3aa31fb8..caca9073 100644
--- a/trace-viewer/src/about_tracing.js
+++ b/trace-viewer/src/about_tracing.js
@@ -47,7 +47,7 @@ window.FLATTENED['tracks.async_slice_group_track'] = true;
window.FLATTENED['tracks.thread_track'] = true;
window.FLATTENED['tracks.process_track'] = true;
window.FLATTENED['tracks.model_track'] = true;
-window.FLATTENED['tracks.viewport_track'] = true;
+window.FLATTENED['tracks.ruler_track'] = true;
window.FLATTENED['timeline'] = true;
window.FLATTENED['analysis.util'] = true;
window.FLATTENED['timeline_analysis_view'] = true;
@@ -59,6 +59,7 @@ window.FLATTENED['importer.linux_perf.parser'] = true;
window.FLATTENED['importer.linux_perf.bus_parser'] = true;
window.FLATTENED['importer.linux_perf.clock_parser'] = true;
window.FLATTENED['importer.linux_perf.cpufreq_parser'] = true;
+window.FLATTENED['importer.linux_perf.disk_parser'] = true;
window.FLATTENED['importer.linux_perf.drm_parser'] = true;
window.FLATTENED['importer.linux_perf.exynos_parser'] = true;
window.FLATTENED['importer.linux_perf.gesture_parser'] = true;
@@ -111,7 +112,7 @@ window.FLATTENED['profiling_view'] = true;
<include src="tracks/thread_track.js">
<include src="tracks/process_track.js">
<include src="tracks/model_track.js">
-<include src="tracks/viewport_track.js">
+<include src="tracks/ruler_track.js">
<include src="timeline.js">
<include src="analysis/util.js">
<include src="timeline_analysis_view.js">
@@ -123,6 +124,7 @@ window.FLATTENED['profiling_view'] = true;
<include src="importer/linux_perf/bus_parser.js">
<include src="importer/linux_perf/clock_parser.js">
<include src="importer/linux_perf/cpufreq_parser.js">
+<include src="importer/linux_perf/disk_parser.js">
<include src="importer/linux_perf/drm_parser.js">
<include src="importer/linux_perf/exynos_parser.js">
<include src="importer/linux_perf/gesture_parser.js">
diff --git a/trace-viewer/src/deps.js b/trace-viewer/src/deps.js
index 2855e369..69088aeb 100644
--- a/trace-viewer/src/deps.js
+++ b/trace-viewer/src/deps.js
@@ -308,17 +308,17 @@ base.addModuleStylesheet(
'tracks.model_track',
'tracks.model_track');
base.addModuleDependency(
- 'tracks.viewport_track',
+ 'tracks.ruler_track',
'tracks.track');
base.addModuleDependency(
- 'tracks.viewport_track',
+ 'tracks.ruler_track',
'tracks.canvas_based_track');
base.addModuleDependency(
- 'tracks.viewport_track',
+ 'tracks.ruler_track',
'ui');
base.addModuleStylesheet(
- 'tracks.viewport_track',
- 'tracks.viewport_track');
+ 'tracks.ruler_track',
+ 'tracks.ruler_track');
base.addModuleDependency(
'timeline',
'event_target');
@@ -339,7 +339,7 @@ base.addModuleDependency(
'tracks.model_track');
base.addModuleDependency(
'timeline',
- 'tracks.viewport_track');
+ 'tracks.ruler_track');
base.addModuleDependency(
'timeline',
'ui');
@@ -395,6 +395,9 @@ base.addModuleDependency(
'importer.linux_perf.cpufreq_parser',
'importer.linux_perf.parser');
base.addModuleDependency(
+ 'importer.linux_perf.disk_parser',
+ 'importer.linux_perf.parser');
+base.addModuleDependency(
'importer.linux_perf.drm_parser',
'importer.linux_perf.parser');
base.addModuleDependency(
@@ -438,6 +441,9 @@ base.addModuleDependency(
'importer.linux_perf.cpufreq_parser');
base.addModuleDependency(
'importer.linux_perf_importer',
+ 'importer.linux_perf.disk_parser');
+base.addModuleDependency(
+ 'importer.linux_perf_importer',
'importer.linux_perf.drm_parser');
base.addModuleDependency(
'importer.linux_perf_importer',
diff --git a/trace-viewer/src/focus_outline_manager.js b/trace-viewer/src/focus_outline_manager.js
deleted file mode 100644
index 913cd601..00000000
--- a/trace-viewer/src/focus_outline_manager.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-base.define('tracing.ui', function() {
-
- /**
- * The class name to set on the document element.
- * @const
- */
- var CLASS_NAME = 'focus-outline-visible';
-
- /**
- * This class sets a CSS class name on the HTML element of |doc| when the user
- * presses the tab key. It removes the class name when the user clicks
- * anywhere.
- *
- * This allows you to write CSS like this:
- *
- * html.focus-outline-visible my-element:focus {
- * outline: 5px auto -webkit-focus-ring-color;
- * }
- *
- * And the outline will only be shown if the user uses the keyboard to get to
- * it.
- *
- * @param {Document} doc The document to attach the focus outline manager to.
- * @constructor
- */
- function FocusOutlineManager(doc) {
- this.classList_ = doc.documentElement.classList;
- var self = this;
- doc.addEventListener('keydown', function(e) {
- if (e.keyCode == 9) // Tab
- self.visible = true;
- }, true);
-
- doc.addEventListener('mousedown', function(e) {
- self.visible = false;
- }, true);
- }
-
- FocusOutlineManager.prototype = {
- /**
- * Whether the focus outline should be visible.
- * @type {boolean}
- */
- set visible(visible) {
- if (visible)
- this.classList_.add(CLASS_NAME);
- else
- this.classList_.remove(CLASS_NAME);
- },
- get visible() {
- this.classList_.contains(CLASS_NAME);
- }
- };
-
- /**
- * Array of Document and FocusOutlineManager pairs.
- * @type {Array}
- */
- var docsToManager = [];
-
- /**
- * Gets a per document sigleton focus outline manager.
- * @param {Document} doc The document to get the |FocusOutlineManager| for.
- * @return {FocusOutlineManager} The per document singleton focus outline
- * manager.
- */
- FocusOutlineManager.forDocument = function(doc) {
- for (var i = 0; i < docsToManager.length; i++) {
- if (doc == docsToManager[i][0])
- return docsToManager[i][1];
- }
- var manager = new FocusOutlineManager(doc);
- docsToManager.push([doc, manager]);
- return manager;
- };
-
- return {
- FocusOutlineManager: FocusOutlineManager
- };
-});
diff --git a/trace-viewer/src/importer/linux_perf/disk_parser.js b/trace-viewer/src/importer/linux_perf/disk_parser.js
new file mode 100644
index 00000000..200794bb
--- /dev/null
+++ b/trace-viewer/src/importer/linux_perf/disk_parser.js
@@ -0,0 +1,177 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/**
+ * @fileoverview Parses filesystem and block device events in the Linux event
+ * trace format.
+ */
+base.require('importer.linux_perf.parser');
+base.exportTo('tracing.importer.linux_perf', function() {
+
+ var Parser = tracing.importer.linux_perf.Parser;
+
+ /**
+ * Parses linux filesystem and block device trace events.
+ * @constructor
+ */
+ function DiskParser(importer) {
+ Parser.call(this, importer);
+
+ importer.registerEventHandler('ext4_sync_file_enter',
+ DiskParser.prototype.ext4SyncFileEnterEvent.bind(this));
+ importer.registerEventHandler('ext4_sync_file_exit',
+ DiskParser.prototype.ext4SyncFileExitEvent.bind(this));
+ importer.registerEventHandler('block_rq_issue',
+ DiskParser.prototype.blockRqIssueEvent.bind(this));
+ importer.registerEventHandler('block_rq_complete',
+ DiskParser.prototype.blockRqCompleteEvent.bind(this));
+ }
+
+ DiskParser.prototype = {
+ __proto__: Parser.prototype,
+
+ openAsyncSlice: function(ts, category, threadName, pid, key, name) {
+ var kthread = this.importer.getOrCreateKernelThread(
+ category + ':' + threadName, pid);
+ var slice = new tracing.AsyncSlice(
+ category, name, tracing.getStringColorId(name), ts);
+ slice.startThread = kthread.thread;
+
+ if (!kthread.openAsyncSlices) {
+ kthread.openAsyncSlices = { };
+ }
+ kthread.openAsyncSlices[key] = slice;
+ },
+
+ closeAsyncSlice: function(ts, category, threadName, pid, key, args) {
+ var kthread = this.importer.getOrCreateKernelThread(
+ category + ':' + threadName, pid);
+ if (kthread.openAsyncSlices) {
+ var slice = kthread.openAsyncSlices[key];
+ if (slice) {
+ slice.duration = ts - slice.start;
+ slice.args = args;
+ slice.endThread = kthread.thread;
+ slice.subSlices = [new tracing.Slice(category, slice.title,
+ slice.colorId, slice.start, slice.args, slice.duration)];
+ kthread.thread.asyncSlices.push(slice);
+ delete kthread.openAsyncSlices[key];
+ }
+ }
+ },
+
+ /**
+ * Parses events and sets up state in the importer.
+ */
+ ext4SyncFileEnterEvent: function(eventName, cpuNumber, pid, ts, eventBase) {
+ var event = /dev (\d+,\d+) ino (\d+) parent (\d+) datasync (\d+)/.
+ exec(eventBase.details);
+ if (!event)
+ return false;
+
+ var device = event[1];
+ var inode = parseInt(event[2]);
+ var datasync = event[4] == 1;
+ var key = device + '-' + inode;
+ var action = datasync ? 'fdatasync' : 'fsync';
+ this.openAsyncSlice(ts, 'ext4', eventBase.threadName, eventBase.pid,
+ key, action);
+ return true;
+ },
+
+ ext4SyncFileExitEvent: function(eventName, cpuNumber, pid, ts, eventBase) {
+ var event = /dev (\d+,\d+) ino (\d+) ret (\d+)/.exec(eventBase.details);
+ if (!event)
+ return false;
+
+ var device = event[1];
+ var inode = parseInt(event[2]);
+ var error = parseInt(event[3]);
+ var key = device + '-' + inode;
+ this.closeAsyncSlice(ts, 'ext4', eventBase.threadName, eventBase.pid,
+ key, {
+ device: device,
+ inode: inode,
+ error: error
+ });
+ return true;
+ },
+
+ blockRqIssueEvent: function(eventName, cpuNumber, pid, ts, eventBase) {
+ var event = new RegExp('(\\d+,\\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? ' +
+ '\\d+ \\(.*\\) (\\d+) \\+ (\\d+) \\[.*\\]').exec(eventBase.details);
+ if (!event)
+ return false;
+
+ var action;
+ switch (event[3]) {
+ case 'D':
+ action = 'discard';
+ break;
+ case 'W':
+ action = 'write';
+ break;
+ case 'R':
+ action = 'read';
+ break;
+ case 'N':
+ action = 'none';
+ break;
+ default:
+ action = 'unknown';
+ break;
+ }
+
+ if (event[2]) {
+ action += ' flush';
+ }
+ if (event[4] == 'F') {
+ action += ' fua';
+ }
+ if (event[5] == 'A') {
+ action += ' ahead';
+ }
+ if (event[6] == 'S') {
+ action += ' sync';
+ }
+ if (event[7] == 'M') {
+ action += ' meta';
+ }
+ var device = event[1];
+ var sector = parseInt(event[8]);
+ var numSectors = parseInt(event[9]);
+ var key = device + '-' + sector + '-' + numSectors;
+ this.openAsyncSlice(ts, 'block', eventBase.threadName, eventBase.pid,
+ key, action);
+ return true;
+ },
+
+ blockRqCompleteEvent: function(eventName, cpuNumber, pid, ts, eventBase) {
+ var event = new RegExp('(\\d+,\\d+) (F)?([DWRN])(F)?(A)?(S)?(M)? ' +
+ '\\(.*\\) (\\d+) \\+ (\\d+) \\[(.*)\\]').exec(eventBase.details);
+ if (!event)
+ return false;
+
+ var device = event[1];
+ var sector = parseInt(event[8]);
+ var numSectors = parseInt(event[9]);
+ var error = parseInt(event[10]);
+ var key = device + '-' + sector + '-' + numSectors;
+ this.closeAsyncSlice(ts, 'block', eventBase.threadName, eventBase.pid,
+ key, {
+ device: device,
+ sector: sector,
+ numSectors: numSectors,
+ error: error
+ });
+ return true;
+ },
+ };
+
+ Parser.registerSubtype(DiskParser);
+
+ return {
+ DiskParser: DiskParser
+ };
+});
diff --git a/trace-viewer/src/importer/linux_perf/disk_parser_test.html b/trace-viewer/src/importer/linux_perf/disk_parser_test.html
new file mode 100644
index 00000000..635fa191
--- /dev/null
+++ b/trace-viewer/src/importer/linux_perf/disk_parser_test.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<!--
+Copyright (c) 2013 The Chromium Authors. All rights reserved.
+Use of this source code is governed by a BSD-style license that can be
+found in the LICENSE file.
+-->
+<head>
+<title>importer.linux_perf.DiskParser tests</title>
+<script src="../../base.js"></script>
+</head>
+<body>
+<script>
+'use strict';
+
+base.require('unittest');
+base.require('test_utils');
+base.require('importer.linux_perf_importer');
+
+function testDiskImport() {
+ var lines = [
+ // NB: spliced from different traces; mismatched timestamps don't matter
+ 'AsyncTask #2-18830 [000] ...1 154578.668286: ext4_sync_file_enter: ' +
+ 'dev 259,1 ino 81993 parent 81906 datasync 1',
+ 'mmcqd/0-81 [000] d..2 154578.668390: block_rq_issue: ' +
+ '179,0 WS 0 () 3427120 + 16 [mmcqd/0]',
+ 'mmcqd/0-81 [000] d..2 154578.669181: block_rq_complete: ' +
+ '179,0 WS () 3427120 + 16 [0]',
+ 'mmcqd/0-81 [001] d..2 154578.670853: block_rq_issue: ' +
+ '179,0 FWS 0 () 18446744073709551615 + 0 [mmcqd/0]',
+ 'mmcqd/0-81 [001] d..2 154578.670869: block_rq_complete: ' +
+ '179,0 FWS () 18446744073709551615 + 0 [0]',
+ 'AsyncTask #2-18830 [001] ...1 154578.670901: ext4_sync_file_exit: ' +
+ 'dev 259,1 ino 81993 ret 0',
+ 'mmcqd/0-81 [001] d..2 154578.877038: block_rq_issue: ' +
+ '179,0 R 0 () 3255256 + 8 [mmcqd/0]',
+ 'mmcqd/0-81 [001] d..2 154578.877110: block_rq_issue: ' +
+ '179,0 R 0 () 3255288 + 8 [mmcqd/0]',
+ 'mmcqd/0-81 [000] d..2 154578.877345: block_rq_complete: ' +
+ '179,0 R () 3255256 + 8 [0]',
+ 'mmcqd/0-81 [000] d..2 154578.877466: block_rq_complete: ' +
+ '179,0 R () 3255288 + 8 [0]'
+ ];
+ var m = new tracing.Model(lines.join('\n'), false);
+ assertEquals(0, m.importErrors.length);
+
+ var blockThread = undefined;
+ var ext4Thread = undefined;
+ m.getAllThreads().forEach(function(t) {
+ switch (t.name) {
+ case 'block:mmcqd/0':
+ blockThread = t;
+ break;
+ case 'ext4:AsyncTask #2':
+ ext4Thread = t;
+ break;
+ default:
+ throw new unittest.TestError('Unexpected thread named ' + t.name);
+ }
+ });
+ assertNotUndefined(blockThread);
+ assertNotUndefined(ext4Thread);
+
+ assertEquals(4, blockThread.asyncSlices.length);
+
+ var slice = blockThread.asyncSlices.slices[0];
+ assertEquals('block', slice.category);
+ assertEquals('write sync', slice.title);
+ assertEquals('179,0', slice.args.device);
+ assertEquals(0, slice.args.error);
+ assertEquals(16, slice.args.numSectors);
+ assertEquals(3427120, slice.args.sector);
+
+ assertEquals(1, ext4Thread.asyncSlices.length);
+
+ slice = ext4Thread.asyncSlices.slices[0];
+ assertEquals('ext4', slice.category);
+ assertEquals('fdatasync', slice.title);
+ assertEquals('259,1', slice.args.device);
+ assertEquals(0, slice.args.error);
+ assertEquals(81993, slice.args.inode);
+}
+
+</script>
+</body>
+</html>
diff --git a/trace-viewer/src/importer/linux_perf_importer.js b/trace-viewer/src/importer/linux_perf_importer.js
index d70168bd..922156fc 100644
--- a/trace-viewer/src/importer/linux_perf_importer.js
+++ b/trace-viewer/src/importer/linux_perf_importer.js
@@ -23,6 +23,7 @@ base.require('color_scheme');
base.require('importer.linux_perf.bus_parser');
base.require('importer.linux_perf.clock_parser');
base.require('importer.linux_perf.cpufreq_parser');
+base.require('importer.linux_perf.disk_parser');
base.require('importer.linux_perf.drm_parser');
base.require('importer.linux_perf.exynos_parser');
base.require('importer.linux_perf.gesture_parser');
diff --git a/trace-viewer/src/importer/trace_event_importer.js b/trace-viewer/src/importer/trace_event_importer.js
index 334ea52c..03210a72 100644
--- a/trace-viewer/src/importer/trace_event_importer.js
+++ b/trace-viewer/src/importer/trace_event_importer.js
@@ -196,7 +196,7 @@ base.exportTo('tracing.importer', function() {
this.processAsyncEvent(eI, event);
} else if (event.ph == 'T') {
this.processAsyncEvent(eI, event);
- } else if (event.ph == 'I') {
+ } else if (event.ph == 'I' || event.ph == 'i') {
// Treat an Instant event as a duration 0 slice.
// SliceTrack's redraw() knows how to handle this.
var thread = this.model_.getOrCreateProcess(event.pid)
diff --git a/trace-viewer/src/importer/trace_event_importer_test.html b/trace-viewer/src/importer/trace_event_importer_test.html
index b6c75d09..53abb82b 100644
--- a/trace-viewer/src/importer/trace_event_importer_test.html
+++ b/trace-viewer/src/importer/trace_event_importer_test.html
@@ -384,18 +384,19 @@ function testImmediateParsing() {
// recentering/zeroing doesn't clobber their timestamp.
{name: 'a', args: {}, pid: 1, ts: 1, cat: 'foo', tid: 1, ph: 'B'},
{name: 'immediate', args: {}, pid: 1, ts: 2, cat: 'bar', tid: 1, ph: 'I'},
+ {name: 'slower', args: {}, pid: 1, ts: 4, cat: 'baz', tid: 1, ph: 'i'},
{name: 'a', args: {}, pid: 1, ts: 4, cat: 'foo', tid: 1, ph: 'E'}
];
var m = new tracing.Model(events, false);
var p = m.processes[1];
var t = p.threads[1];
- assertEquals(2, t.slices.length);
+ assertEquals(3, t.slices.length);
assertEquals(0.002, t.slices[0].start);
assertEquals(0, t.slices[0].duration);
- assertEquals(0.001, t.slices[1].start);
- assertEquals(0.003, t.slices[1].duration);
+ assertEquals(0.004, t.slices[1].start);
+ assertEquals(0.001, t.slices[2].start);
+ assertEquals(0.003, t.slices[2].duration);
- assertEquals(2, t.slices.length);
var slice = findSliceNamed(t.slices, 'a');
assertEquals('a', slice.title);
assertEquals('foo', slice.category);
@@ -407,6 +408,13 @@ function testImmediateParsing() {
assertEquals(0.002, immed.start);
assertEquals(0, immed.duration);
assertEquals(0, immed.subSlices.length);
+
+ var slower = findSliceNamed(t.slices, 'slower');
+ assertEquals('slower', slower.title);
+ assertEquals('baz', slower.category);
+ assertEquals(0.004, slower.start);
+ assertEquals(0, slower.duration);
+ assertEquals(0, slower.subSlices.length);
}
function testSimpleCounter() {
diff --git a/trace-viewer/src/profiling_view.js b/trace-viewer/src/profiling_view.js
index 30005cfc..724fe825 100644
--- a/trace-viewer/src/profiling_view.js
+++ b/trace-viewer/src/profiling_view.js
@@ -152,6 +152,8 @@ base.exportTo('tracing', function() {
dlg.visible = true;
this.categorySelectionDialog_ = dlg;
+ buttonEl.focus();
+
setTimeout(function() {
tc.removeEventListener('categoriesCollected',
this.onCategoriesCollectedBoundToThis_);
diff --git a/trace-viewer/src/settings.js b/trace-viewer/src/settings.js
index 6be30662..dada58cf 100644
--- a/trace-viewer/src/settings.js
+++ b/trace-viewer/src/settings.js
@@ -48,7 +48,7 @@ base.exportTo('base', function() {
get: function(key, opt_default, opt_namespace) {
key = this.namespace_(key, opt_namespace);
var val = this.storage_.getItem(key);
- if (val === undefined)
+ if (val === null || val === undefined)
return opt_default;
return String(val);
},
@@ -121,6 +121,9 @@ base.exportTo('base', function() {
__proto__: Object.prototype,
getItem: function(key) {
+ // LocalStorage returns null if the key isn't found, not undefined.
+ if (this[key] === undefined || this[key] === null)
+ return null;
return this[key];
},
diff --git a/trace-viewer/src/settings_test.html b/trace-viewer/src/settings_test.html
index 6c484cc0..ac57694c 100644
--- a/trace-viewer/src/settings_test.html
+++ b/trace-viewer/src/settings_test.html
@@ -52,7 +52,7 @@ function testGetUnset() {
function testGetDefault() {
var settings = new base.Settings();
- // Null should be returned if value isn't set.
+ // default_val should be returned if value isn't set.
assertEquals('default_val', settings.get('my_key', 'default_val'));
}
diff --git a/trace-viewer/src/tests.html b/trace-viewer/src/tests.html
index 23118401..122b2b66 100644
--- a/trace-viewer/src/tests.html
+++ b/trace-viewer/src/tests.html
@@ -28,6 +28,7 @@ found in the LICENSE file.
'importer/linux_perf/bus_parser_test.html',
'importer/linux_perf/clock_parser_test.html',
'importer/linux_perf/cpufreq_parser_test.html',
+ 'importer/linux_perf/disk_parser_test.html',
'importer/linux_perf/drm_parser_test.html',
'importer/linux_perf/exynos_parser_test.html',
'importer/linux_perf/gesture_parser_test.html',
@@ -53,7 +54,7 @@ found in the LICENSE file.
'tracks/slice_group_track_test.html',
'tracks/slice_track_test.html',
'tracks/thread_track_test.html',
- 'tracks/viewport_track_test.html',
+ 'tracks/ruler_track_test.html',
'analysis/counter_selection_analysis_test.html',
'analysis/selection_analysis_test.html',
'analysis/slice_selection_analysis_test.html',
diff --git a/trace-viewer/src/timeline.js b/trace-viewer/src/timeline.js
index 02c24338..118ce30e 100644
--- a/trace-viewer/src/timeline.js
+++ b/trace-viewer/src/timeline.js
@@ -24,7 +24,7 @@ base.require('filter');
base.require('selection');
base.require('timeline_viewport');
base.require('tracks.model_track');
-base.require('tracks.viewport_track');
+base.require('tracks.ruler_track');
base.require('ui');
base.exportTo('tracing', function() {
@@ -71,9 +71,9 @@ base.exportTo('tracing', function() {
this.viewport_ = new Viewport(this);
// Add the viewport track.
- this.viewportTrack_ = new tracing.tracks.ViewportTrack();
- this.viewportTrack_.viewport = this.viewport_;
- this.appendChild(this.viewportTrack_);
+ this.rulerTrack_ = new tracing.tracks.RulerTrack();
+ this.rulerTrack_.viewport = this.viewport_;
+ this.appendChild(this.rulerTrack_);
this.modelTrackContainer_ = document.createElement('div');
this.modelTrackContainer_.className = 'model-track-container';
@@ -155,7 +155,7 @@ base.exportTo('tracing', function() {
this.modelTrack_.model = model;
this.modelTrack_.viewport = this.viewport_;
this.modelTrack_.categoryFilter = this.categoryFilter;
- this.viewportTrack_.headingWidth = this.modelTrack_.headingWidth;
+ this.rulerTrack_.headingWidth = this.modelTrack_.headingWidth;
// Set up a reasonable viewport.
if (modelInstanceChanged)
@@ -448,8 +448,8 @@ base.exportTo('tracing', function() {
},
get firstCanvas() {
- if (this.viewportTrack_)
- return this.viewportTrack_.firstCanvas;
+ if (this.rulerTrack_)
+ return this.rulerTrack_.firstCanvas;
if (this.modelTrack_)
return this.modelTrack_.firstCanvas;
return undefined;
@@ -548,7 +548,7 @@ base.exportTo('tracing', function() {
return;
if (e.shiftKey) {
- this.viewportTrack_.placeAndBeginDraggingMarker(e.clientX);
+ this.rulerTrack_.placeAndBeginDraggingMarker(e.clientX);
return;
}
diff --git a/trace-viewer/src/tracks/canvas_based_track.js b/trace-viewer/src/tracks/canvas_based_track.js
index 805d3702..f88058b3 100644
--- a/trace-viewer/src/tracks/canvas_based_track.js
+++ b/trace-viewer/src/tracks/canvas_based_track.js
@@ -102,11 +102,9 @@ base.exportTo('tracing.tracks', function() {
viewportMarkersChange_: function() {
if (this.viewport_.markers.length < 2)
- this.classList.remove('viewport-track-with' +
- '-distance-measurements');
+ this.classList.remove('ruler-track-with-distance-measurements');
else
- this.classList.add('viewport-track-with' +
- '-distance-measurements');
+ this.classList.add('ruler-track-with-distance-measurements');
},
invalidate: function() {
diff --git a/trace-viewer/src/tracks/viewport_track.css b/trace-viewer/src/tracks/ruler_track.css
index f7833567..9204bb61 100644
--- a/trace-viewer/src/tracks/viewport_track.css
+++ b/trace-viewer/src/tracks/ruler_track.css
@@ -2,14 +2,14 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
-.viewport-track {
+.ruler-track {
height: 12px;
}
-.viewport-track-with-distance-measurements {
+.ruler-track-with-distance-measurements {
height: 24px;
}
-.viewport-track .canvas-based-track-canvas-container {
+.ruler-track .canvas-based-track-canvas-container {
border-bottom: 1px solid #8e8e8e;
}
diff --git a/trace-viewer/src/tracks/viewport_track.js b/trace-viewer/src/tracks/ruler_track.js
index 800f467d..1e78661a 100644
--- a/trace-viewer/src/tracks/viewport_track.js
+++ b/trace-viewer/src/tracks/ruler_track.js
@@ -4,7 +4,7 @@
'use strict';
-base.requireStylesheet('tracks.viewport_track');
+base.requireStylesheet('tracks.ruler_track');
base.require('tracks.track');
base.require('tracks.canvas_based_track');
@@ -13,24 +13,24 @@ base.require('ui');
base.exportTo('tracing.tracks', function() {
/**
- * A track that displays the viewport size and scale.
+ * A track that displays the ruler.
* @constructor
* @extends {CanvasBasedTrack}
*/
- var ViewportTrack = tracing.ui.define(tracing.tracks.CanvasBasedTrack);
+ var RulerTrack = tracing.ui.define(tracing.tracks.CanvasBasedTrack);
var logOf10 = Math.log(10);
function log10(x) {
return Math.log(x) / logOf10;
}
- ViewportTrack.prototype = {
+ RulerTrack.prototype = {
__proto__: tracing.tracks.CanvasBasedTrack.prototype,
decorate: function() {
- this.classList.add('viewport-track');
+ this.classList.add('ruler-track');
this.strings_secs_ = [];
this.strings_msecs_ = [];
this.addEventListener('mousedown', this.onMouseDown);
@@ -123,8 +123,8 @@ base.exportTo('tracing.tracks', function() {
var viewLWorld = vp.xViewToWorld(0);
var viewRWorld = vp.xViewToWorld(canvasW);
- var measurements = this.classList.contains('viewport' +
- '-track-with-distance-measurements');
+ var measurements = this.classList.contains(
+ 'ruler-track-with-distance-measurements');
var rulerHeight = measurements ? canvasH / 2 : canvasH;
@@ -326,7 +326,7 @@ base.exportTo('tracing.tracks', function() {
* @return {boolean} true if a slice was found, otherwise false.
*/
addIntersectingItemsToSelection: function(vX, vY, selection) {
- // Does nothing. There's nothing interesting to pick on the viewport
+ // Does nothing. There's nothing interesting to pick on the ruler
// track.
},
@@ -344,7 +344,7 @@ base.exportTo('tracing.tracks', function() {
*/
addIntersectingItemsInRangeToSelection: function(
loVX, hiVX, loY, hiY, selection) {
- // Does nothing. There's nothing interesting to pick on the viewport
+ // Does nothing. There's nothing interesting to pick on the ruler
// track.
},
@@ -353,6 +353,6 @@ base.exportTo('tracing.tracks', function() {
};
return {
- ViewportTrack: ViewportTrack
+ RulerTrack: RulerTrack
};
});
diff --git a/trace-viewer/src/tracks/viewport_track_test.html b/trace-viewer/src/tracks/ruler_track_test.html
index 3e0a1f52..908458e2 100644
--- a/trace-viewer/src/tracks/viewport_track_test.html
+++ b/trace-viewer/src/tracks/ruler_track_test.html
@@ -17,7 +17,7 @@ found in the LICENSE file.
base.require('unittest');
base.require('test_utils');
base.require('timeline_viewport');
- base.require('tracks.viewport_track');
+ base.require('tracks.ruler_track');
</script>
</head>
<body>
@@ -25,12 +25,12 @@ found in the LICENSE file.
'use strict';
var Viewport = tracing.TimelineViewport;
- var ViewportTrack = tracing.tracks.ViewportTrack;
+ var RulerTrack = tracing.tracks.RulerTrack;
function testViewport() {
var testEl = this.addHTMLOutput();
- var track = ViewportTrack();
+ var track = RulerTrack();
testEl.appendChild(track);
track.viewport = new Viewport(testEl);
track.viewport.setPanAndScale(0,