OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2012 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="/tracing/extras/importer/linux_perf/parser.html"> | 8 <link rel="import" href="/tracing/extras/importer/linux_perf/parser.html"> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ts, eventBase) { | 51 ts, eventBase) { |
52 var event = syncTimelineRE.exec(eventBase.details); | 52 var event = syncTimelineRE.exec(eventBase.details); |
53 if (!event) | 53 if (!event) |
54 return false; | 54 return false; |
55 | 55 |
56 var thread = this.importer.getOrCreatePseudoThread(event[1]); | 56 var thread = this.importer.getOrCreatePseudoThread(event[1]); |
57 | 57 |
58 if (thread.lastActiveTs !== undefined) { | 58 if (thread.lastActiveTs !== undefined) { |
59 var duration = ts - thread.lastActiveTs; | 59 var duration = ts - thread.lastActiveTs; |
60 var value = thread.lastActiveValue; | 60 var value = thread.lastActiveValue; |
61 if (value == undefined) | 61 if (value === undefined) |
62 value = ' '; | 62 value = ' '; |
63 var slice = new tr.model.ThreadSlice( | 63 var slice = new tr.model.ThreadSlice( |
64 '', value, | 64 '', value, |
65 ColorScheme.getColorIdForGeneralPurposeString(value), | 65 ColorScheme.getColorIdForGeneralPurposeString(value), |
66 thread.lastActiveTs, {}, | 66 thread.lastActiveTs, {}, |
67 duration); | 67 duration); |
68 thread.thread.sliceGroup.pushSlice(slice); | 68 thread.thread.sliceGroup.pushSlice(slice); |
69 } | 69 } |
70 thread.lastActiveTs = ts; | 70 thread.lastActiveTs = ts; |
71 thread.lastActiveValue = event[2]; | 71 thread.lastActiveValue = event[2]; |
(...skipping 17 matching lines...) Expand all Loading... |
89 var slices = thread.kernelSliceGroup; | 89 var slices = thread.kernelSliceGroup; |
90 if (!slices.isTimestampValidForBeginOrEnd(ts)) { | 90 if (!slices.isTimestampValidForBeginOrEnd(ts)) { |
91 this.model_.importWarning({ | 91 this.model_.importWarning({ |
92 type: 'parse_error', | 92 type: 'parse_error', |
93 message: 'Timestamps are moving backward.' | 93 message: 'Timestamps are moving backward.' |
94 }); | 94 }); |
95 return false; | 95 return false; |
96 } | 96 } |
97 | 97 |
98 var name = 'fence_wait("' + event[2] + '")'; | 98 var name = 'fence_wait("' + event[2] + '")'; |
99 if (event[1] == 'begin') { | 99 if (event[1] === 'begin') { |
100 var slice = slices.beginSlice(null, name, ts, { | 100 var slice = slices.beginSlice(null, name, ts, { |
101 'Start state': event[3] | 101 'Start state': event[3] |
102 }); | 102 }); |
103 } else if (event[1] == 'end') { | 103 } else if (event[1] === 'end') { |
104 if (slices.openSliceCount > 0) { | 104 if (slices.openSliceCount > 0) { |
105 slices.endSlice(ts); | 105 slices.endSlice(ts); |
106 } | 106 } |
107 } else { | 107 } else { |
108 return false; | 108 return false; |
109 } | 109 } |
110 | 110 |
111 return true; | 111 return true; |
112 }, | 112 }, |
113 | 113 |
114 syncPtEvent: function(eventName, cpuNumber, pid, ts, eventBase) { | 114 syncPtEvent: function(eventName, cpuNumber, pid, ts, eventBase) { |
115 return !!syncPtRE.exec(eventBase.details); | 115 return !!syncPtRE.exec(eventBase.details); |
116 } | 116 } |
117 }; | 117 }; |
118 | 118 |
119 Parser.register(SyncParser); | 119 Parser.register(SyncParser); |
120 | 120 |
121 return { | 121 return { |
122 SyncParser: SyncParser | 122 SyncParser: SyncParser |
123 }; | 123 }; |
124 }); | 124 }); |
125 </script> | 125 </script> |
OLD | NEW |