| <!DOCTYPE html> |
| <html> |
| <!-- |
| Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| <head> |
| <title>LinuxPerfMaliParser tests</title> |
| <script src="base.js"></script> |
| </head> |
| <body> |
| <script> |
| 'use strict'; |
| |
| base.require('unittest'); |
| base.require('test_utils'); |
| base.require('linux_perf_importer'); |
| |
| function testMaliDDKImport() { |
| var lines = [ |
| // Row 1 open |
| ' chrome-1780 [001] ...1 28.562633: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'gles/src/dispatch/mali_gles_dispatch_entrypoints.c992: ' + |
| 'glTexSubImage2D', |
| // Row 2 open |
| ' chrome-1780 [001] ...1 28.562655: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'gles/src/texture/mali_gles_texture_api.c996: ' + |
| 'gles_texture_tex_sub_image_2d', |
| // Row 3 open |
| ' chrome-1780 [001] ...1 28.562671: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c295: ' + |
| 'gles_texturep_slave_map_master', |
| // Row 3 close |
| ' chrome-1780 [001] ...1 28.562684: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c295: ', |
| // Row 3 open |
| ' chrome-1780 [001] ...1 28.562700: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c1505: ' + |
| 'gles2_texturep_upload_2d', |
| // Row 4 open |
| ' chrome-1780 [001] ...1 28.562726: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c1612: ' + |
| 'gles2_texturep_upload_2d: pixel array: wait for dependencies', |
| // Row 5 open |
| ' chrome-1780 [001] ...1 28.562742: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1693: ' + |
| 'cobj_convert_pixels_to_surface', |
| // Row 6 open |
| ' chrome-1780 [001] ...1 28.562776: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1461: ' + |
| 'cobj_convert_pixels', |
| // Row 7 open |
| ' chrome-1780 [001] ...1 28.562791: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1505: ' + |
| 'cobj_convert_pixels: fast-path linear copy', |
| // Row 8 open |
| ' chrome-1780 [001] ...1 28.562808: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_enter: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1511: ' + |
| 'cobj_convert_pixels: reorder-only', |
| // Row 8 close |
| ' chrome-1780 [001] ...1 28.563383: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1511', |
| // Row 7 close |
| ' chrome-1780 [001] ...1 28.563397: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1505', |
| // Row 6 close |
| ' chrome-1780 [001] ...1 28.563409: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1461', |
| // Row 5 close |
| ' chrome-1780 [001] ...1 28.563438: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'cobj/src/mali_cobj_surface_operations.c1693', |
| // Row 4 close |
| ' chrome-1780 [001] ...1 28.563451: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c1612', |
| // Row 3 close |
| ' chrome-1780 [001] ...1 28.563462: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'gles/src/texture/mali_gles_texture_slave.c1505', |
| // Row 2 close |
| ' chrome-1780 [001] ...1 28.563475: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'gles/src/texture/mali_gles_texture_api.c996', |
| // Row 1 close |
| ' chrome-1780 [001] ...1 28.563486: tracing_mark_write: ' + |
| 'mali_driver: cros_trace_print_exit: ' + |
| 'gles/src/dispatch/mali_gles_dispatch_entrypoints.c992' |
| ]; |
| var m = new tracing.TimelineModel(lines.join('\n'), false); |
| assertEquals(0, m.importErrors.length); |
| |
| var threads = m.getAllThreads(); |
| assertEquals(1, threads.length); |
| |
| var maliThread = threads[0]; |
| assertEquals('mali_ddk', maliThread.name); |
| assertEquals(9, maliThread.slices.length); |
| } |
| |
| function testDVFSFrequencyImport() { |
| var lines = [ |
| ' kworker/u:0-5 [001] .... 1174.839552: mali_dvfs_set_clock: ' + |
| 'frequency=266', |
| ' kworker/u:0-5 [000] .... 1183.840486: mali_dvfs_set_clock: ' + |
| 'frequency=400' |
| ]; |
| var m = new tracing.TimelineModel(lines.join('\n'), false); |
| assertEquals(0, m.importErrors.length); |
| |
| var c0 = m.cpus[0]; |
| assertEquals(0, c0.slices.length); |
| assertEquals(2, c0.counters['DVFS Frequency'].samples.length); |
| } |
| |
| function testDVFSVoltageImport() { |
| var lines = [ |
| ' kworker/u:0-5 [001] .... 1174.839562: mali_dvfs_set_voltage: ' + |
| 'voltage=937500', |
| ' kworker/u:0-5 [000] .... 1183.840009: mali_dvfs_set_voltage: ' + |
| 'voltage=1100000' |
| ]; |
| var m = new tracing.TimelineModel(lines.join('\n'), false); |
| assertEquals(0, m.importErrors.length); |
| |
| var c0 = m.cpus[0]; |
| assertEquals(0, c0.slices.length); |
| assertEquals(2, c0.counters['DVFS Voltage'].samples.length); |
| } |
| |
| function testDVFSUtilizationImport() { |
| var lines = [ |
| ' kworker/u:0-5 [001] .... 1174.839552: mali_dvfs_event: ' + |
| 'utilization=7', |
| ' kworker/u:0-5 [000] .... 1183.840486: mali_dvfs_event: ' + |
| 'utilization=37' |
| ]; |
| var m = new tracing.TimelineModel(lines.join('\n'), false); |
| assertEquals(0, m.importErrors.length); |
| |
| var c0 = m.cpus[0]; |
| assertEquals(0, c0.slices.length); |
| assertEquals(2, c0.counters['DVFS Utilization'].samples.length); |
| } |
| |
| </script> |
| </body> |
| </html> |