Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / trace-viewer / trace_viewer / tracing / importer / linux_perf / exynos_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() {
15   test('exynosBusfreqImport', function() {
16     var lines = [
17       '     kworker/1:0-4177  [001] ....  2803.129806: ' +
18           'exynos_busfreq_target_int: frequency=200000',
19       '     kworker/1:0-4177  [001] ....  2803.229207: ' +
20           'exynos_busfreq_target_int: frequency=267000',
21       '     kworker/1:0-4177  [001] ....  2803.329031: ' +
22           'exynos_busfreq_target_int: frequency=160000',
23       '     kworker/1:0-4177  [001] ....  2805.729039: ' +
24           'exynos_busfreq_target_mif: frequency=200000'
25     ];
26     var m = new tracing.TraceModel(lines.join('\n'), false);
27     assertFalse(m.hasImportWarnings);
28
29     var c0 = m.kernel.cpus[0];
30     assertEquals(0, c0.slices.length);
31     assertEquals(3, c0.counters['INT Frequency'].series[0].samples.length);
32     assertEquals(1, c0.counters['MIF Frequency'].series[0].samples.length);
33   });
34
35   test('exynosPageFlipSlowRequestImport', function() {
36     var lines = [
37       '          <idle>-0     [000] d.h. 1000.000000: ' +
38           'exynos_page_flip_state: pipe=0, fb=26, state=wait_kds',
39       ' Chrome_IOThread-21603 [000] d.h. 1000.000001: ' +
40           'exynos_page_flip_state: pipe=0, fb=26, state=wait_apply',
41       '     kworker/0:1-25931 [000] .... 1000.000002: ' +
42           'exynos_page_flip_state: pipe=0, fb=26, state=wait_flip',
43       '     kworker/0:1-25931 [000] .... 1000.000003: ' +
44           'exynos_page_flip_state: pipe=0, fb=26, state=flipped',
45       '          <idle>-0     [000] d.h. 1000.000004: ' +
46           'exynos_page_flip_state: pipe=0, fb=25, state=wait_kds',
47       ' Chrome_IOThread-21603 [000] d.h. 1000.000005: ' +
48           'exynos_page_flip_state: pipe=0, fb=25, state=wait_apply',
49       '     kworker/0:1-25931 [000] .... 1000.000006: ' +
50           'exynos_page_flip_state: pipe=0, fb=25, state=wait_flip',
51       '     kworker/0:1-25931 [000] .... 1000.000007: ' +
52           'exynos_page_flip_state: pipe=0, fb=25, state=flipped'
53     ];
54     var m = new tracing.TraceModel(lines.join('\n'), false);
55     assertFalse(m.hasImportWarnings);
56
57     var threads = m.getAllThreads();
58     // there are 2 threads:
59     //   (1) "exynos_flip_state (pipe:0, fb:25)"
60     //   (2) "exynos_flip_state (pipe:0, fb:26)"
61     assertEquals(2, threads.length);
62
63     // in the test data, event of fb=26 occurs first, so it's thread[0]
64     var gfxFbId26Thread = threads[0]; // thread where fb == 26
65     var gfxFbId25Thread = threads[1]; // thread where fb == 25
66     assertEquals('exynos_flip_state (pipe:0, fb:25)', gfxFbId25Thread.name);
67     assertEquals('exynos_flip_state (pipe:0, fb:26)', gfxFbId26Thread.name);
68     // Every state (except for 'flipped') will start a new slice.
69     // The last event will not be closed, so it's not a slice
70     assertEquals(3, gfxFbId25Thread.sliceGroup.length);
71     assertEquals(3, gfxFbId26Thread.sliceGroup.length);
72   });
73
74   test('exynosPageFlipFastRequestImport', function() {
75     var lines = [
76       '          <idle>-0     [000] d.h. 1000.000000: ' +
77           'exynos_page_flip_state: pipe=0, fb=26, state=wait_kds',
78       ' Chrome_IOThread-21603 [000] d.h. 1000.000001: ' +
79           'exynos_page_flip_state: pipe=0, fb=25, state=wait_kds',
80       '               X-21385 [000] .... 1000.000002: ' +
81           'exynos_page_flip_state: pipe=0, fb=26, state=wait_apply',
82       '     kworker/0:1-25931 [000] .... 1000.000003: ' +
83           'exynos_page_flip_state: pipe=0, fb=26, state=wait_flip',
84       '               X-21385 [001] .... 1000.000004: ' +
85           'exynos_page_flip_state: pipe=0, fb=25, state=wait_apply',
86       '     kworker/0:1-25931 [000] .... 1000.000005: ' +
87           'exynos_page_flip_state: pipe=0, fb=26, state=flipped',
88       '          <idle>-0     [000] d.h. 1000.000006: ' +
89           'exynos_page_flip_state: pipe=0, fb=26, state=wait_kds',
90       '               X-21385 [000] .... 1000.000007: ' +
91           'exynos_page_flip_state: pipe=0, fb=25, state=wait_flip',
92       '     kworker/0:1-25931 [000] .... 1000.000008: ' +
93           'exynos_page_flip_state: pipe=0, fb=25, state=flipped',
94       '     kworker/0:1-25931 [000] .... 1000.000009: ' +
95           'exynos_page_flip_state: pipe=0, fb=25, state=wait_kds',
96       ' Chrome_IOThread-21603 [000] d.h. 1000.000010: ' +
97           'exynos_page_flip_state: pipe=0, fb=25, state=wait_apply',
98       '          <idle>-0     [000] d.h. 1000.000011: ' +
99           'exynos_page_flip_state: pipe=0, fb=26, state=wait_apply'
100     ];
101     var m = new tracing.TraceModel(lines.join('\n'), false);
102     assertFalse(m.hasImportWarnings);
103
104     var threads = m.getAllThreads();
105     // there are 2 threads:
106     //   (1) "exynos_flip_state (pipe:0, fb:25)"
107     //   (2) "exynos_flip_state (pipe:0, fb:26)"
108     assertEquals(2, threads.length);
109
110     // in the test data, event of fb=26 occurs first, so it's thread[0]
111     var gfxFbId26Thread = threads[0]; // thread where fb == 26
112     var gfxFbId25Thread = threads[1]; // thread where fb == 25
113     assertEquals('exynos_flip_state (pipe:0, fb:25)', gfxFbId25Thread.name);
114     assertEquals('exynos_flip_state (pipe:0, fb:26)', gfxFbId26Thread.name);
115     // Every state (except for 'flipped') will start a new slice.
116     // The last event will not be closed, so it's not a slice
117     assertEquals(4, gfxFbId25Thread.sliceGroup.length);
118     assertEquals(4, gfxFbId26Thread.sliceGroup.length);
119   });
120 });
121 </script>
122