workqueue_parser_test.html revision edfe2194ee8a857cc1e78b4e4020f9b5e7210029
1<!DOCTYPE html>
2<!--
3Copyright (c) 2013 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/tracing/core/test_utils.html">
9<link rel="import" href="/tracing/extras/importer/linux_perf/ftrace_importer.html">
10
11<script>
12'use strict';
13
14tr.b.unittest.testSuite(function() { // @suppress longLineCheck
15  test('workQueueImport', function() {
16    var lines = [
17      ' kworker/0:3-6880  [000]  2784.771958: workqueue_execute_start: ' +
18                 'work struct ffff8800a5083a20: function intel_unpin_work_fn',
19      ' kworker/0:3-6880  [000]  2784.771966: workqueue_execute_end: ' +
20                 'work struct ffff8800a5083a20',
21      ' kworker/1:2-7269  [001]  2784.805966: workqueue_execute_start: ' +
22                 'work struct ffff88014fb0f158: function do_dbs_timer',
23      ' kworker/1:2-7269  [001]  2784.805975: workqueue_execute_end: ' +
24                 'work struct ffff88014fb0f158'
25    ];
26    var m = tr.c.test_utils.newModelWithEvents([lines.join('\n')], {
27      shiftWorldToZero: false
28    });
29    assert.isFalse(m.hasImportWarnings);
30
31    assert.equal(m.processes['6880'].threads['6880'].sliceGroup.length, 1);
32    assert.equal(m.processes['7269'].threads['7269'].sliceGroup.length, 1);
33  });
34});
35</script>
36
37