3 Copyright (c) 2013 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
8 <link rel="import" href="/tracing/test_utils.html">
9 <link rel="import" href="/tracing/importer/linux_perf_importer.html">
14 tv.unittest.testSuite(function() {
15 test('gestureImport', function() {
17 '<...>-1837 [000] ...1 875292.741648: tracing_mark_write: ' +
18 'log: start: TimerLogOutputs', // 0
19 '<...>-1837 [000] ...1 875292.741651: tracing_mark_write: ' +
20 'log: end: TimerLogOutputs',
21 '<...>-1837 [000] ...1 875292.742796: tracing_mark_write: ' +
22 'log: start: LogTimerCallback',
23 '<...>-1837 [000] ...1 875292.742802: tracing_mark_write: ' +
24 'log: end: LogTimerCallback',
25 '<...>-1837 [000] ...1 875292.742805: tracing_mark_write: ' +
26 'HandleTimer: start: LoggingFilterInterpreter', // 2
27 '<...>-1837 [000] ...1 875292.742809: tracing_mark_write: ' +
28 'HandleTimer: start: AppleTrackpadFilterInterpreter',
29 '<...>-1837 [000] ...1 875292.742814: tracing_mark_write: ' +
30 'HandleTimer: start: Cr48ProfileSensorFilterInterpreter',
31 '<...>-1837 [000] ...1 875292.742818: tracing_mark_write: ' +
32 'HandleTimer: start: T5R2CorrectingFilterInterpreter',
33 '<...>-1837 [000] ...1 875292.742822: tracing_mark_write: ' +
34 'HandleTimer: start: StuckButtonInhibitorFilterInterpreter',
35 '<...>-1837 [000] ...1 875292.742825: tracing_mark_write: ' +
36 'HandleTimer: start: IntegralGestureFilterInterpreter',
37 '<...>-1837 [000] ...1 875292.742829: tracing_mark_write: ' +
38 'HandleTimer: start: ScalingFilterInterpreter',
39 '<...>-1837 [000] ...1 875292.742833: tracing_mark_write: ' +
40 'HandleTimer: start: SplitCorrectingFilterInterpreter',
41 '<...>-1837 [000] ...1 875292.742836: tracing_mark_write: ' +
42 'HandleTimer: start: AccelFilterInterpreter',
43 '<...>-1837 [000] ...1 875292.742840: tracing_mark_write: ' +
44 'HandleTimer: start: SensorJumpFilterInterpreter',
45 '<...>-1837 [000] ...1 875292.742843: tracing_mark_write: ' +
46 'HandleTimer: start: BoxFilterInterpreter',
47 '<...>-1837 [000] ...1 875292.742846: tracing_mark_write: ' +
48 'HandleTimer: start: LookaheadFilterInterpreter',
49 '<...>-1837 [000] ...1 875292.742853: tracing_mark_write: ' +
50 'SyncInterpret: start: IirFilterInterpreter', // 14
51 '<...>-1837 [000] ...1 875292.742861: tracing_mark_write: ' +
52 'SyncInterpret: start: PalmClassifyingFilterInterpreter',
53 '<...>-1837 [000] ...1 875292.742872: tracing_mark_write: ' +
54 'SyncInterpret: start: ClickWiggleFilterInterpreter',
55 '<...>-1837 [000] ...1 875292.742881: tracing_mark_write: ' +
56 'SyncInterpret: start: FlingStopFilterInterpreter',
57 '<...>-1837 [000] ...1 875292.742887: tracing_mark_write: ' +
58 'SyncInterpret: start: ImmediateInterpreter',
59 '<...>-1837 [000] ...1 875292.742906: tracing_mark_write: ' +
60 'SyncInterpret: end: ImmediateInterpreter',
61 '<...>-1837 [000] ...1 875292.742910: tracing_mark_write: ' +
62 'SyncInterpret: end: FlingStopFilterInterpreter',
63 '<...>-1837 [000] ...1 875292.742914: tracing_mark_write: ' +
64 'SyncInterpret: end: ClickWiggleFilterInterpreter',
65 '<...>-1837 [000] ...1 875292.742917: tracing_mark_write: ' +
66 'SyncInterpret: end: PalmClassifyingFilterInterpreter',
67 '<...>-1837 [000] ...1 875292.742921: tracing_mark_write: ' +
68 'SyncInterpret: end: IirFilterInterpreter',
69 '<...>-1837 [000] ...1 875292.742926: tracing_mark_write: ' +
70 'HandleTimer: end: LookaheadFilterInterpreter',
71 '<...>-1837 [000] ...1 875292.742929: tracing_mark_write: ' +
72 'HandleTimer: end: BoxFilterInterpreter',
73 '<...>-1837 [000] ...1 875292.742932: tracing_mark_write: ' +
74 'HandleTimer: end: SensorJumpFilterInterpreter',
75 '<...>-1837 [000] ...1 875292.742937: tracing_mark_write: ' +
76 'HandleTimer: end: AccelFilterInterpreter',
77 '<...>-1837 [000] ...1 875292.742940: tracing_mark_write: ' +
78 'HandleTimer: end: SplitCorrectingFilterInterpreter',
79 '<...>-1837 [000] ...1 875292.742944: tracing_mark_write: ' +
80 'HandleTimer: end: ScalingFilterInterpreter',
81 '<...>-1837 [000] ...1 875292.742949: tracing_mark_write: ' +
82 'HandleTimer: end: IntegralGestureFilterInterpreter',
83 '<...>-1837 [000] ...1 875292.742952: tracing_mark_write: ' +
84 'HandleTimer: end: StuckButtonInhibitorFilterInterpreter',
85 '<...>-1837 [000] ...1 875292.742956: tracing_mark_write: ' +
86 'HandleTimer: end: T5R2CorrectingFilterInterpreter',
87 '<...>-1837 [000] ...1 875292.742959: tracing_mark_write: ' +
88 'HandleTimer: end: Cr48ProfileSensorFilterInterpreter',
89 '<...>-1837 [000] ...1 875292.742962: tracing_mark_write: ' +
90 'HandleTimer: end: AppleTrackpadFilterInterpreter',
91 '<...>-1837 [000] ...1 875292.742966: tracing_mark_write: ' +
92 'HandleTimer: end: LoggingFilterInterpreter',
93 '<...>-1837 [000] ...1 875292.742969: tracing_mark_write: ' +
94 'log: start: TimerLogOutputs',
95 '<...>-1837 [000] ...1 875292.742973: tracing_mark_write: ' +
96 'log: end: TimerLogOutputs',
97 '<...>-1837 [000] ...1 875292.795219: tracing_mark_write: ' +
98 'log: start: LogHardwareState',
99 '<...>-1837 [000] ...1 875292.795231: tracing_mark_write: ' +
100 'log: end: LogHardwareState'
102 var m = new tracing.TraceModel(lines.join('\n'), false);
103 assertFalse(m.hasImportWarnings);
104 var threads = m.getAllThreads();
105 assertEquals(1, threads.length);
107 var gestureThread = threads[0];
108 assertEquals('gesture', gestureThread.name);
109 assertEquals(21, gestureThread.sliceGroup.length);
110 assertEquals('touchpad_gesture',
111 gestureThread.sliceGroup.slices[0].category);
112 assertEquals('GestureLog',
113 gestureThread.sliceGroup.slices[0].title);
114 assertEquals('touchpad_gesture',
115 gestureThread.sliceGroup.slices[2].category);
116 assertEquals('HandleTimer',
117 gestureThread.sliceGroup.slices[2].title);
118 assertEquals('touchpad_gesture',
119 gestureThread.sliceGroup.slices[14].category);
120 assertEquals('SyncInterpret',
121 gestureThread.sliceGroup.slices[14].title);
124 test('unusualStart', function() {
126 'X-30368 [000] ...1 1819362.481867: tracing_mark_write: ' +
127 'SyncInterpret: start: IirFilterInterpreter',
128 'X-30368 [000] ...1 1819362.481881: tracing_mark_write: ' +
129 'SyncInterpret: start: PalmClassifyingFilterInterpreter',
130 'X-30368 [000] ...1 1819362.481894: tracing_mark_write: ' +
131 'SyncInterpret: start: ClickWiggleFilterInterpreter',
132 'X-30368 [000] ...1 1819362.481905: tracing_mark_write: ' +
133 'SyncInterpret: start: FlingStopFilterInterpreter',
134 'X-30368 [000] ...1 1819362.481912: tracing_mark_write: ' +
135 'SyncInterpret: start: ImmediateInterpreter',
136 'X-30368 [000] ...1 1819362.481933: tracing_mark_write: ' +
137 'SyncInterpret: end: ImmediateInterpreter',
138 'X-30368 [000] ...1 1819362.481938: tracing_mark_write: ' +
139 'SyncInterpret: end: FlingStopFilterInterpreter',
140 'X-30368 [000] ...1 1819362.481943: tracing_mark_write: ' +
141 'SyncInterpret: end: ClickWiggleFilterInterpreter',
142 'X-30368 [000] ...1 1819362.481947: tracing_mark_write: ' +
143 'SyncInterpret: end: PalmClassifyingFilterInterpreter',
144 'X-30368 [000] ...1 1819362.481952: tracing_mark_write: ' +
145 'SyncInterpret: end: IirFilterInterpreter',
146 'X-30368 [000] ...1 1819362.481958: tracing_mark_write: ' +
147 'HandleTimer: end: LookaheadFilterInterpreter',
148 'X-30368 [000] ...1 1819362.481962: tracing_mark_write: ' +
149 'HandleTimer: end: BoxFilterInterpreter',
150 'X-30368 [000] ...1 1819362.481967: tracing_mark_write: ' +
151 'HandleTimer: end: SensorJumpFilterInterpreter',
152 'X-30368 [000] ...1 1819362.481973: tracing_mark_write: ' +
153 'HandleTimer: end: AccelFilterInterpreter',
154 'X-30368 [000] ...1 1819362.481977: tracing_mark_write: ' +
155 'HandleTimer: end: SplitCorrectingFilterInterpreter',
156 'X-30368 [000] ...1 1819362.481982: tracing_mark_write: ' +
157 'HandleTimer: end: ScalingFilterInterpreter',
158 'X-30368 [000] ...1 1819362.481988: tracing_mark_write: ' +
159 'HandleTimer: end: IntegralGestureFilterInterpreter',
160 'X-30368 [000] ...1 1819362.481993: tracing_mark_write: ' +
161 'HandleTimer: end: StuckButtonInhibitorFilterInterpreter',
162 'X-30368 [000] ...1 1819362.481998: tracing_mark_write: ' +
163 'HandleTimer: end: T5R2CorrectingFilterInterpreter',
164 'X-30368 [000] ...1 1819362.482033: tracing_mark_write: ' +
165 'HandleTimer: end: Cr48ProfileSensorFilterInterpreter',
166 'X-30368 [000] ...1 1819362.482038: tracing_mark_write: ' +
167 'HandleTimer: end: AppleTrackpadFilterInterpreter',
168 'X-30368 [000] ...1 1819362.482043: tracing_mark_write: ' +
169 'HandleTimer: end: LoggingFilterInterpreter',
170 'X-30368 [000] ...1 1819362.482047: tracing_mark_write: ' +
171 'log: start: TimerLogOutputs',
172 'X-30368 [000] ...1 1819362.482053: tracing_mark_write: ' +
173 'log: end: TimerLogOutputs'
175 var m = new tracing.TraceModel(lines.join('\n'), false);
176 assertFalse(m.hasImportWarnings);
177 var threads = m.getAllThreads();
178 assertEquals(1, threads.length);
181 test('importError', function() {
183 'X-30368 [000] ...1 1819362.481912: tracing_mark_write: ' +
184 'SyncInterpret: start: ImmediateInterpreter',
185 'X-30368 [000] ...1 1819362.481958: tracing_mark_write: ' +
186 'HandleTimer: end: LookaheadFilterInterpreter',
187 'X-30368 [000] ...1 1819362.481962: tracing_mark_write: ' +
188 'HandleTimer: end: BoxFilterInterpreter',
189 'X-30368 [000] ...1 1819362.481967: tracing_mark_write: ' +
190 'HandleTimer: end: SensorJumpFilterInterpreter',
191 'X-30368 [000] ...1 1819362.481973: tracing_mark_write: ' +
192 'HandleTimer: end: AccelFilterInterpreter',
193 'X-30368 [000] ...1 1819362.481977: tracing_mark_write: ' +
194 'HandleTimer: end: SplitCorrectingFilterInterpreter',
195 'X-30368 [000] ...1 1819362.481982: tracing_mark_write: ' +
196 'HandleTimer: end: ScalingFilterInterpreter',
197 'X-30368 [000] ...1 1819362.481988: tracing_mark_write: ' +
198 'HandleTimer: end: IntegralGestureFilterInterpreter'
200 var m = new tracing.TraceModel(lines.join('\n'), false);
201 assertTrue(m.hasImportWarnings);
202 assertEquals(7, m.importWarnings.length);