1# Copyright (c) 2019 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5AUTHOR = "Chrome OS Team" 6NAME = "power_Idle.perf" 7PURPOSE = "Measure power usage when system is idle with perf enabled." 8CRITERIA = "This test is a benchmark." 9TIME = "SHORT" 10TEST_CATEGORY = "Benchmark" 11TEST_CLASS = "power" 12TEST_TYPE = "client" 13 14DOC = """ 15This test records power related statistics while the system is idling. 16 17 Current tests, 18 19 | test# | seconds | display | bluetooth | 20 ------------------------------------------- 21 | 1 | 120 | off | off | 22 | 2 | 120 | default | off | 23 | 3 | 120 | default | on - idle | 24 | 4 | 120 | off | on - idle | 25""" 26 27args_dict = utils.args_to_dict(args) 28 29kwargs = { 30 'pdash_note': args_dict.get('pdash_note', ''), 31 'tag': NAME.split('.')[1] 32} 33 34if 'idle_secs' in args_dict: 35 kwargs['idle_secs'] = float(args_dict['idle_secs']) 36 37if 'warmup_secs' in args_dict: 38 kwargs['warmup_secs'] = float(args_dict['warmup_secs']) 39 40job.default_profile_only = True 41job.profilers.add('top') 42job.profilers.add('turbostat') 43job.profilers.add('cros_perf', interval=30) 44 45job.run_test('power_Idle', **kwargs) 46 47job.profilers.delete('cros_perf') 48job.profilers.delete('top') 49job.profilers.delete('turbostat') 50