• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 = "ChromeOS 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"
13PY_VERSION = 3
14
15DOC = """
16This test records power related statistics while the system is idling.
17
18    Current tests,
19
20      | test# | seconds | display   | bluetooth |
21      -------------------------------------------
22      | 1     | 120     | off       | off       |
23      | 2     | 120     | default   | off       |
24      | 3     | 120     | default   | on - idle |
25      | 4     | 120     | off       | on - idle |
26"""
27
28args_dict = utils.args_to_dict(args)
29
30kwargs = {
31  'pdash_note': args_dict.get('pdash_note', ''),
32  'tag': NAME.split('.')[1]
33}
34
35if 'idle_secs' in args_dict:
36  kwargs['idle_secs'] = float(args_dict['idle_secs'])
37
38if 'warmup_secs' in args_dict:
39  kwargs['warmup_secs'] = float(args_dict['warmup_secs'])
40
41job.default_profile_only = True
42job.profilers.add('top')
43job.profilers.add('turbostat')
44job.profilers.add('cros_perf', interval=30)
45
46job.run_test('power_Idle', **kwargs)
47
48job.profilers.delete('cros_perf')
49job.profilers.delete('top')
50job.profilers.delete('turbostat')
51