Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(320)

Side by Side Diff: trace_processor/experimental/mappers/slice_cost.html

Issue 2771723003: [tracing] Move math utilities from base into their own subdirectory (attempt 2) (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2015 The Chromium Authors. All rights reserved. 3 Copyright (c) 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="/experimental/mappers/reduce.html"> 7 <link rel="import" href="/experimental/mappers/reduce.html">
8 <link rel="import" href="/tracing/extras/ads/domain_category.html"> 8 <link rel="import" href="/tracing/extras/ads/domain_category.html">
9 <link rel="import" href="/tracing/extras/chrome/slice_title_fixer.html"> 9 <link rel="import" href="/tracing/extras/chrome/slice_title_fixer.html">
10 <link rel="import" href="/tracing/model/source_info/js_source_info.html"> 10 <link rel="import" href="/tracing/model/source_info/js_source_info.html">
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 }; 91 };
92 92
93 93
94 function getSliceCostReport(model, threadGrouping, railTypeNameByGUID, 94 function getSliceCostReport(model, threadGrouping, railTypeNameByGUID,
95 filterFunction, dataCB) { 95 filterFunction, dataCB) {
96 var reduce = new pi.m.StreamingReducer(SliceCostInfo.asReduceTarget); 96 var reduce = new pi.m.StreamingReducer(SliceCostInfo.asReduceTarget);
97 97
98 function generateDomainCosts(slice) { 98 function generateDomainCosts(slice) {
99 // V8.Execute events may generate several sliceCostInfo, based on the 99 // V8.Execute events may generate several sliceCostInfo, based on the
100 // origin of the JS being executed. 100 // origin of the JS being executed.
101 var range = new tr.b.Range(); 101 var range = new tr.b.math.Range();
102 slice.addBoundsToRange(range); 102 slice.addBoundsToRange(range);
103 var filtered = range.filterArray( 103 var filtered = range.filterArray(
104 slice.parentContainer.samples, 104 slice.parentContainer.samples,
105 function(sample) {return sample.start;}); 105 function(sample) {return sample.start;});
106 filtered.forEach(function(sample) { 106 filtered.forEach(function(sample) {
107 var sliceCostInfo = new SliceCostInfo(); 107 var sliceCostInfo = new SliceCostInfo();
108 sliceCostInfo.threadGroup = threadGrouping.getGroupNameForEvent(slice); 108 sliceCostInfo.threadGroup = threadGrouping.getGroupNameForEvent(slice);
109 sliceCostInfo.railTypeName = railTypeNameByGUID[slice.guid]; 109 sliceCostInfo.railTypeName = railTypeNameByGUID[slice.guid];
110 110
111 var ufc = model.getUserFriendlyCategoryFromEvent(slice); 111 var ufc = model.getUserFriendlyCategoryFromEvent(slice);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 tr.mre.FunctionRegistry.register(getSliceCostReport); 178 tr.mre.FunctionRegistry.register(getSliceCostReport);
179 179
180 return { 180 return {
181 SliceCostInfo: SliceCostInfo, 181 SliceCostInfo: SliceCostInfo,
182 182
183 getSliceCostReport: getSliceCostReport 183 getSliceCostReport: getSliceCostReport
184 }; 184 };
185 }); 185 });
186 </script> 186 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698