Home | History | Annotate | Download | only in chromium-trace

Lines Matching refs:slices

66 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_},
67 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=
75 base.exportTo("tracing.model",function(){function d(a){this.sliceConstructor=a||c;this.openPartialSlices_=[];this.slices=[];this.bounds=new base.Range}var c=tracing.model.Slice;d.prototype={__proto__:Object.prototype,get length(){return this.slices.length},pushSlice:function(a){this.slices.push(a);return a},pushSlices:function(a){this.slices.push.apply(this.slices,a)},beginSlice:function(a,b,f,e){if(this.openPartialSlices_.length&&f<this.openPartialSlices_[this.openPartialSlices_.length-1].start)throw Error("Slices must be added in increasing timestamp order");
77 1,1);if(a<b.start)throw Error("Slice "+b.title+" end time is before its start.");b.duration=a-b.start;this.pushSlice(b);return b},autoCloseOpenSlices:function(a){a||(this.updateBounds(),a=this.bounds.max);for(;0<this.openSliceCount;)this.endSlice(a).didNotFinish=!0},shiftTimestampsForward:function(a){for(var b=0;b<this.slices.length;b++){var f=this.slices[b];f.start+=a}for(b=0;b<this.openPartialSlices_.length;b++)f=this.openPartialSlices_[i],f.start+=a},updateBounds:function(){this.bounds.reset();
78 for(var a=0;a<this.slices.length;a++)this.bounds.addValue(this.slices[a].start),this.bounds.addValue(this.slices[a].end);this.openPartialSlices_.length&&(this.bounds.addValue(this.openPartialSlices_[0].start),this.bounds.addValue(this.openPartialSlices_[this.openPartialSlices_.length-1].start))},copySlice:function(a){var b=new this.sliceConstructor(a.category,a.title,a.colorId,a.start,a.args,a.duration);b.didNotFinish=a.didNotFinish;return b}};d.merge=function(a,b){if(0<a.openPartialSlices_.length)throw Error("groupA has open partial slices");
79 if(0<b.openPartialSlices_.length)throw Error("groupB has open partial slices");for(var f=new d,e=a.slices,g=b.slices,c=e.length-1,h=g.length-1,k=[],l=[],t=function(b){for(var a=0;a<l.length;a++){var e=l[a],g=e.end;if(b<e.start||g<b)throw Error("slice should not be split");var c=f.copySlice(e);e.start=b;e.duration=g-b;e.title+=" (cont.)";c.duration=b-c.start;l[a]=c;f.pushSlice(c)}},m=function(b){for(;0<k.length||0<l.length;){var a=k[k.length-1],f=l[l.length-1],a=a&&a.start,f=f&&f.start;if((void 0===
80 a||a<b)&&(void 0===f||f<b))break;void 0===f||a>f?(t(a),k.pop()):l.pop()}};0<=c||0<=h;){var q=e[c],p=g[h];void 0===q||void 0!==p&&q.end<p.end?(q=f.copySlice(p),p=!0,h--):(q=f.copySlice(q),p=!1,c--);m(q.end);f.pushSlice(q);p?l.push(q):(t(q.end),k.push(q))}m();f.slices.reverse();return f};return{SliceGroup:d}});"use strict";base.require("range");base.require("model.slice");
81 base.exportTo("tracing.model",function(){function d(b,f,e,g,c){a.call(this,b,f,e,g,c)}function c(){this.slices=[];this.bounds=new base.Range}var a=tracing.model.Slice;d.prototype={__proto__:a.prototype,toJSON:function(){for(var b={},a=Object.keys(this),e=0;e<a.length;e++){var g=a[e];"function"!=typeof this[g]&&(b[g]="startThread"==g||"endThread"==g?this[g].guid:this[g])}return b},id:void 0,startThread:void 0,endThread:void 0,subSlices:void 0};c.prototype={__proto__:Object.prototype,push:function(b){this.slices.push(b)},
82 get length(){return this.slices.length},shiftTimestampsForward:function(b){for(var a=0;a<this.slices.length;a++){var e=this.slices[a];e.start+=b;for(var g=0;g<e.subSlices.length;g++)e.subSlices[g].start+=b}},updateBounds:function(){this.bounds.reset();for(var b=0;b<this.slices.length;b++)this.bounds.addValue(this.slices[b].start),this.bounds.addValue(this.slices[b].end)},computeSubGroups:function(){for(var b={},a=0;a<this.slices.length;++a){var e=this.slices[a],g=e.startThread.guid;b[g]||(b[g]=new c);
83 b[g].slices.push(e)}var a=[],d;for(d in b)e=b[d],e.updateBounds(),a.push(e);return a}};return{AsyncSlice:d,AsyncSliceGroup:c}});"use strict";base.exportTo("tracing.model",function(){function d(c,a,b,f,e){this.category=c||"";this.title=a;this.colorId=b;this.start=f;this.args=e}d.prototype={selected:!1,duration:0,get end(){return this.start}};return{Sample:d}});"use strict";base.require("range");base.require("guid");base.require("model.slice");base.require("model.slice_group");base.require("model.async_slice_group");
87 return b},get samples(){return this.samples_},name:void 0,shiftTimestampsForward:function(a){b.prototype.shiftTimestampsForward.call(this,a);if(this.cpuSlices)for(var f=0;f<this.cpuSlices.length;f++)this.cpuSlices[f].start+=a;if(this.samples_.length)for(f=0;f<this.samples_.length;f++)this.samples_[f].start+=a;this.kernelSlices.shiftTimestampsForward(a);this.asyncSlices.shiftTimestampsForward(a)},get isEmpty(){return this.slices.length||this.openSliceCount||this.cpuSlices&&this.cpuSlices.length||this.kernelSlices.length||
89 1].end))},addCategoriesToDict:function(b){for(var a=0;a<this.slices.length;a++)b[this.slices[a].category]=!0;for(a=0;a<this.kernelSlices.length;a++)b[this.kernelSlices.slices[a].category]=!0;for(a=0;a<this.asyncSlices.length;a++)b[this.asyncSlices.slices[a].category]=!0;for(a=0;a<this.samples_.length;a++)b[this.samples_[a].category]=!0},mergeKernelWithUserland:function(){0<this.kernelSlices.length&&(this.slices=b.merge(this,this.kernelSlices).slices,this.kernelSlices=new b,this.updateBounds())},get userFriendlyName(){return this.parent.userFriendlyName+
100 base.exportTo("tracing.model",function(){function d(a){this.cpuNumber=a;this.slices=[];this.counters={};this.bounds=new base.Range}var c=tracing.model.Counter;d.prototype={getOrCreateCounter:function(a,b){var f;f=a.length?a+"."+b:b;this.counters[f]||(this.counters[f]=new c(this,f,a,b));return this.counters[f]},shiftTimestampsForward:function(a){for(var b=0;b<this.slices.length;b++)this.slices[b].start+=a;for(var f in this.counters)this.counters[f].shiftTimestampsForward(a)},updateBounds:function(){this.bounds.reset();
101 this.slices.length&&(this.bounds.addValue(this.slices[0].start),this.bounds.addValue(this.slices[this.slices.length-1].end));for(var a in this.counters)this.counters[a].updateBounds(),this.bounds.addRange(this.counters[a].bounds)},addCategoriesToDict:function(a){for(var b=0;b<this.slices.length;b++)a[this.slices[b].category]=!0;for(var f in this.counters)a[this.counters[f].category]=!0}};d.compare=function(a,b){return a.cpuNumber-b.cpuNumber};return{Cpu:d}});"use strict";base.require("range");base.require("event_target");
111 this.updateChildTracks_():this.visible=!1},updateChildTracks_:function(){this.detach();if(this.cpu_){var c=tracing.filterSliceArray(this.categoryFilter_,this.cpu_.slices);if(c.length){var a=new tracing.tracks.SliceTrack;a.slices=c;a.heading=this.heading_;a.tooltip=this.tooltip_;this.addTrack_(a)}for(var b in this.cpu_.counters)c=this.cpu_.counters[b],a=new tracing.tracks.CounterTrack,a.heading="CPU "+this.cpu_.cpuNumber+" "+c.name+":",a.counter=c,this.addTrack_(a)}this.addControlButtonElements_(!1)}};
120 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&&
123 base.exportTo("tracing.tracks",function(){var d=tracing.ui.define(tracing.tracks.SliceGroupTrack);d.prototype={__proto__:tracing.tracks.SliceGroupTrack.prototype,decorate:function(){this.classList.add("async-slice-group-track")},addSliceTrack_:function(c){c=tracing.tracks.SliceGroupTrack.prototype.addSliceTrack_.call(this,c);c.asyncStyle=!0;return c},buildSubRows_:function(){var c=tracing.filterSliceArray(this.categoryFilter,this.group_.slices);c.sort(function(b,a){return b.start-a.start});for(var a=
127 c;this.updateChildTracks_()},applyCategoryFilter_:function(){this.updateVisibility_()},updateChildTracks_:function(){this.detach();if(this.thread_){var c=new tracing.tracks.SliceTrack;c.heading="";c.slices=this.thread_.cpuSlices;c.height="4px";c.decorateHit=function(a){a.thread=this.thread_};this.addTrack_(c);c=new tracing.tracks.AsyncSliceGroupTrack;c.categoryFilter=this.categoryFilter;c.decorateHit=function(){};c.group=this.thread_.asyncSlices;this.addTrack_(c);c=new tracing.tracks.SliceGroupTrack;
128 c.decorateHit=function(a){a.thread=this.thread_};c.group=this.thread_;this.addTrack_(c);this.thread_.samples.length&&(c=new tracing.tracks.SliceTrack,c.group=this.thread_,c.slices=this.thread_.samples,c.decorateHit=function(a){a.thread=this.thread_},this.addTrack_(c));this.updateVisibility_()}this.addControlButtonElements_(4<=this.tracks_.length)},updateVisibility_:function(){if(this.categoryFilter.matchThread(this.thread)){for(var c=!1,a=0;a<this.tracks_.length;++a){var b=this.tracks_[a];if(b.visible&&
156 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",
168 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,
169 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-
170 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",
292 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(.*)$"),
298 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=
303 l.args.stateWhenDescheduled;d.push(new tracing.model.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=