aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2013-04-16 16:58:26 -0700
committerJamie Gennis <jgennis@google.com>2013-04-16 16:58:26 -0700
commit3090923463b8782c5d06540608304e3c227c1d63 (patch)
treea4aad7c4da5cbebe30a07670777710c2f6c30feb
parent8678103fbbcce20310466dd36458e19f025e4146 (diff)
downloadchromium-trace-3090923463b8782c5d06540608304e3c227c1d63.tar.gz
systrace: update to trace-viewer rev 256
Change-Id: Ifde6f8c2de9edc94c8cd9cda5f765460bdf30066
-rw-r--r--UPSTREAM_REVISION2
-rw-r--r--script.js49
-rw-r--r--trace-viewer/src/category_filter_dialog.js13
-rw-r--r--trace-viewer/src/profiling_view.js27
-rw-r--r--trace-viewer/src/profiling_view_test.html35
-rw-r--r--trace-viewer/src/tracks/counter_track.js16
6 files changed, 108 insertions, 34 deletions
diff --git a/UPSTREAM_REVISION b/UPSTREAM_REVISION
index 63fe24a5..9183bf03 100644
--- a/UPSTREAM_REVISION
+++ b/UPSTREAM_REVISION
@@ -1 +1 @@
-253
+256
diff --git a/script.js b/script.js
index a25f8d25..c2b535dd 100644
--- a/script.js
+++ b/script.js
@@ -6,11 +6,11 @@ window.FLATTENED["importer.linux_perf.exynos_parser"]=!0;window.FLATTENED["impor
window.FLATTENED["importer.linux_perf.kfunc_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){u[b]||(u[b]=[]);for(var f=u[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"!=v[b]){if("RESOLVING"==v[b])throw Error("Circular dependency betwen modules. Cannot continue!");v[b]="RESOLVING";for(var j=u[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(!w[k]){var h=q+"/"+k,h='<script type="text/javascript" src="'+h+'">\x3c/script>';base.doc.write(h);w[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>');
-v[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=
+}else if(f(),"APPENDED"!=w[b]){if("RESOLVING"==w[b])throw Error("Circular dependency betwen modules. Cannot continue!");w[b]="RESOLVING";for(var j=u[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>');
+w[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 t(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={},u={},s={},v={},w={},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(!w[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=
+b):this.removeAttribute(g),f&&f.call(this,a,e),j(this,b,a,e))}}}function t(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={},u={},s={},w={},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 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:t,getUid:function(b){return b.hasOwnProperty("uid")?b.uid:b.uid=z++},initialize:function(){if(global.document)t.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,
@@ -65,8 +65,8 @@ base.exportTo("tracing",function(){function d(a,b,f){if(0==a.length)return 1;for
0:-1:g<=a.length&&e>=b(a[g-1])&&e<b(a[g-1])+f(a[g-1])?g-1:a.length},iterateOverIntersectingIntervals:c,getIntersectingIntervals:function(a,b,f,e,g){var j=[];c(a,b,f,e,g,function(b){j.push(b)});return j}}});"use strict";base.requireStylesheet("tracks.slice_track");base.require("tracks.canvas_based_track");base.require("sorted_array_utils");base.require("fast_rect_renderer");base.require("color_scheme");base.require("ui");
base.exportTo("tracing.tracks",function(){function d(){}function c(b,a){this.string=b;this.width=a}var a=tracing.getColorPalette(),b=tracing.ui.define(tracing.tracks.CanvasBasedTrack);b.prototype={__proto__:tracing.tracks.CanvasBasedTrack.prototype,SHOULD_ELIDE_TEXT:!0,decorate:function(){this.classList.add("slice-track");this.elidedTitleCache=new d;this.asyncStyle_=!1},decorateHit:function(){},get asyncStyle(){return this.asyncStyle_},set asyncStyle(b){this.asyncStyle_=!!b;this.invalidate()},get slices(){return this.slices_},
set slices(b){this.slices_=b||[];b||(this.visible=!1);this.invalidate()},get height(){return window.getComputedStyle(this).height},set height(b){this.style.height=b;this.invalidate()},labelWidth:function(b){var a=e[b];a||(a=this.ctx_.measureText(b).width,e[b]=a);return a+2},labelWidthWorld:function(b,a){return this.labelWidth(b)*a},redraw:function(){var b=this.ctx_,e=this.canvas_.width,g=this.canvas_.height;b.clearRect(0,0,e,g);var c=this.viewport_,d=c.xViewVectorToWorld(1),m=c.xViewToWorld(0),e=
-c.xViewToWorld(e);c.drawUnderContent(b,m,e,g);b.save();c.applyTransformToCanvas(b);this.asyncStyle_&&(b.globalAlpha=0.25);var q=new tracing.FastRectRenderer(b,2*d,2*d,a);q.setYandH(0,g);for(var p=this.slices_,r=tracing.findLowIndexInSortedArray(p,function(b){return b.start+b.duration},m),u=r;u<p.length;++u){var s=p[u],v=s.start;if(v>e)break;var w=Math.max(s.duration,0.001),x=s.selected?s.colorId+f:s.colorId;w<d&&(w=d);0<s.duration?q.fillRect(v,w,x):0.001<d?q.fillRect(v,d,x):(b.fillStyle=a[x],b.beginPath(),
-b.moveTo(v-4*d,g),b.lineTo(v,0),b.lineTo(v+4*d,g),b.closePath(),b.fill())}q.flush();b.restore();q=window.devicePixelRatio||1;if(8<g){b.textAlign="center";b.textBaseline="top";b.font=10*q+"px sans-serif";b.strokeStyle="rgb(0,0,0)";b.fillStyle="rgb(0,0,0)";v=20*d;w=this.SHOULD_ELIDE_TEXT;for(u=r;u<p.length;++u){s=p[u];if(s.start>e)break;s.duration>v&&(r=s.title,s.didNotFinish&&(r+=" (Did Not Finish)"),x=this.labelWidth(r),w&&this.labelWidthWorld(r,d)>s.duration&&(x=this.elidedTitleCache.get(this,d,
+c.xViewToWorld(e);c.drawUnderContent(b,m,e,g);b.save();c.applyTransformToCanvas(b);this.asyncStyle_&&(b.globalAlpha=0.25);var q=new tracing.FastRectRenderer(b,2*d,2*d,a);q.setYandH(0,g);for(var p=this.slices_,r=tracing.findLowIndexInSortedArray(p,function(b){return b.start+b.duration},m),u=r;u<p.length;++u){var s=p[u],w=s.start;if(w>e)break;var v=Math.max(s.duration,0.001),x=s.selected?s.colorId+f:s.colorId;v<d&&(v=d);0<s.duration?q.fillRect(w,v,x):0.001<d?q.fillRect(w,d,x):(b.fillStyle=a[x],b.beginPath(),
+b.moveTo(w-4*d,g),b.lineTo(w,0),b.lineTo(w+4*d,g),b.closePath(),b.fill())}q.flush();b.restore();q=window.devicePixelRatio||1;if(8<g){b.textAlign="center";b.textBaseline="top";b.font=10*q+"px sans-serif";b.strokeStyle="rgb(0,0,0)";b.fillStyle="rgb(0,0,0)";w=20*d;v=this.SHOULD_ELIDE_TEXT;for(u=r;u<p.length;++u){s=p[u];if(s.start>e)break;s.duration>w&&(r=s.title,s.didNotFinish&&(r+=" (Did Not Finish)"),x=this.labelWidth(r),v&&this.labelWidthWorld(r,d)>s.duration&&(x=this.elidedTitleCache.get(this,d,
r,x,s.duration),r=x.string,x=x.width),x*d<s.duration&&(s=c.xWorldToView(s.start+0.5*s.duration),b.fillText(r,s,2.5*q,x)))}}c.drawOverContent(b,m,e,g)},addIntersectingItemsToSelection:function(b,a,f){var e=this.getBoundingClientRect();if(a<e.top||a>=e.bottom)return!1;b=this.viewport_.xViewVectorToWorld(b*devicePixelRatio);b=tracing.findLowIndexInSortedIntervals(this.slices_,function(b){return b.start},function(b){return b.duration},b);return 0<=b&&b<this.slices_.length?(f=f.addSlice(this,this.slices_[b]),
this.decorateHit(f),!0):!1},addIntersectingItemsInRangeToSelection:function(b,a,f,e,g){function c(b){b=g.addSlice(p,b);p.decorateHit(b)}var d=window.devicePixelRatio||1;b=this.viewport_.xViewToWorld(b*d);a=this.viewport_.xViewToWorld(a*d);d=this.getBoundingClientRect();f=Math.max(f,d.top);e=Math.min(e,d.bottom);if(!(f>e)){var p=this;tracing.iterateOverIntersectingIntervals(this.slices_,function(b){return b.start},function(b){return b.duration},b,a,c)}},indexOfSlice_:function(b){for(var a=tracing.findLowIndexInSortedArray(this.slices_,
function(b){return b.start},b.start);a<this.slices_.length&&b.start==this.slices_[a].start&&b.colorId!=this.slices_[a].colorId;)a++;return a<this.slices_.length?a:void 0},addItemNearToProvidedHitToSelection:function(b,a,f){if(!b.slice)return!1;b=this.indexOfSlice_(b.slice);if(void 0===b)return!1;a=b+a;if(0>a||a>=this.slices_.length)return!1;b=f.addSlice(this,this.slices_[a]);this.decorateHit(b);return!0},addAllObjectsMatchingFilterToSelection:function(b,a){for(var f=0;f<this.slices_.length;++f)if(b.matchSlice(this.slices_[f])){var e=
@@ -112,10 +112,10 @@ this.updateChildTracks_():this.visible=!1},updateChildTracks_:function(){this.de
return{CpuTrack:d}});"use strict";base.requireStylesheet("tracks.counter_track");base.require("tracks.canvas_based_track");base.require("color_scheme");base.require("ui");
base.exportTo("tracing.tracks",function(){var d=tracing.getColorPalette(),c=tracing.ui.define(tracing.tracks.CanvasBasedTrack);c.prototype={__proto__:tracing.tracks.CanvasBasedTrack.prototype,decorate:function(){this.classList.add("counter-track");this.addControlButtonElements_(!1);this.selectedSamples_={};this.categoryFilter_=new tracing.Filter},decorateHit:function(){},get counter(){return this.counter_},set counter(a){this.counter_=a;this.invalidate();this.updateVisibility_()},set categoryFilter(a){this.categoryFilter_=
a;this.updateVisibility_()},get selectedSamples(){return this.selectedSamples_},updateVisibility_:function(){this.visible=this.counter_&&this.categoryFilter_.matchCounter(this.counter_)},redraw:function(){var a=this.counter_,b=this.ctx_,f=this.canvas_.width,e=this.canvas_.height;b.clearRect(0,0,f,e);var c=this.viewport_,j=c.xViewVectorToWorld(1),h=c.xViewToWorld(0),f=c.xViewToWorld(f);c.drawUnderContent(b,h,f,e);var k=c.xViewVectorToWorld(1);b.save();c.applyTransformToCanvas(b);for(var l=a.numSeries,
-t=a.numSamples,m=tracing.findLowIndexInSortedArray(a.timestamps,function(b){return b},h),m=0<m-1?m-1:0,q=e/a.maxTotal,p=a.numSeries-1;0<=p;p--){b.fillStyle=d[a.seriesColors[p]];b.beginPath();for(var r=m-1,u=0<=r?a.timestamps[r]-k:-1,s=e,v=!1;;){var w=r+1;if(w>=t){b.lineTo(u,s);b.lineTo(u+8*j,s);b.lineTo(u+8*j,e);break}var x=a.timestamps[w],r=a.totals[w*l+p],y=e-q*r;if(x>f){b.lineTo(x,s);b.lineTo(x,e);break}x-u<k?r=w:(v||(b.moveTo(h,e),v=!0),b.lineTo(x,s),b.lineTo(x,y),r=w,u=x,s=y)}b.closePath();b.fill()}b.fillStyle=
-"rgba(255, 0, 0, 1)";for(w in this.selectedSamples_)if(this.selectedSamples_[w]){x=a.timestamps[w];for(p=a.numSeries-1;0<=p;p--)r=a.totals[w*l+p],y=e-q*r,b.fillRect(x-j,y-1,3*j,3)}b.restore();c.drawOverContent(b,h,f,e)},addIntersectingItemsToSelection:function(a,b,f){var e=this.getBoundingClientRect();if(b<e.top||b>=e.bottom)return!1;b=this.viewport_.xViewVectorToWorld(a*devicePixelRatio);e=this.counter_;if(a<this.counter_.timestamps[0])return!1;a=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},
-b);if(0>a||a>=e.timestamps.length)return!1;0<a&&b>this.counter_.timestamps[a-1]&&a--;this.getBoundingClientRect();f=f.addCounterSample(this,this.counter,a);this.decorateHit(f);return!0},addIntersectingItemsInRangeToSelection:function(a,b,f,e,c){var d=this.getBoundingClientRect();f=Math.max(f,d.top);e=Math.min(e,d.bottom);if(!(f>e)){e=this.counter_;d=window.devicePixelRatio||1;a=this.viewport_.xViewToWorld(a*d);d=this.viewport_.xViewToWorld(b*d);f=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},
-a);b=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},d);0<f&&a>e.timestamps[f-1]&&f--;0<b&&d>e.timestamps[b-1]&&b--;for(a=f;a<=b;a++)a>=e.timestamps.length||(d=c.addCounterSample(this,this.counter,a),this.decorateHit(d))}},addAllObjectsMatchingFilterToSelection:function(){}};return{CounterTrack:c}});"use strict";base.require("tracks.container_track");base.require("sorted_array_utils");base.require("ui");
+t=a.numSamples,m=tracing.findLowIndexInSortedArray(a.timestamps,function(b){return b},h),m=0<m-1?m-1:0,q=e/a.maxTotal,p=a.numSeries-1;0<=p;p--){b.fillStyle=d[a.seriesColors[p]];b.beginPath();for(var r=m-1,u=0<=r?a.timestamps[r]-k:-1,s=e,w=!1;;){var v=r+1;if(v>=t){b.lineTo(u,s);b.lineTo(u+8*j,s);b.lineTo(u+8*j,e);break}var x=a.timestamps[v],y=a.totals[v*l+p],y=e-q*y;if(x>f){b.lineTo(x,s);b.lineTo(x,e);break}if(v+1<t&&(r=a.timestamps[v+1],r-u<=k&&r<f)){r=v;continue}w||(b.moveTo(h,e),w=!0);x-u<k&&(x=
+u+k);b.lineTo(x,s);b.lineTo(x,y);r=v;u=x;s=y}b.closePath();b.fill()}b.fillStyle="rgba(255, 0, 0, 1)";for(v in this.selectedSamples_)if(this.selectedSamples_[v]){x=a.timestamps[v];for(p=a.numSeries-1;0<=p;p--)y=a.totals[v*l+p],y=e-q*y,b.fillRect(x-j,y-1,3*j,3)}b.restore();c.drawOverContent(b,h,f,e)},addIntersectingItemsToSelection:function(a,b,f){var e=this.getBoundingClientRect();if(b<e.top||b>=e.bottom)return!1;b=this.viewport_.xViewVectorToWorld(a*devicePixelRatio);e=this.counter_;if(a<this.counter_.timestamps[0])return!1;
+a=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},b);if(0>a||a>=e.timestamps.length)return!1;0<a&&b>this.counter_.timestamps[a-1]&&a--;this.getBoundingClientRect();f=f.addCounterSample(this,this.counter,a);this.decorateHit(f);return!0},addIntersectingItemsInRangeToSelection:function(a,b,f,e,c){var d=this.getBoundingClientRect();f=Math.max(f,d.top);e=Math.min(e,d.bottom);if(!(f>e)){e=this.counter_;d=window.devicePixelRatio||1;a=this.viewport_.xViewToWorld(a*d);d=this.viewport_.xViewToWorld(b*
+d);f=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},a);b=tracing.findLowIndexInSortedArray(e.timestamps,function(b){return b},d);0<f&&a>e.timestamps[f-1]&&f--;0<b&&d>e.timestamps[b-1]&&b--;for(a=f;a<=b;a++)a>=e.timestamps.length||(d=c.addCounterSample(this,this.counter,a),this.decorateHit(d))}},addAllObjectsMatchingFilterToSelection:function(){}};return{CounterTrack:c}});"use strict";base.require("tracks.container_track");base.require("sorted_array_utils");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("slice-group-track")},get group(){return this.group_},set group(c){this.group_=c;this.updateChildTracks_()},set heading(c){this.tracks_.length&&(this.tracks_[0].heading=c)},set tooltip(c){this.tracks_.length&&(this.tracks_[0].tooltip=c)},set decorateHit(c){this.decorateHit_=c;this.updateChildTracks_()},
applyCategoryFilter_:function(){this.updateChildTracks_()},addSliceTrack_:function(c){var a=new tracing.tracks.SliceTrack;a.slices=c;a.decorateHit=this.decorateHit_;this.addTrack_(a);return a},updateChildTracks_:function(){if(this.group_){var c=tracing.filterSliceArray(this.categoryFilter,this.group_.slices);if(c.length){if(this.visible=!0,!this.areArrayContentsSame_(this.filteredSlices_,c)){this.filteredSlices_=c;this.detach();this.subRows_=this.buildSubRows_(c);for(c=0;c<this.subRows_.length;c++)this.subRows_[c].length&&
this.addSliceTrack_(this.subRows_[c])}}else this.visible=!1}else this.visible=!1},buildSubRows_:function(c){if(!c.length)return[];for(var a=[],b=0;b<c.length;b++)c[b].subSlices&&c[b].subSlices.splice(0,c[b].subSlices.length),a.push(b);a.sort(function(b,a){var f=c[b],e=c[a];return f.start!=e.start?f.start-e.start:a-b});var f=[[]];this.badSlices_=[];for(b=0;b<a.length;b++){for(var e=c[a[b]],g=!1,d=f.length-1;0<=d;d--)if(0!=f[d].length){var h=f[d][f[d].length-1];e.start<h.start&&(this.badSlices_.push(e),
@@ -139,7 +139,7 @@ base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks
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,t=Math.sqrt(k*k+l*l),m=(t-10)/t;b+=m*k;f+=m*l;l=l/t*d;d*=-(k/t);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("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 t=window.devicePixelRatio||1,m=150*t,l=e.xViewVectorToWorld(m),q,p,r;p=Math.pow(10,Math.ceil(Math.log(l)/c));t=[10,5,2,1];for(l=0;l<t.length;++l)if(!(e.xWorldVectorToView(p/t[l])<m)){q=p/t[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 u=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";t=window.devicePixelRatio||1;a.font=9*t+"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*t,0);a.beginPath();a.moveTo(s,0);a.lineTo(s,k);for(l=1;5>l;++l){var v=Math.floor(s+u*l);a.moveTo(v,k-f);a.lineTo(v,k)}a.stroke()}if(h){a.moveTo(0,k);a.lineTo(b,k);a.stroke();b=e.markers.slice();
+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";t=window.devicePixelRatio||1;a.font=9*t+"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*t,0);a.beginPath();a.moveTo(s,0);a.lineTo(s,k);for(l=1;5>l;++l){var w=Math.floor(s+u*l);a.moveTo(w,k-f);a.lineTo(w,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++)t=b[l+1],r=b[l],u=t.positionWorld-r.positionWorld,q=e.xWorldVectorToView(u),h=e.xWorldToView(r.positionWorld+u/2),100>u?(m="ms",p=1):(m="s",p=1E3),p=u/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+u/2-f/2,s=g+f,u=k,f=e.xWorldToView(g),g=e.xWorldToView(s),r=e.xWorldToView(r.positionWorld),t=e.xWorldToView(t.positionWorld),s=!1,
p<=q&&(a.fillStyle="rgb(0,0,0)",a.fillText(m,f,u),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,t,d,3,"rgb(128,121,121)"))}},addIntersectingItemsToSelection:function(){},addIntersectingItemsInRangeToSelection:function(){},addAllObjectsMatchingFilterToSelection:function(){}};return{RulerTrack:d}});"use strict";base.requireStylesheet("timeline_track_view");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");
@@ -165,9 +165,9 @@ this.dragBeginEvent_.clientX,this.dragBoxXEnd_=b.clientX,this.dragBoxYStart_=thi
(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{TimelineTrackView: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,t=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 u=Number.MAX_VALUE,s=-Number.MAX_VALUE,v=Number.MAX_VALUE,
-w=-Number.MAX_VALUE;for(k=0;k<p.slices.length;k++)r+=p.slices[k].duration,u=Math.min(p.slices[k].start,u),s=Math.max(p.slices[k].start,s),v=Math.min(p.slices[k].duration,v),w=Math.max(p.slices[k].duration,w);d+=r;0==p.slices.length&&(k=0);k=r/p.slices.length;v={min:v,max:w,avg:k,avg_stddev:void 0,frequency:void 0,frequency_stddev:void 0};for(k=w=0;k<p.slices.length;k++)var x=v.avg-p.slices[k].duration,w=w+x*x;v.avg_stddev=Math.sqrt(w/(p.slices.length-1));k=s-u;if(2<p.slices.length&&0<k){u=p.slices.length-
-1;v.frequency=1E3*u/k;w=0;for(k=1;k<p.slices.length;k++)x=v.frequency-1E3/(p.slices[k].start-p.slices[k-1].start),w+=x*x;v.frequency_stddev=Math.sqrt(w/(u-1))}b.appendDataRow(h,q,r,p.slices.length,v)}b.appendDataRow(h,"*Totals",d,e.length);b.appendSpacingRow(h);b.appendSummaryRowTime(h,"Selection start",l);b.appendSummaryRowTime(h,"Selection extent",t-l)}if(1==c.length){var h=c[0],e=h.counter,y=h.sampleIndex,c=[];for(k=0;k<e.numSeries;++k)c.push(e.samples[e.numSeries*y+k]);h=b.appendTable("analysis-counter-table",
+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,t=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 u=Number.MAX_VALUE,s=-Number.MAX_VALUE,w=Number.MAX_VALUE,
+v=-Number.MAX_VALUE;for(k=0;k<p.slices.length;k++)r+=p.slices[k].duration,u=Math.min(p.slices[k].start,u),s=Math.max(p.slices[k].start,s),w=Math.min(p.slices[k].duration,w),v=Math.max(p.slices[k].duration,v);d+=r;0==p.slices.length&&(k=0);k=r/p.slices.length;w={min:w,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=w.avg-p.slices[k].duration,v=v+x*x;w.avg_stddev=Math.sqrt(v/(p.slices.length-1));k=s-u;if(2<p.slices.length&&0<k){u=p.slices.length-
+1;w.frequency=1E3*u/k;v=0;for(k=1;k<p.slices.length;k++)x=w.frequency-1E3/(p.slices[k].start-p.slices[k-1].start),v+=x*x;w.frequency_stddev=Math.sqrt(v/(u-1))}b.appendDataRow(h,q,r,p.slices.length,w)}b.appendDataRow(h,"*Totals",d,e.length);b.appendSpacingRow(h);b.appendSummaryRowTime(h,"Selection start",l);b.appendSummaryRowTime(h,"Selection extent",t-l)}if(1==c.length){var h=c[0],e=h.counter,y=h.sampleIndex,c=[];for(k=0;k<e.numSeries;++k)c.push(e.samples[e.numSeries*y+k]);h=b.appendTable("analysis-counter-table",
2);b.appendTableHeader(h,"Selected counter:");b.appendSummaryRow(h,"Title",e.name);b.appendSummaryRowTime(h,"Timestamp",e.timestamps[y]);for(k=0;k<e.numSeries;k++)b.appendSummaryRow(h,e.seriesNames[k],c[k])}else if(1<c.length){q={};for(k=0;k<c.length;k++)e=c[k].counter,q[e.guid]||(q[e.guid]=[]),q[e.guid].push(c[k]);h=b.appendTable("analysis-counter-table",7);b.appendTableHeader(h,"Counters:");for(y in q){c=q[y];e=c[0].counter;l=[];for(k=0;k<c.length;k++)l.push(c[k].sampleIndex);c=e.getSampleStatistics(l);
for(k=0;k<c.length;k++)b.appendDataRow(h,e.name+": "+e.seriesNames[k],void 0,void 0,c[k])}}}var c=tracing.ui.define("div");c.prototype={__proto__:HTMLDivElement.prototype,decorate:function(){},appendElement_:function(b,a,e){a=b.ownerDocument.createElement(a);b.appendChild(a);void 0!=e&&(a.textContent=e);return a},appendText_:function(b,a){b.ownerDocument.createTextNode(a);b.appendChild(textNode);return textNode},appendTableCell_:function(b,a,e,c){a=this.appendElement_(a,"td",c);a.className=b.className+
"-col-"+e;return a},appendTableCellWithTooltip_:function(b,a,e,c,d){if(d)return a=this.appendElement_(a,"td"),a.className=b.className+"-col-"+e,b=this.appendElement_(a,"span",c),b.className="tooltip",b.title=d,a;this.appendTableCell_(b,a,e,c)},appendTable:function(b,a){var e=this.appendElement_(this,"table");e.className=b+" analysis-table";e.numColumns=a;return e},appendTableHeader:function(b,a){var e=this.appendElement_(b,"tr");this.appendElement_(e,"th",a).className="analysis-table-header"},appendSummaryRow:function(b,
@@ -184,8 +184,9 @@ this.visible=!1;this.defaultClickShouldClose=!0;this.autoClose=!1;this.additiona
!1;a.preventDefault();break}},onDocumentClick:function(a){if(this.defaultClickShouldClose){for(var b=a.target;null!==b;){if(b===this)return;b=b.parentNode}this.visible=!1;a.preventDefault()}}};base.defineProperty(c,"visible",base.PropertyKind.BOOL_ATTR,c.prototype.onVisibleChanged_);base.defineProperty(c,"defaultClickShouldClose",base.PropertyKind.BOOL_ATTR);return{Overlay:c}});"use strict";base.require("filter");base.require("overlay");
base.exportTo("tracing",function(){var d=tracing.ui.define("div");d.prototype={__proto__:tracing.ui.Overlay.prototype,decorate:function(){tracing.ui.Overlay.prototype.decorate.call(this);this.className="view-category-filter-overlay";this.autoClose=!0;var c=document.createElement("div");c.className="category-filter-dialog";c.textContent="Select active categories:";this.formEl_=document.createElement("form");this.formEl_.className="category-filter-dialog-form";c.appendChild(this.formEl_);this.appendChild(c);
this.categoriesEl_=document.createElement("div");this.categoriesEl_.className="categories";this.formEl_.appendChild(this.categoriesEl_);this.addEventListener("visibleChange",this.onVisibleChange_.bind(this));this.isCheckedCallback_=this.onChangeCallback_=void 0},set categories(c){this.categories_=c},set settings_key(c){this.settings_key_=c},set settings(c){this.settings_=c},set settingUpdatedCallback(c){this.settingUpdatedCallback_=c},selectedCategories:function(){for(var c=this.categoriesEl_.querySelectorAll("input"),
-a=c.length,b=[],f=0;f<a;++f){var e=c[f];e.checked&&b.push(e.value)}return b},onVisibleChange_:function(){this.visible&&this.updateForm_()},updateForm_:function(){this.categoriesEl_.innerHTML="";for(var c={},a=this.categories_.concat(this.settings_.keys(this.settings_key_)),b=a.length,f=0;f<b;++f)c[a[f]]=!0;var a=[],e;for(e in c)a.push(e);a=a.sort();for(f=0;f<a.length;f++)e=a[f],c=document.createElement("input"),c.type="checkbox",c.id=c.value=e,c.checked="true"===this.settings_.get(e,"true",this.settings_key_),
-c.onchange=this.updateSetting_.bind(this),b=document.createElement("label"),b.textContent=e,b.setAttribute("for",e),e=document.createElement("div"),e.appendChild(c),e.appendChild(b),this.categoriesEl_.appendChild(e)},updateSetting_:function(c){c=c.target;this.settings_.set(c.value,c.checked,this.settings_key_);void 0!==this.settingUpdatedCallback_&&this.settingUpdatedCallback_()}};return{CategoryFilterDialog:d}});"use strict";base.require("timeline_track_view");base.require("filter");base.require("overlay");
+a=c.length,b=[],f=0;f<a;++f){var e=c[f];e.checked&&b.push(e.value)}return b},unselectedCategories:function(){for(var c=this.categoriesEl_.querySelectorAll("input"),a=c.length,b=[],f=0;f<a;++f){var e=c[f];e.checked||b.push(e.value)}return b},onVisibleChange_:function(){this.visible&&this.updateForm_()},updateForm_:function(){this.categoriesEl_.innerHTML="";for(var c={},a=this.categories_.concat(this.settings_.keys(this.settings_key_)),b=a.length,f=0;f<b;++f)c[a[f]]=!0;var a=[],e;for(e in c)a.push(e);
+a=a.sort();for(f=0;f<a.length;f++)e=a[f],c=document.createElement("input"),c.type="checkbox",c.id=c.value=e,c.checked="true"===this.settings_.get(e,"true",this.settings_key_),c.onchange=this.updateSetting_.bind(this),b=document.createElement("label"),b.textContent=e,b.setAttribute("for",e),e=document.createElement("div"),e.appendChild(c),e.appendChild(b),this.categoriesEl_.appendChild(e)},updateSetting_:function(c){c=c.target;this.settings_.set(c.value,c.checked,this.settings_key_);void 0!==this.settingUpdatedCallback_&&
+this.settingUpdatedCallback_()}};return{CategoryFilterDialog:d}});"use strict";base.require("timeline_track_view");base.require("filter");base.require("overlay");
base.exportTo("tracing",function(){function d(){this.model_=this.timeline_=void 0;this.filterText_="";this.filterHits_=new tracing.Selection;this.filterHitsDirty_=!0;this.currentHitIndex_=0}var c=tracing.ui.define("div");c.prototype={__proto__:tracing.ui.Overlay.prototype,decorate:function(){tracing.ui.Overlay.prototype.decorate.call(this);this.className="find-control";this.hitCountEl_=document.createElement("div");this.hitCountEl_.className="hit-count-label";this.hitCountEl_.textContent="1 of 7";
var a=document.createElement("div");a.className="button find-previous";a.textContent="\u2190";a.addEventListener("click",function(){this.controller.findPrevious();this.updateHitCountEl_()}.bind(this));var b=document.createElement("div");b.className="button find-next";b.textContent="\u2192";b.addEventListener("click",function(){this.controller.findNext();this.updateHitCountEl_()}.bind(this));this.filterEl_=document.createElement("input");this.filterEl_.type="input";this.filterEl_.addEventListener("input",
function(){this.controller.filterText=this.filterEl_.value;this.updateHitCountEl_()}.bind(this));this.filterEl_.addEventListener("keydown",function(a){13==a.keyCode?b.click():27==a.keyCode&&(this.filterEl_.blur(),this.updateHitCountEl_())}.bind(this));this.filterEl_.addEventListener("blur",function(){this.updateHitCountEl_()}.bind(this));this.filterEl_.addEventListener("focus",function(){this.updateHitCountEl_()}.bind(this));this.appendChild(this.filterEl_);this.appendChild(a);this.appendChild(b);
@@ -215,8 +216,8 @@ this.cpufreqSlice(d,a,f.cpu,f);return!0},cpufreqTargetEvent:function(a,f,e,d,j){
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.model.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.model.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,f,c,d){a=/dev (\d+,\d+) ino (\d+) parent (\d+) datasync (\d+)/.exec(d.details);if(!a)return!1;b=a[1];f=parseInt(a[2]);this.openAsyncSlice(c,"ext4",d.threadName,d.pid,b+"-"+f,1==a[4]?"fdatasync":"fsync");return!0},ext4SyncFileExitEvent:function(a,b,f,c,d){f=/dev (\d+,\d+) ino (\d+) ret (\d+)/.exec(d.details);if(!f)return!1;a=f[1];b=parseInt(f[2]);f=parseInt(f[3]);this.closeAsyncSlice(c,"ext4",
-d.threadName,d.pid,a+"-"+b,{device:a,inode:b,error:f});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");
+d.threadName,d.pid,a+"-"+b,{device:a,inode:b,error:f});return!0},blockRqIssueEvent:function(a,b,f,c,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];f=parseInt(j[8]);j=parseInt(j[9]);
+this.openAsyncSlice(c,"block",d.threadName,d.pid,b+"-"+f+"-"+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.model.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,
@@ -291,8 +292,8 @@ base.exportTo("tracing.importer",function(){function d(a){this.cpu=a}function c(
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.model.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(.*)$"),
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 v=f.slice(h,j),j=[];if(b)for(var w=0;w<v.length;w++){var x=
-v[w],x=e(x,"\\n\\");j.push(x)}else j=[v[v.length-1]];v=j[j.length-1];w=e(v,'\\n";');if(w==v)return d;j[j.length-1]=w;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]=
+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 w=f.slice(h,j),j=[];if(b)for(var v=0;v<w.length;v++){var x=
+w[v],x=e(x,"\\n\\");j.push(x)}else j=[w[w.length-1]];w=j[j.length-1];v=e(w,'\\n";');if(v==w)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]=
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 d=[];if(b.length){var e=b[0];if(c.length&&c[0].ts<
@@ -304,11 +305,11 @@ l.args.stateWhenDescheduled;d.push(new tracing.model.Slice("","Running",f,m.star
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,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,u=this.eventHandlers_[j];u?u(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}});
+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,u=this.eventHandlers_[j];u?u(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}});
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 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}});
+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 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,
diff --git a/trace-viewer/src/category_filter_dialog.js b/trace-viewer/src/category_filter_dialog.js
index 45732c2d..f8dede2f 100644
--- a/trace-viewer/src/category_filter_dialog.js
+++ b/trace-viewer/src/category_filter_dialog.js
@@ -71,6 +71,19 @@ base.exportTo('tracing', function() {
return categories;
},
+ unselectedCategories: function() {
+ var inputs = this.categoriesEl_.querySelectorAll('input');
+ var inputs_length = inputs.length;
+ var categories = [];
+ for (var i = 0; i < inputs_length; ++i) {
+ var input = inputs[i];
+ if (input.checked)
+ continue;
+ categories.push(input.value);
+ }
+ return categories;
+ },
+
onVisibleChange_: function() {
if (this.visible) {
this.updateForm_();
diff --git a/trace-viewer/src/profiling_view.js b/trace-viewer/src/profiling_view.js
index 24d79e2d..2d7efa21 100644
--- a/trace-viewer/src/profiling_view.js
+++ b/trace-viewer/src/profiling_view.js
@@ -144,8 +144,18 @@ base.exportTo('tracing', function() {
buttonEl.className = 'record-categories';
buttonEl.onclick = this.onRecord_.bind(this);
+ var categories = event.categories;
+ var categories_length = categories.length;
+ // Do not allow categories with ,'s in their name.
+ for (var i = 0; i < categories_length; ++i) {
+ var split = categories[i].split(',');
+ categories[i] = split.shift();
+ if (split.length > 0)
+ categories = categories.concat(split);
+ }
+
var dlg = new tracing.CategoryFilterDialog();
- dlg.categories = event.categories;
+ dlg.categories = categories;
dlg.settings = this.timelineView_.settings;
dlg.settings_key = 'record_categories';
dlg.appendChild(buttonEl);
@@ -164,8 +174,19 @@ base.exportTo('tracing', function() {
var tc = this.tracingController_;
this.categorySelectionDialog_.visible = false;
- var categories =
- this.categorySelectionDialog_.selectedCategories().join(',');
+ var categories = this.categorySelectionDialog_.unselectedCategories();
+ var categories_length = categories.length;
+
+ var negated_categories = [];
+ for (var i = 0; i < categories_length; ++i) {
+ // Skip any category with a , as it will cause issues when we negate.
+ // Both sides should have been added as separate categories, these can
+ // only come from settings.
+ if (categories[i].match(/,/))
+ continue;
+ negated_categories.push('-' + categories[i]);
+ }
+ categories = negated_categories.join(',');
tc.beginTracing(this.systemTracingBn_.checked,
this.continuousTracingBn_.checked,
diff --git a/trace-viewer/src/profiling_view_test.html b/trace-viewer/src/profiling_view_test.html
index 1c820909..bc7a2caa 100644
--- a/trace-viewer/src/profiling_view_test.html
+++ b/trace-viewer/src/profiling_view_test.html
@@ -175,13 +175,42 @@ found in the LICENSE file.
e.categories = ['skia', 'gpu', 'cc', 'renderer'];
tracingController.dispatchEvent(e);
+ view.categorySelectionDialog_.querySelector('input#skia').click();
view.categorySelectionDialog_.querySelector(
'button.record-categories').click();
var categories = tracingController.beginTracingCategories;
- // cc is selected by settings, gpu and skia are set by default since
- // they aren't in settings. renderer is not there as it's off in settings.
- assertEquals('cc,gpu,skia', categories);
+ // Renderer is disabled in settings, skia is clicked off.
+ assertEquals('-renderer,-skia', categories);
+ }
+
+ function testBadCategories() {
+ var view = new tracing.ProfilingView();
+ view.timelineView_.settings.set('foo,bar', 'false', 'record_categories');
+
+ var tracingController = new FakeTracingController();
+ view.tracingController = tracingController;
+
+ view.querySelector('button.record').click();
+ assertTrue(tracingController.wasCollectCategoriesCalled);
+
+ var e = new base.Event('categoriesCollected');
+ e.categories = ['baz,zap', 'gpu'];
+ tracingController.dispatchEvent(e);
+
+ view.categorySelectionDialog_.querySelector(
+ 'button.record-categories').click();
+
+ var inputs = view.categorySelectionDialog_.querySelectorAll('input');
+ var inputs_length = inputs.length;
+ for (var i = 0; i < inputs_length; ++i) {
+ // Comes from categories and should be split before getting
+ // to the category selection dialog.
+ assertNotEquals('baz,zap', inputs[i].id);
+ }
+
+ var categories = tracingController.beginTracingCategories;
+ assertEquals('', categories);
}
function testRecordNonCros() {
diff --git a/trace-viewer/src/tracks/counter_track.js b/trace-viewer/src/tracks/counter_track.js
index a148f017..73e4918e 100644
--- a/trace-viewer/src/tracks/counter_track.js
+++ b/trace-viewer/src/tracks/counter_track.js
@@ -145,15 +145,25 @@ base.exportTo('tracing.tracks', function() {
break;
}
- if (x - xLast < skipDistanceWorld) {
- iLast = i;
- continue;
+ if (i + 1 < numSamples) {
+ var xNext = ctr.timestamps[i + 1];
+ if (xNext - xLast <= skipDistanceWorld && xNext < viewRWorld) {
+ iLast = i;
+ continue;
+ }
}
if (!hasMoved) {
ctx.moveTo(viewLWorld, canvasH);
hasMoved = true;
}
+ if (x - xLast < skipDistanceWorld) {
+ // We know that xNext > xLast + skipDistanceWorld, so we can
+ // safely move this sample's x over that much without passing
+ // xNext. This ensure that the previous sample is visible when
+ // zoomed out very far.
+ x = xLast + skipDistanceWorld;
+ }
ctx.lineTo(x, yLastView);
ctx.lineTo(x, yView);
iLast = i;