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() { // @suppress longLineCheck
15 test('kernelFunctionParser', function() {
17 'Binder_2-127 ( 127) [001] .... 3431.906759: graph_ent: func=sys_write',
18 'Binder_2-127 ( 127) [001] .... 3431.906769: graph_ret: func=sys_write',
19 'Binder_2-127 ( 127) [001] .... 3431.906785: graph_ent: func=sys_write',
20 'Binder_2-127 ( 127) [001] ...1 3431.906798: tracing_mark_write: B|' +
22 'Binder_2-127 ( 127) [001] .... 3431.906802: graph_ret: func=sys_write',
23 'Binder_2-127 ( 127) [001] .... 3431.906842: graph_ent: func=sys_write',
24 'Binder_2-127 ( 127) [001] ...1 3431.906849: tracing_mark_write: E',
25 'Binder_2-127 ( 127) [001] .... 3431.906853: graph_ret: func=sys_write',
26 'Binder_2-127 ( 127) [001] .... 3431.906896: graph_ent: func=sys_write',
27 'Binder_2-127 ( 127) [001] .... 3431.906906: graph_ret: func=sys_write'
29 var m = new tracing.TraceModel(lines.join('\n'), false);
30 assertFalse(m.hasImportWarnings);
32 var process = m.processes[127];
33 assertNotNull(process);
35 var thread = process.threads[127];
36 assertNotNull(thread);
38 var slices = thread.sliceGroup.slices;
39 assertEquals(7, thread.sliceGroup.length);
41 // Slice 0 is an un-split sys_write
42 assertEquals('sys_write', slices[0].title);
44 // Slices 1 & 3 are a split sys_write
45 assertEquals('sys_write', slices[1].title);
46 assertEquals('dequeueBuffer', slices[2].title);
47 assertEquals('sys_write (cont.)', slices[3].title);
49 // Slices 4 & 5 are a split sys_write with the dequeueBuffer in between
50 assertEquals('sys_write', slices[4].title);
51 assertEquals('sys_write (cont.)', slices[5].title);
53 // Slice 6 is another un-split sys_write
54 assertEquals('sys_write', slices[6].title);