Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: build/android/pylib/device_stats_monitor.py

Issue 22903016: [android] Adds constants.GetOutDirectory() and converts test scripts to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix provision_devices.py which never set the build type Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/fake_dns.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Utilities for iotop/top style profiling for android.""" 5 """Utilities for iotop/top style profiling for android."""
6 6
7 import collections 7 import collections
8 import json 8 import json
9 import os 9 import os
10 import subprocess 10 import subprocess
(...skipping 13 matching lines...) Expand all
24 """ 24 """
25 25
26 DEVICE_PATH = constants.TEST_EXECUTABLE_DIR + '/device_stats_monitor' 26 DEVICE_PATH = constants.TEST_EXECUTABLE_DIR + '/device_stats_monitor'
27 PROFILE_PATH = (constants.DEVICE_PERF_OUTPUT_DIR + 27 PROFILE_PATH = (constants.DEVICE_PERF_OUTPUT_DIR +
28 '/device_stats_monitor.profile') 28 '/device_stats_monitor.profile')
29 RESULT_VIEWER_PATH = os.path.abspath(os.path.join( 29 RESULT_VIEWER_PATH = os.path.abspath(os.path.join(
30 os.path.dirname(os.path.realpath(__file__)), 'device_stats_monitor.html')) 30 os.path.dirname(os.path.realpath(__file__)), 'device_stats_monitor.html'))
31 31
32 def __init__(self, adb, hz): 32 def __init__(self, adb, hz):
33 self._adb = adb 33 self._adb = adb
34 host_path = os.path.abspath(os.path.join( 34 host_path = os.path.join(
35 constants.DIR_SOURCE_ROOT, 'out', constants.GetBuildType(), 35 constants.GetOutDirectory(), 'device_stats_monitor')
36 'device_stats_monitor'))
37 self._adb.PushIfNeeded(host_path, DeviceStatsMonitor.DEVICE_PATH) 36 self._adb.PushIfNeeded(host_path, DeviceStatsMonitor.DEVICE_PATH)
38 self._hz = hz 37 self._hz = hz
39 38
40 def Start(self): 39 def Start(self):
41 """Starts device stats monitor on the device.""" 40 """Starts device stats monitor on the device."""
42 self._adb.SetProtectedFileContents(DeviceStatsMonitor.PROFILE_PATH, '') 41 self._adb.SetProtectedFileContents(DeviceStatsMonitor.PROFILE_PATH, '')
43 self._process = subprocess.Popen( 42 self._process = subprocess.Popen(
44 ['adb', 'shell', '%s --hz=%d %s' % ( 43 ['adb', 'shell', '%s --hz=%d %s' % (
45 DeviceStatsMonitor.DEVICE_PATH, self._hz, 44 DeviceStatsMonitor.DEVICE_PATH, self._hz,
46 DeviceStatsMonitor.PROFILE_PATH)]) 45 DeviceStatsMonitor.PROFILE_PATH)])
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 'user', 107 'user',
109 'nice', 108 'nice',
110 'system', 109 'system',
111 'idle', 110 'idle',
112 'iowait', 111 'iowait',
113 'irq', 112 'irq',
114 'softirq', 113 'softirq',
115 ]) 114 ])
116 fields = line.split() 115 fields = line.split()
117 return cpu_stats._make([fields[0]] + [int(f) for f in fields[1:8]]) 116 return cpu_stats._make([fields[0]] + [int(f) for f in fields[1:8]])
OLDNEW
« no previous file with comments | « build/android/pylib/constants.py ('k') | build/android/pylib/fake_dns.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698