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

Side by Side Diff: trace_processor/experimental/mappers/scheduling/map_input_blockers.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
« no previous file with comments | « no previous file | trace_processor/experimental/mappers/scheduling/map_wake_ups.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 7
8 <link rel="import" href="/perf_insights/mre/function_handle.html"> 8 <link rel="import" href="/perf_insights/mre/function_handle.html">
9 <link rel="import" href="/tracing/base/range.html"> 9 <link rel="import" href="/tracing/base/math/range.html">
10 <link rel="import" href="/tracing/model/helpers/chrome_model_helper.html"> 10 <link rel="import" href="/tracing/model/helpers/chrome_model_helper.html">
11 11
12 <script> 12 <script>
13 'use strict'; 13 'use strict';
14 14
15 tr.exportTo('pie', function() { 15 tr.exportTo('pie', function() {
16 // Collects the set of tasks that are preventing user input from being 16 // Collects the set of tasks that are preventing user input from being
17 // processed on the main thread. 17 // processed on the main thread.
18 // See https://goo.gl/l7V5xg. 18 // See https://goo.gl/l7V5xg.
19 function mapInputBlockers(result, model) { 19 function mapInputBlockers(result, model) {
(...skipping 18 matching lines...) Expand all
38 for (var event of mainThread.getDescendantEvents()) { 38 for (var event of mainThread.getDescendantEvents()) {
39 if (event.title !== 'LatencyInfo.Flow' || 39 if (event.title !== 'LatencyInfo.Flow' ||
40 event.args['step'] !== 'HandleInputEventMain' || 40 event.args['step'] !== 'HandleInputEventMain' ||
41 event.inFlowEvents.length !== 1) { 41 event.inFlowEvents.length !== 1) {
42 continue; 42 continue;
43 } 43 }
44 44
45 // Now we can derive the queueing interval from the flow event. 45 // Now we can derive the queueing interval from the flow event.
46 var flowEvent = event.inFlowEvents[0]; 46 var flowEvent = event.inFlowEvents[0];
47 var queueRange = 47 var queueRange =
48 tr.b.Range.fromExplicitRange(flowEvent.start, event.start); 48 tr.b.math.Range.fromExplicitRange(flowEvent.start, event.start);
49 49
50 // Find all events that intersect the queueing interval and compute how 50 // Find all events that intersect the queueing interval and compute how
51 // much they contributed to it. 51 // much they contributed to it.
52 for (var intersectingEvent of mainThread.getDescendantEvents()) { 52 for (var intersectingEvent of mainThread.getDescendantEvents()) {
53 var eventRange = 53 var eventRange =
54 tr.b.Range.fromExplicitRange(intersectingEvent.start, 54 tr.b.math.Range.fromExplicitRange(intersectingEvent.start,
55 intersectingEvent.start + intersectingEvent.duration); 55 intersectingEvent.start + intersectingEvent.duration);
56 var intersection = queueRange.findIntersection(eventRange); 56 var intersection = queueRange.findIntersection(eventRange);
57 if (intersection.isEmpty || intersection.duration === 0) 57 if (intersection.isEmpty || intersection.duration === 0)
58 continue; 58 continue;
59 if (inputBlockers[intersectingEvent.title] === undefined) 59 if (inputBlockers[intersectingEvent.title] === undefined)
60 inputBlockers[intersectingEvent.title] = []; 60 inputBlockers[intersectingEvent.title] = [];
61 inputBlockers[intersectingEvent.title].push(intersection.duration); 61 inputBlockers[intersectingEvent.title].push(intersection.duration);
62 foundInputBlockers = true; 62 foundInputBlockers = true;
63 } 63 }
64 } 64 }
65 } 65 }
66 66
67 if (!foundInputBlockers) { 67 if (!foundInputBlockers) {
68 result.addPair('inputBlockers', null); 68 result.addPair('inputBlockers', null);
69 return; 69 return;
70 } 70 }
71 71
72 result.addPair('inputBlockers', inputBlockers); 72 result.addPair('inputBlockers', inputBlockers);
73 } 73 }
74 74
75 pi.FunctionRegistry.register(mapInputBlockers); 75 pi.FunctionRegistry.register(mapInputBlockers);
76 76
77 return { 77 return {
78 mapInputBlockersForTest: mapInputBlockers 78 mapInputBlockersForTest: mapInputBlockers
79 }; 79 };
80 }); 80 });
81 </script> 81 </script>
OLDNEW
« no previous file with comments | « no previous file | trace_processor/experimental/mappers/scheduling/map_wake_ups.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698