Lines Matching refs:slices

149 base.exportTo("tracing.trace_model",function(){function d(a){this.cpuNumber=a;this.slices=[];this.counters={};this.bounds=new base.Range}var b=tracing.trace_model.Counter;d.prototype={getOrCreateCounter:function(a,c){var e;e=a.length?a+"."+c:c;this.counters[e]||(this.counters[e]=new b(this,e,a,c));return this.counters[e]},shiftTimestampsForward:function(a){for(var c=0;c<this.slices.length;c++)this.slices[c].start+=a;for(var b in this.counters)this.counters[b].shiftTimestampsForward(a)},updateBounds:function(){this.bounds.reset();
150 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 c=0;c<this.slices.length;c++)a[this.slices[c].category]=!0;for(var b in this.counters)a[this.counters[b].category]=!0}};d.compare=function(a,c){return a.cpuNumber-c.cpuNumber};return{Cpu:d}});"use strict";
178 base.exportTo("tracing.trace_model",function(){function d(){this.slices=[];this.bounds=new base.Range}d.prototype={__proto__:Object.prototype,push:function(b){this.slices.push(b)},get length(){return this.slices.length},shiftTimestampsForward:function(b){for(var a=0;a<this.slices.length;a++){var c=this.slices[a];c.start+=b;for(var e=0;e<c.subSlices.length;e++)c.subSlices[e].start+=b}},updateBounds:function(){this.bounds.reset();for(var b=0;b<this.slices.length;b++)this.bounds.addValue(this.slices[b].start),
179 this.bounds.addValue(this.slices[b].end)},computeSubGroups:function(){for(var b={},a=0;a<this.slices.length;++a){var c=this.slices[a],e=c.startThread.guid;b[e]||(b[e]=new d);b[e].slices.push(c)}var a=[],f;for(f in b)c=b[f],c.updateBounds(),a.push(c);return a}};return{AsyncSliceGroup:d}});"use strict";base.require("tracing.trace_model.trace_model_event");
181 base.exportTo("tracing.trace_model",function(){function d(a){this.sliceConstructor=a||b;this.openPartialSlices_=[];this.slices=[];this.bounds=new base.Range}var b=tracing.trace_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)},pushInstantEvent:function(a){this.slices.push(a)},beginSlice:function(a,c,b,f){if(this.openPartialSlices_.length&&b<this.openPartialSlices_[this.openPartialSlices_.length-
184 0;c<this.slices.length;c++){var b=this.slices[c];b.start+=a}for(c=0;c<this.openPartialSlices_.length;c++)b=this.openPartialSlices_[i],b.start+=a},updateBounds:function(){this.bounds.reset();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 c=
185 new this.sliceConstructor(a.category,a.title,a.colorId,a.start,a.args,a.duration);c.didNotFinish=a.didNotFinish;return c}};d.merge=function(a,c){if(0<a.openPartialSlices_.length)throw Error("groupA has open partial slices");if(0<c.openPartialSlices_.length)throw Error("groupB has open partial slices");for(var b=new d,f=a.slices,g=c.slices,h=f.length-1,k=g.length-1,l=[],m=[],n=function(a){for(var c=0;c<m.length;c++){var f=m[c],g=f.end;if(a<f.start||g<a)throw Error("slice should not be split");var d=
186 b.copySlice(f);f.start=a;f.duration=g-a;f.title+=" (cont.)";d.duration=a-d.start;m[c]=d;b.pushSlice(d)}},p=function(a){for(;0<l.length||0<m.length;){var c=l[l.length-1],b=m[m.length-1],c=c&&c.start,b=b&&b.start;if((void 0===c||c<a)&&(void 0===b||b<a))break;void 0===b||c>b?(n(c),l.pop()):m.pop()}};0<=h||0<=k;){var q=f[h],s=g[k];void 0===q||void 0!==s&&q.end<s.end?(q=b.copySlice(s),s=!0,k--):(q=b.copySlice(q),s=!1,h--);p(q.end);b.pushSlice(q);s?m.push(q):(n(q.end),l.push(q))}p();b.slices.reverse();
192 this.bounds.addValue(this.cpuSlices[this.cpuSlices.length-1].end));this.samples_.length&&(this.bounds.addValue(this.samples_[0].start),this.bounds.addValue(this.samples_[this.samples_.length-1].end))},addCategoriesToDict:function(a){for(var c=0;c<this.sliceGroup.length;c++)a[this.sliceGroup.slices[c].category]=!0;for(c=0;c<this.kernelSliceGroup.length;c++)a[this.kernelSliceGroup.slices[c].category]=!0;for(c=0;c<this.asyncSliceGroup.length;c++)a[this.asyncSliceGroup.slices[c].category]=!0;for(c=0;c<
193 this.samples_.length;c++)a[this.samples_[c].category]=!0},autoCloseOpenSlices:function(a){this.sliceGroup.autoCloseOpenSlices(a);this.kernelSliceGroup.autoCloseOpenSlices(a)},mergeKernelWithUserland:function(){if(0<this.kernelSliceGroup.length){var a=c.merge(this.sliceGroup,this.kernelSliceGroup);this.sliceGroup.slices=a.slices;this.kernelSliceGroup=new c;this.updateBounds()}},get userFriendlyName(){return this.name||this.tid},get userFriendlyDetails(){return"tid: "+this.tid+(this.name?", name: "+
222 c,b,e,f,d){if(void 0!==this.lastActivePid&&0!=this.lastActivePid){var g=b-this.lastActiveTs;a=(a=a.threadsByLinuxPid[this.lastActivePid])?a.userFriendlyName:this.lastActiveComm;c=new tracing.trace_model.Slice("",a,tracing.getStringColorId(a),this.lastActiveTs,{comm:this.lastActiveComm,tid:this.lastActivePid,prio:this.lastActivePrio,stateWhenDescheduled:c},g);this.cpu.slices.push(c)}this.lastActiveTs=b;this.lastActivePid=e;this.lastActiveComm=f;this.lastActivePrio=d}};var c={},e=/^\s*(.+)-(\d+)\s+\(\s*(\d+|-+)\)\s\[(\d+)\]\s+[dX.][N.][Hhs.][0-9a-f.]\s+(\d+\.\d+):\s+(\S+):\s(.*)$/,
228 importEvents:function(a){this.createParsers();this.importCpuData();this.alignClocks(a)&&(this.buildMapFromLinuxPidsToThreads(),this.buildPerThreadCpuSlicesFromCpuState())},finalizeImport:function(){},joinRefs:function(){},buildPerThreadCpuSlicesFromCpuState:function(){for(var a in this.cpuStates_)for(var c=this.cpuStates_[a].cpu,b=0;b<c.slices.length;b++){var e=c.slices[b],f=this.threadsByLinuxPid[e.args.tid];f&&(f.tempCpuSlices||(f.tempCpuSlices=[]),f.tempCpuSlices.push(e))}for(b in this.wakeups_)if(a=
234 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 c in this.cpuStates_){for(var b=this.cpuStates_[c].cpu,e=0;e<b.slices.length;e++){var f=b.slices[e];f.start+=a;f.duration=f.duration}for(var d in b.counters)for(e=b.counters[d],f=0;f<e.timestamps.length;f++)e.timestamps[f]+=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.");
270 a.args.id)throw Error("args cannot have an id field inside it");b(a.args,c,a,this)},this)},this)},joinObjectRefs_:function(){base.iterItems(this.model_.processes,function(a,c){this.joinObjectRefsForProcess_(c)},this)},joinObjectRefsForProcess_:function(a){var c=[];base.iterItems(a.threads,function(b,f){f.asyncSliceGroup.slices.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"start",b)},this);f.sliceGroup.slices.forEach(function(b){this.searchItemForIDRefs_(c,a.objects,"start",b)},this)},
299 set selected(a){this.objectSnapshot.selected=a},addBoundsToRange:function(a){a.addValue(this.objectSnapshot.ts)}};c.prototype={get modelObject(){return this.objectInstance},get selected(){return this.objectInstance.selected},set selected(a){this.objectInstance.selected=a},addBoundsToRange:function(a){a.addRange(this.objectInstance.bounds)}};var f=[{constructor:d,name:"slice",pluralName:"slices"},{constructor:b,name:"counterSample",pluralName:"counterSamples"},{constructor:a,name:"objectSnapshot",
328 c.args)b.appendSummaryRow(e," "+d,c.args[d])}return{analyzeSingleSliceHit:d,analyzeMultipleSliceHits:function(b,a){var c=a.bounds.min,e=a.bounds.max;a.map(function(a){return a.slice.title});for(var f=0,g={},h=0;h<a.length;h++){var k=a[h].slice;g[k.title]||(g[k.title]={hits:[]},f++);g[k.title].hits.push(a[h])}var l;l=b.appendTable("analysis-slices-table",3);b.appendTableHeader(l,"Slices:");var m=0;base.iterItems(g,function(a,c){for(var e=0,g=0,h=Number.MAX_VALUE,k=-Number.MAX_VALUE,t=Number.MAX_VALUE,
332 base.exportTo("tracing.analysis",function(){function d(a,c){var e=c.slices,f=c.counterSamples,d=new tracing.Selection;d.addSelection(c.objectSnapshots);d.addSelection(c.objectInstances);1==e.length?tracing.analysis.analyzeSingleSliceHit(a,e[0]):1<e.length&&tracing.analysis.analyzeMultipleSliceHits(a,e);1==f.length?tracing.analysis.analyzeSingleCounterSampleHit(a,f[0]):1<f.length&&tracing.analysis.analyzeMultipleCounterSampleHits(a,f);d.length&&b(a,d)}function b(a,c){c=base.asArray(c).sort(base.Range.compareByMinTimes);
416 !!a},get slices(){return this.slices_},set slices(a){this.slices_=a||[]},get height(){return window.getComputedStyle(this).height},set height(a){this.style.height=a},get hasVisibleContent(){return 0<this.slices.length},labelWidth:function(a){var b=this.context(),c=f[a];c||(c=b.measureText(a).width,f[a]=c);return c+2},labelWidthWorld:function(a,b){return this.labelWidth(a)*b},draw:function(a,b,c){switch(a){case tracing.tracks.DrawType.SLICE:this.drawSlices_(b,c)}},drawSlices_:function(b,c){var d=this.context(),
424 updateContents_:function(){this.detach();if(this.cpu_){var b=tracing.filterSliceArray(this.categoryFilter_,this.cpu_.slices);if(b.length){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.heading="CPU "+this.cpu_.cpuNumber+":";this.appendChild(a)}for(var c in this.cpu_.counters){b=this.cpu_.counters[c];if(!this.categoryFilter_.matchCounter(b))break;a=new tracing.tracks.CounterTrack(this.viewport);a.heading="CPU "+this.cpu_.cpuNumber+" "+b.name+":";a.counter=b;a.categoryFilter=this.categoryFilter_;
447 get tooltip(){return this.tooltip_},set tooltip(b){this.tooltip_=b;this.updateContents_()},set decorateHit(b){this.decorateHit_=b;this.updateContents_()},addSliceTrack_:function(b){var a=new tracing.tracks.SliceTrack(this.viewport);a.slices=b;a.decorateHit=this.decorateHit_;a.categoryFilter_=this.categoryFilter;this.appendChild(a);return a},get subRows(){return base.asArray(this.children).map(function(b){return b.slices})},get hasVisibleContent(){return 0<this.children.length},updateContents_:function(){if(this.group_){var b=
448 tracing.filterSliceArray(this.categoryFilter,this.group_.slices);if(this.areArrayContentsSame_(this.filteredSlices_,b))this.updateHeadingAndTooltip_();else if(this.filteredSlices_=b,this.detach(),b.length){for(var b=this.buildSubRows_(b),a=0;a<b.length;a++){var c=b[a];c.length&&this.addSliceTrack_(c)}this.updateHeadingAndTooltip_()}}else this.updateHeadingAndTooltip_()},updateHeadingAndTooltip_:function(){this.firstChild&&(this.firstChild.heading=this.heading_,this.firstChild.tooltip=this.tooltip_)},
452 this.group_.slices);b.sort(function(a,b){return a.start-b.start});for(var a=[],c=0;c<b.length;c++){for(var e=b[c],d=!1,g=0;g<a.length;g++){var h=a[g];if(e.start>=h[h.length-1].end){d=!0;if(void 0===e.subSlices||1>e.subSlices.length)throw Error("AsyncEvent missing subSlices: ")+e.name;for(g=0;g<e.subSlices.length;g++)h.push(e.subSlices[g]);break}}if(!d&&(h=[],void 0!==e.subSlices)){for(g=0;g<e.subSlices.length;g++)h.push(e.subSlices[g]);a.push(h)}}return a}};return{AsyncSliceGroupTrack:d}});"use strict";
455 ": ";this.tooltip=this.thread_.userFriendlyDetails;if(this.thread_.asyncSliceGroup.length){var b=new tracing.tracks.AsyncSliceGroupTrack(this.viewport);b.categoryFilter=this.categoryFilter;b.decorateHit=function(a){};b.group=this.thread_.asyncSliceGroup;b.hasVisibleContent&&this.appendChild(b)}this.thread_.samples.length&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=b,b.group=this.thread_,b.slices=this.thread_.samples,b.decorateHit=function(a){a.thread=this.thread_},this.appendChild(b));
456 this.thread_.cpuSlices&&(b=new tracing.tracks.SliceTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading="",b.height="4px",b.decorateHit=function(a){a.thread=this.thread_},b.slices=this.thread_.cpuSlices,b.hasVisibleContent&&this.appendChild(b));this.thread_.sliceGroup.length&&(b=new tracing.tracks.SliceGroupTrack(this.viewport),b.categoryFilter=this.categoryFilter,b.heading=this.thread_.userFriendlyName,b.tooltip=this.thread_.userFriendlyDetails,b.decorateHit=function(a){a.thread=this.thread_},
507 "center",d)}},get keyHelp(){var a="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 (Selection mode) : Select slices (with "+(0==navigator.platform.indexOf("Mac")?"cmd":"ctrl")+": zoom to slices)\n drag (Pan mode) : Pan left/right/up/down)\n\n",a=this.focusElement.tabIndex?