From ba549103582c13431c8b28570b474436eb157c76 Mon Sep 17 00:00:00 2001 From: alph Date: Fri, 28 Apr 2017 13:47:02 -0700 Subject: [PATCH] Reland of DevTools: fix aggregated donut chart cache population (patchset #1 id:1 of https://codereview.chromium.org/2839083002/ ) Reason for revert: The patch has noting to do with the failing test. In fact if you look at the flakiness dashboard the test is very flaky there: https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=webkit_layout_tests&tests=virtual%2Fthreaded%2Finspector%2Ftracing%2Ftimeline-js%2Ftimeline-runtime-stats.html Original issue's description: > Revert of DevTools: fix aggregated donut chart cache population (patchset #1 id:1 of https://codereview.chromium.org/2840463003/ ) > > Reason for revert: > Suspected cause of failure of virtual/threaded/inspector/tracing/timeline-js/timeline-runtime-stats.html in https://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win7%20(dbg)/builds/9644 > > Original issue's description: > > DevTools: fix aggregated donut chart cache population > > > > The check for stats cache availablity was made on the first task in the main thread > > tasks list. If the first task happens to be filtered out, it never gets cache built for > > it. Later the cache presence check would look for a cache on the first task, never find > > it and forces recaching. > > > > BUG=714934 > > > > Review-Url: https://codereview.chromium.org/2840463003 > > Cr-Commit-Position: refs/heads/master@{#467114} > > Committed: https://chromium.googlesource.com/chromium/src/+/755b1656f38d135013f24ddd8b6ec046874beed2 > > TBR=pfeldman@chromium.org,alph@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=714934 > > Review-Url: https://codereview.chromium.org/2839083002 > Cr-Commit-Position: refs/heads/master@{#467223} > Committed: https://chromium.googlesource.com/chromium/src/+/65df576fce3007b62084239cc8e37a45aea0368f TBR=pfeldman@chromium.org,sashab@chromium.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=714934 Review-Url: https://codereview.chromium.org/2851823002 Cr-Commit-Position: refs/heads/master@{#468119} --- front_end/timeline/TimelineUIUtils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front_end/timeline/TimelineUIUtils.js b/front_end/timeline/TimelineUIUtils.js index fdec03b387..5da484d758 100644 --- a/front_end/timeline/TimelineUIUtils.js +++ b/front_end/timeline/TimelineUIUtils.js @@ -1046,13 +1046,14 @@ Timeline.TimelineUIUtils = class { */ static _buildRangeStatsCacheIfNeeded(model) { var tasks = model.mainThreadTasks(); - if (tasks.length && tasks[0][Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol]) + var filter = Timeline.TimelineUIUtils._filterForStats(); + var firstTask = tasks.find(filter); + if (!firstTask || firstTask[Timeline.TimelineUIUtils._categoryBreakdownCacheSymbol]) return; var aggregatedStats = {}; var ownTimes = []; TimelineModel.TimelineModel.forEachEvent( - model.mainThreadEvents(), onStartEvent, onEndEvent, undefined, undefined, undefined, - Timeline.TimelineUIUtils._filterForStats()); + model.mainThreadEvents(), onStartEvent, onEndEvent, undefined, undefined, undefined, filter); /** * @param {!SDK.TracingModel.Event} e