| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <!-- | 3 <!-- |
| 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. | 6 found in the LICENSE file. |
| 7 --> | 7 --> |
| 8 <head> | 8 <head> |
| 9 <title>LinuxPerfImporter tests</title> | 9 <title>LinuxPerfImporter tests</title> |
| 10 <script src= | 10 <script src= |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 '==> next_comm=SurfaceFlinger next_pid=178 next_prio=112', | 185 '==> next_comm=SurfaceFlinger next_pid=178 next_prio=112', |
| 186 ' SurfaceFlinger-178 [001] 4467.843536: sched_switch: ' + | 186 ' SurfaceFlinger-178 [001] 4467.843536: sched_switch: ' + |
| 187 'prev_comm=SurfaceFlinger prev_pid=178 prev_prio=112 ' + | 187 'prev_comm=SurfaceFlinger prev_pid=178 prev_prio=112 ' + |
| 188 'prev_state=S ==> next_comm=kworker/u:2 next_pid=2844 ' + | 188 'prev_state=S ==> next_comm=kworker/u:2 next_pid=2844 ' + |
| 189 'next_prio=120', | 189 'next_prio=120', |
| 190 ' kworker/u:2-2844 [001] 4467.843567: sched_switch: ' + | 190 ' kworker/u:2-2844 [001] 4467.843567: sched_switch: ' + |
| 191 'prev_comm=kworker/u:2 prev_pid=2844 prev_prio=120 ' + | 191 'prev_comm=kworker/u:2 prev_pid=2844 prev_prio=120 ' + |
| 192 'prev_state=S ==> next_comm=swapper next_pid=0 ' + | 192 'prev_state=S ==> next_comm=swapper next_pid=0 ' + |
| 193 'next_prio=120', | 193 'next_prio=120', |
| 194 ' kworker/u:2-2844 [001] 4467.843000: 0: ' + | 194 ' kworker/u:2-2844 [001] 4467.843000: 0: ' + |
| 195 'trace_event_clock_sync: parent_ts=0.0' | 195 'trace_event_clock_sync: parent_ts=0.1' |
| 196 ]; | 196 ]; |
| 197 var m = new tracing.TimelineModel(lines.join('\n'), false); | 197 var m = new tracing.TimelineModel(lines.join('\n'), false); |
| 198 assertEquals(0, m.importErrors.length); | 198 assertEquals(0, m.importErrors.length); |
| 199 | 199 |
| 200 var c = m.cpus[1]; | 200 var c = m.cpus[1]; |
| 201 assertEquals(2, c.slices.length); | 201 assertEquals(2, c.slices.length); |
| 202 | 202 |
| 203 assertAlmostEquals((467.843475 - 467.843) * 1000, c.slices[0].start); | 203 assertAlmostEquals((467.843475 - (467.843 - 0.1)) * 1000, c.slices[0].start); |
| 204 } | 204 } |
| 205 | 205 |
| 206 function testClockSyncMarkWrite() { | 206 function testClockSyncMarkWrite() { |
| 207 var lines = [ | 207 var lines = [ |
| 208 'systrace.sh-8170 [001] 15180.978813: sched_switch: ' + | 208 'systrace.sh-8170 [001] 15180.978813: sched_switch: ' + |
| 209 'prev_comm=systrace.sh prev_pid=8170 prev_prio=120 ' + | 209 'prev_comm=systrace.sh prev_pid=8170 prev_prio=120 ' + |
| 210 'prev_state=x ==> next_comm=kworker/1:0 next_pid=7873 ' + | 210 'prev_state=x ==> next_comm=kworker/1:0 next_pid=7873 ' + |
| 211 'next_prio=120', | 211 'next_prio=120', |
| 212 ' kworker/1:0-7873 [001] 15180.978836: sched_switch: ' + | 212 ' kworker/1:0-7873 [001] 15180.978836: sched_switch: ' + |
| 213 'prev_comm=kworker/1:0 prev_pid=7873 prev_prio=120 ' + | 213 'prev_comm=kworker/1:0 prev_pid=7873 prev_prio=120 ' + |
| 214 'prev_state=S ==> next_comm=debugd next_pid=4404 next_prio=120', | 214 'prev_state=S ==> next_comm=debugd next_pid=4404 next_prio=120', |
| 215 ' debugd-4404 [001] 15180.979010: sched_switch: prev_comm=debugd ' + | 215 ' debugd-4404 [001] 15180.979010: sched_switch: prev_comm=debugd ' + |
| 216 'prev_pid=4404 prev_prio=120 prev_state=S ==> ' + | 216 'prev_pid=4404 prev_prio=120 prev_state=S ==> ' + |
| 217 'next_comm=dbus-daemon next_pid=510 next_prio=120', | 217 'next_comm=dbus-daemon next_pid=510 next_prio=120', |
| 218 'systrace.sh-8182 [000] 15186.203900: tracing_mark_write: ' + | 218 'systrace.sh-8182 [000] 15186.203900: tracing_mark_write: ' + |
| 219 'trace_event_clock_sync: parent_ts=0.0' | 219 'trace_event_clock_sync: parent_ts=0' |
| 220 ]; | 220 ]; |
| 221 var m = new tracing.TimelineModel(lines.join('\n'), false); | 221 var m = new tracing.TimelineModel(lines.join('\n'), false); |
| 222 assertEquals(0, m.importErrors.length); | 222 assertEquals(0, m.importErrors.length); |
| 223 | 223 |
| 224 var c = m.cpus[1]; | 224 var c = m.cpus[1]; |
| 225 assertEquals(2, c.slices.length); | 225 assertEquals(2, c.slices.length); |
| 226 | 226 |
| 227 assertAlmostEquals((5180.978813 - 5186.2039) * 1000, c.slices[0].start); | 227 assertAlmostEquals((15180.978813 - 0) * 1000, c.slices[0].start); |
| 228 } | 228 } |
| 229 | 229 |
| 230 | 230 |
| 231 function testImportWithoutClockSyncDeletesEverything() { | 231 function testImportWithoutClockSyncDeletesEverything() { |
| 232 } | 232 } |
| 233 | 233 |
| 234 function testWorkQueueImport() { | 234 function testWorkQueueImport() { |
| 235 var lines = [ | 235 var lines = [ |
| 236 ' kworker/0:3-6880 [000] 2784.771958: workqueue_execute_start: ' + | 236 ' kworker/0:3-6880 [000] 2784.771958: workqueue_execute_start: ' + |
| 237 'work struct ffff8800a5083a20: function intel_unpin_work_fn', | 237 'work struct ffff8800a5083a20: function intel_unpin_work_fn', |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 343 |
| 344 assertAlmostEquals(2784.774864 * 1000.0, | 344 assertAlmostEquals(2784.774864 * 1000.0, |
| 345 m.processes['0'].threads['2'].subRows[0][0].start); | 345 m.processes['0'].threads['2'].subRows[0][0].start); |
| 346 assertAlmostEquals((2784.788644 - 2784.774864) * 1000.0, | 346 assertAlmostEquals((2784.788644 - 2784.774864) * 1000.0, |
| 347 m.processes['0'].threads['2'].subRows[0][0].duration); | 347 m.processes['0'].threads['2'].subRows[0][0].duration); |
| 348 } | 348 } |
| 349 | 349 |
| 350 </script> | 350 </script> |
| 351 </body> | 351 </body> |
| 352 </html> | 352 </html> |
| OLD | NEW |