OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2015 The Chromium Authors. All rights reserved. | 3 Copyright 2015 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 <link rel="import" href="/perf_insights/mappers/slice_cost.html"> | 7 <link rel="import" href="/perf_insights/mappers/slice_cost.html"> |
8 <link rel="import" href="/perf_insights/mappers/thread_grouping.html"> | 8 <link rel="import" href="/perf_insights/mappers/thread_grouping.html"> |
9 <link rel="import" href="/perf_insights/mre/function_handle.html"> | 9 <link rel="import" href="/perf_insights/mre/function_handle.html"> |
10 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 10 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
(...skipping 16 matching lines...) Expand all Loading... |
27 }); | 27 }); |
28 | 28 |
29 var railTypeNameByGUID = getStageTitleForEventsByGUID(model, allIRs); | 29 var railTypeNameByGUID = getStageTitleForEventsByGUID(model, allIRs); |
30 | 30 |
31 var threadGrouping = new pi.m.ThreadGrouping(); | 31 var threadGrouping = new pi.m.ThreadGrouping(); |
32 threadGrouping.autoInitUsingHelpers(model); | 32 threadGrouping.autoInitUsingHelpers(model); |
33 var last_known_framework = ['Unknown/Uncategorized']; | 33 var last_known_framework = ['Unknown/Uncategorized']; |
34 | 34 |
35 var sliceCosts = []; | 35 var sliceCosts = []; |
36 | 36 |
37 model.iterateAllEvents(function(event) { | 37 for (var event of model.getDescendantEvents()) { |
38 if (!(event instanceof tr.model.ThreadSlice)) | 38 if (!(event instanceof tr.model.ThreadSlice)) |
39 return; | 39 continue; |
40 | 40 |
41 if (!event.title.startsWith('V8.') && !event.title.startsWith('V8Test.')) | 41 if (!event.title.startsWith('V8.') && !event.title.startsWith('V8Test.')) |
42 return; | 42 continue; |
43 | 43 |
44 function _get_parent_data(event) { | 44 function _get_parent_data(event) { |
45 var curSlice = event; | 45 var curSlice = event; |
46 | 46 |
47 var data = {}; | 47 var data = {}; |
48 data['js'] = 'Unknown'; | 48 data['js'] = 'Unknown'; |
49 while (curSlice) { | 49 while (curSlice) { |
50 if (curSlice.title === 'v8.run') { | 50 if (curSlice.title === 'v8.run') { |
51 data['js'] = curSlice.args['fileName']; | 51 data['js'] = curSlice.args['fileName']; |
52 } else if (curSlice.title === 'v8.compile') { | 52 } else if (curSlice.title === 'v8.compile') { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 sliceData.railTypeName + '/' + | 214 sliceData.railTypeName + '/' + |
215 sliceData.framework + '/' + | 215 sliceData.framework + '/' + |
216 //sliceData.scriptURLClean + '/' + | 216 //sliceData.scriptURLClean + '/' + |
217 sliceData.title; | 217 sliceData.title; |
218 | 218 |
219 var newElement = { | 219 var newElement = { |
220 key: key, | 220 key: key, |
221 value: sliceData | 221 value: sliceData |
222 }; | 222 }; |
223 sliceCosts.push(newElement); | 223 sliceCosts.push(newElement); |
224 }); | 224 } |
225 | 225 |
226 result.addPair('wr', sliceCosts); | 226 result.addPair('wr', sliceCosts); |
227 } | 227 } |
228 | 228 |
229 function getStageTitleForEventsByGUID(model, expectations) { | 229 function getStageTitleForEventsByGUID(model, expectations) { |
230 var stageTitleByGUID = {}; | 230 var stageTitleByGUID = {}; |
231 expectations.forEach(function applyAssociatedToRTN(ir) { | 231 expectations.forEach(function applyAssociatedToRTN(ir) { |
232 ir.associatedEvents.forEach(function applyEventToRTN(event) { | 232 ir.associatedEvents.forEach(function applyEventToRTN(event) { |
233 // Unassociated events have already been assigned to a RTN. | 233 // Unassociated events have already been assigned to a RTN. |
234 if (stageTitleByGUID[event.guid] !== undefined) | 234 if (stageTitleByGUID[event.guid] !== undefined) |
235 return; | 235 return; |
236 stageTitleByGUID[event.guid] = ir.stageTitle; | 236 stageTitleByGUID[event.guid] = ir.stageTitle; |
237 }, this); | 237 }, this); |
238 }, this); | 238 }, this); |
239 | 239 |
240 model.iterateAllEvents(function storeEventToUnassociatedSet(event) { | 240 for (var event of model.getDescendantEvents()) { |
241 if (stageTitleByGUID[event.guid] !== undefined) | 241 if (stageTitleByGUID[event.guid] !== undefined) |
242 return; | 242 return; |
243 stageTitleByGUID[event.guid] = 'Unknown'; | 243 stageTitleByGUID[event.guid] = 'Unknown'; |
244 }); | 244 } |
245 return stageTitleByGUID; | 245 return stageTitleByGUID; |
246 } | 246 } |
247 | 247 |
248 pi.FunctionRegistry.register(v8ReportMapFunction); | 248 pi.FunctionRegistry.register(v8ReportMapFunction); |
249 | 249 |
250 // Exporting for tests. | 250 // Exporting for tests. |
251 return { | 251 return { |
252 v8ReportMapFunction: v8ReportMapFunction | 252 v8ReportMapFunction: v8ReportMapFunction |
253 }; | 253 }; |
254 }); | 254 }); |
255 | 255 |
256 </script> | 256 </script> |
OLD | NEW |