aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-03-26 07:55:27 -0700
committerJohn Reck <jreck@google.com>2015-03-26 07:55:27 -0700
commitc810d7d37a544d12d8400247b7f41d05372b5977 (patch)
tree23431a3ce5689562132927424bc5fb3a96dd11ba
parent93216d0b8afcc23eb8811175ca32338cd09c9dca (diff)
downloadchromium-trace-c810d7d37a544d12d8400247b7f41d05372b5977.tar.gz
Fix multi_slice_sub_view
Bugfix is already upstream, cherry picking it down Change-Id: I83e1edf1c543ac9ab1679e122088135747f0ec24
-rw-r--r--systrace_trace_viewer.html13
-rw-r--r--trace-viewer/trace_viewer/core/analysis/multi_slice_sub_view.html2
2 files changed, 8 insertions, 7 deletions
diff --git a/systrace_trace_viewer.html b/systrace_trace_viewer.html
index 290f792f..4c492fd2 100644
--- a/systrace_trace_viewer.html
+++ b/systrace_trace_viewer.html
@@ -1981,12 +1981,13 @@ d[0])},analyzeSingleSlice_:function(d,c){var a=d.appendTable("analysis-slice-tab
d.appendInfoRowTime(a,"CPU Self Time",c.cpuSelfTime,!1,f)}c.durationInUserTime&&d.appendInfoRowTime(a,"Duration (U)",c.durationInUserTime);c.startStackFrame&&c.endStackFrame?c.startStackFrame===c.endStackFrame?d.appendInfoRow(a,"Start+End Stack Trace",c.startStackFrame.getUserFriendlyStackTrace()):(d.appendInfoRow(a,"Start Stack Trace",c.startStackFrame.getUserFriendlyStackTrace()),d.appendInfoRow(a,"End Stack Trace",c.endStackFrame.getUserFriendlyStackTrace())):c.startStackFrame?d.appendInfoRow(a,
"Start Stack Trace",c.startStackFrame.getUserFriendlyStackTrace()):c.endStackFrame&&d.appendInfoRow(a,"End Stack Trace",c.endStackFrame.getUserFriendlyStackTrace());f=0;for(var b in c.args)f+=1;if(0<f)for(b in d.appendInfoRow(a,"Args"),c.args)d.appendInfoRow(a," "+b,c.args[b])}});"use strict";
Polymer("tv-c-multi-slice-sub-view",{created:function(){this.currentSelection_=void 0;this.requiresTallView_=!1},set selection(d){if(1>=d.length)throw Error("Only supports multiple items");if(!d.every(function(c){return c instanceof tv.c.trace_model.Slice}))throw Error("Only supports slices");this.setSelectionWithoutErrorChecks(d)},get selection(){return this.currentSelection_},get requiresTallView(){return this.requiresTallView_},setSelectionWithoutErrorChecks:function(d){this.currentSelection_=
-d;this.textContent="";this.requiresTallView_=!1;if(void 0!==RasterTaskView&&tv.e.cc.RasterTaskSelection.supports(d)){d=new tv.e.cc.RasterTaskSelection(d);var c=new tv.e.cc.LayerTreeHostImplSnapshotView;c.objectSnapshot=d.containingSnapshot;c.selection=d;c.extraHighlightsByLayerId=d.extraHighlightsByLayerId;this.appendChild(c);this.style.display="flex";this.requiresTallView_=!0}else this.style.display="",c=new tv.c.analysis.AnalysisResults,this.appendChild(c),this.analyzeMultipleSlices_(c,d)},analyzeSingleTypeSlices_:function(d,
-c,a){d.appendInfo("Title: ",c[0].title);d.appendInfo("Category: ",c[0].category);var f=d.appendTable("analysis-slice-table",4+a),b=d.appendHeadRow(f);d.appendTableCell(f,b,"Start");d.appendTableCell(f,b,"Wall Duration (ms)");a&&d.appendTableCell(f,b,"CPU Duration (ms)");d.appendTableCell(f,b,"Self Time (ms)");d.appendTableCell(f,b,"Args");var e=0,k={},g=0,h=0,l=0;tv.b.iterItems(c,function(b,c){e++;d.appendDetailsRow(f,c.start,c.duration,c.selfTime?c.selfTime:c.duration,c.args,function(){return new tv.c.Selection([c])},
-c.cpuDuration,!1);g+=c.duration;h+=c.selfTime?c.selfTime:c.duration;a&&(l+=c.cpuDuration);for(var p in c.args){var u=c.args[p];"number"==typeof u&&(null==k[p]&&(k[p]=0),k[p]+=u)}});1<e&&(d.appendDetailsRow(f,void 0,g,h,k,void 0,a?l:void 0,!0),tv.b.ui.SortableTable.decorate(f))},analyzeMultipleSlices_:function(d,c){for(var a=c.bounds.min,f=c.bounds.max,b=0,e={},k=!1,g=0;g<c.length;g++){var h=c[g];void 0===e[h.title]&&(e[h.title]=[],b++);h.cpuDuration&&(k=!0);e[h.title].push(c[g])}var l=d.appendTable("analysis-slice-table",
-4+k),g=d.appendHeadRow(l);d.appendTableCell(l,g,"Name");d.appendTableCell(l,g,"Wall Duration (ms)");k&&d.appendTableCell(l,g,"CPU Duration (ms)");d.appendTableCell(l,g,"Self Time (ms)");k&&d.appendTableCell(l,g,"CPU Self Time (ms)");d.appendTableCell(l,g,"Occurrences");var m=this,n=0,p=0,u=0,v=0;tv.b.iterItems(e,function(a,e){for(var f=0,c=0,g=0,h=0,w=0,x=Number.MAX_VALUE,y=-Number.MAX_VALUE,A=Number.MAX_VALUE,B=-Number.MAX_VALUE,w=0;w<e.length;w++){var C=e[w],f=f+C.duration;C.cpuDuration&&(c+=C.cpuDuration,
-h+=C.cpuSelfTime?C.cpuSelfTime:C.cpuDuration);g+=C.selfTime?C.selfTime:C.duration;x=Math.min(C.start,x);y=Math.max(C.start,y);A=Math.min(C.duration,A);B=Math.max(C.duration,B)}n+=f;p+=c;u+=g;v+=h;0==e.length&&(w=0);w=f/e.length;A={min:A,max:B,avg:w,avg_stddev:void 0,frequency:void 0,frequency_stddev:void 0};for(w=B=0;w<e.length;w++)C=A.avg-e[w].duration,B+=C*C;A.avg_stddev=Math.sqrt(B/(e.length-1));y-=x;if(2<e.length&&0<y){x=e.length-1;A.frequency=1E3*x/y;B=0;for(w=1;w<e.length;w++)C=A.frequency-
-1E3/(e[w].start-e[w-1].start),B+=C*C;A.frequency_stddev=Math.sqrt(B/(x-1))}d.appendDataRow(l,a,f,k?0<c?c:"":null,g,k?0<h?h:"":null,e.length,null,A,function(){return new tv.c.Selection(e)});1===b&&m.analyzeSingleTypeSlices_(d,e,k)});1!==b&&(d.appendDataRow(l,"Totals",n,k?p:null,u,k?v:null,c.length,null,null,null,!0),d.appendSpacingRow(l,!0),tv.b.ui.SortableTable.decorate(l));d.appendInfoRowTime(l,"Selection start",a,!0);d.appendInfoRowTime(l,"Selection extent",f-a,!0)}});"use strict";
+d;this.textContent="";this.requiresTallView_=!1;if(void 0!==window.RasterTaskView&&tv.e.cc.RasterTaskSelection.supports(d)){d=new tv.e.cc.RasterTaskSelection(d);var c=new tv.e.cc.LayerTreeHostImplSnapshotView;c.objectSnapshot=d.containingSnapshot;c.selection=d;c.extraHighlightsByLayerId=d.extraHighlightsByLayerId;this.appendChild(c);this.style.display="flex";this.requiresTallView_=!0}else this.style.display="",c=new tv.c.analysis.AnalysisResults,this.appendChild(c),this.analyzeMultipleSlices_(c,d)},
+analyzeSingleTypeSlices_:function(d,c,a){d.appendInfo("Title: ",c[0].title);d.appendInfo("Category: ",c[0].category);var f=d.appendTable("analysis-slice-table",4+a),b=d.appendHeadRow(f);d.appendTableCell(f,b,"Start");d.appendTableCell(f,b,"Wall Duration (ms)");a&&d.appendTableCell(f,b,"CPU Duration (ms)");d.appendTableCell(f,b,"Self Time (ms)");d.appendTableCell(f,b,"Args");var e=0,k={},g=0,h=0,l=0;tv.b.iterItems(c,function(b,c){e++;d.appendDetailsRow(f,c.start,c.duration,c.selfTime?c.selfTime:c.duration,
+c.args,function(){return new tv.c.Selection([c])},c.cpuDuration,!1);g+=c.duration;h+=c.selfTime?c.selfTime:c.duration;a&&(l+=c.cpuDuration);for(var p in c.args){var u=c.args[p];"number"==typeof u&&(null==k[p]&&(k[p]=0),k[p]+=u)}});1<e&&(d.appendDetailsRow(f,void 0,g,h,k,void 0,a?l:void 0,!0),tv.b.ui.SortableTable.decorate(f))},analyzeMultipleSlices_:function(d,c){for(var a=c.bounds.min,f=c.bounds.max,b=0,e={},k=!1,g=0;g<c.length;g++){var h=c[g];void 0===e[h.title]&&(e[h.title]=[],b++);h.cpuDuration&&
+(k=!0);e[h.title].push(c[g])}var l=d.appendTable("analysis-slice-table",4+k),g=d.appendHeadRow(l);d.appendTableCell(l,g,"Name");d.appendTableCell(l,g,"Wall Duration (ms)");k&&d.appendTableCell(l,g,"CPU Duration (ms)");d.appendTableCell(l,g,"Self Time (ms)");k&&d.appendTableCell(l,g,"CPU Self Time (ms)");d.appendTableCell(l,g,"Occurrences");var m=this,n=0,p=0,u=0,v=0;tv.b.iterItems(e,function(a,e){for(var f=0,c=0,g=0,h=0,w=0,x=Number.MAX_VALUE,y=-Number.MAX_VALUE,A=Number.MAX_VALUE,B=-Number.MAX_VALUE,
+w=0;w<e.length;w++){var C=e[w],f=f+C.duration;C.cpuDuration&&(c+=C.cpuDuration,h+=C.cpuSelfTime?C.cpuSelfTime:C.cpuDuration);g+=C.selfTime?C.selfTime:C.duration;x=Math.min(C.start,x);y=Math.max(C.start,y);A=Math.min(C.duration,A);B=Math.max(C.duration,B)}n+=f;p+=c;u+=g;v+=h;0==e.length&&(w=0);w=f/e.length;A={min:A,max:B,avg:w,avg_stddev:void 0,frequency:void 0,frequency_stddev:void 0};for(w=B=0;w<e.length;w++)C=A.avg-e[w].duration,B+=C*C;A.avg_stddev=Math.sqrt(B/(e.length-1));y-=x;if(2<e.length&&
+0<y){x=e.length-1;A.frequency=1E3*x/y;B=0;for(w=1;w<e.length;w++)C=A.frequency-1E3/(e[w].start-e[w-1].start),B+=C*C;A.frequency_stddev=Math.sqrt(B/(x-1))}d.appendDataRow(l,a,f,k?0<c?c:"":null,g,k?0<h?h:"":null,e.length,null,A,function(){return new tv.c.Selection(e)});1===b&&m.analyzeSingleTypeSlices_(d,e,k)});1!==b&&(d.appendDataRow(l,"Totals",n,k?p:null,u,k?v:null,c.length,null,null,null,!0),d.appendSpacingRow(l,!0),tv.b.ui.SortableTable.decorate(l));d.appendInfoRowTime(l,"Selection start",a,!0);
+d.appendInfoRowTime(l,"Selection extent",f-a,!0)}});"use strict";
Polymer("tv-c-single-thread-time-slice-sub-view",{created:function(){this.currentSelection_=void 0},get selection(){return this.currentSelection_},set selection(d){if(1!==d.length)throw Error("Only supports single slices");if(!(d[0]instanceof tv.c.trace_model.ThreadTimeSlice))throw Error("Only supports thread time slices");this.currentSelection_=d;var c=d[0],a=c.thread;d=this.shadowRoot;d.querySelector("#state").textContent=c.title;var f=tv.b.ui.getColorPalette()[c.colorId];d.querySelector("#state").style.backgroundColor=
f;d.querySelector("#process-name").textContent=a.parent.userFriendlyName;d.querySelector("#thread-name").textContent=a.userFriendlyName;d.querySelector("#start").textContent=tv.c.analysis.tsRound(c.start)+"ms";d.querySelector("#duration").textContent=tv.c.analysis.tsRound(c.duration)+"ms";a=d.querySelector("#on-cpu");a.textContent="";f=d.querySelector("#running-instead");if(c.cpuOnWhichThreadWasRunning){f.parentElement.removeChild(f);var b=new tv.c.analysis.AnalysisLink;b.textContent=c.cpuOnWhichThreadWasRunning.userFriendlyName;
b.selectionGenerator=function(){var a=new tv.c.Selection;a.push(c.getAssociatedCpuSlice());return a}.bind(this);a.appendChild(b)}else{a.parentElement.removeChild(a);var e=c.getCpuSliceThatTookCpu();e?(b=new tv.c.analysis.AnalysisLink,b.textContent=e.thread?e.thread.userFriendlyName:e.title,b.selectionGenerator=function(){var a=new tv.c.Selection;a.push(e);return a}.bind(this),f.appendChild(b)):f.parentElement.removeChild(f)}d=d.querySelector("#args");0<tv.b.dictionaryKeys(c.args).length?(a=new tv.c.analysis.GenericObjectView,
diff --git a/trace-viewer/trace_viewer/core/analysis/multi_slice_sub_view.html b/trace-viewer/trace_viewer/core/analysis/multi_slice_sub_view.html
index 876d2371..49ae0b45 100644
--- a/trace-viewer/trace_viewer/core/analysis/multi_slice_sub_view.html
+++ b/trace-viewer/trace_viewer/core/analysis/multi_slice_sub_view.html
@@ -47,7 +47,7 @@ found in the LICENSE file.
// TODO(nduca): This is a gross hack for cc Frame Viewer, but its only
// the frame viewer that needs this feature, so ~shrug~.
- if (RasterTaskView !== undefined) { // May not have been imported.
+ if (window.RasterTaskView !== undefined) { // May not have been imported.
if (tv.e.cc.RasterTaskSelection.supports(selection)) {
var ltvSelection = new tv.e.cc.RasterTaskSelection(selection);