Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / importer / linux_perf / kfunc_parser_test.html
1 <!DOCTYPE html>
2 <!--
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.
6 -->
7
8 <link rel="import" href="/tracing/test_utils.html">
9 <link rel="import" href="/tracing/importer/linux_perf_importer.html">
10
11 <script>
12 'use strict';
13
14 tv.unittest.testSuite(function() { // @suppress longLineCheck
15   test('kernelFunctionParser', function() {
16     var lines = [
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|' +
21           '127|dequeueBuffer',
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'
28     ];
29     var m = new tracing.TraceModel(lines.join('\n'), false);
30     assertFalse(m.hasImportWarnings);
31
32     var process = m.processes[127];
33     assertNotNull(process);
34
35     var thread = process.threads[127];
36     assertNotNull(thread);
37
38     var slices = thread.sliceGroup.slices;
39     assertEquals(7, thread.sliceGroup.length);
40
41     // Slice 0 is an un-split sys_write
42     assertEquals('sys_write', slices[0].title);
43
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);
48
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);
52
53     // Slice 6 is another un-split sys_write
54     assertEquals('sys_write', slices[6].title);
55   });
56 });
57 </script>
58