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

Unified Diff: tools/profile_chrome/ddms_controller.py

Issue 1738563002: Remove //tools/profile_chrome from Chromium repo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/profile_chrome/controllers_unittest.py ('k') | tools/profile_chrome/ddms_controller_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/profile_chrome/ddms_controller.py
diff --git a/tools/profile_chrome/ddms_controller.py b/tools/profile_chrome/ddms_controller.py
deleted file mode 100644
index 3f26297f420b5f7befaf718a16b1b726a4e06887..0000000000000000000000000000000000000000
--- a/tools/profile_chrome/ddms_controller.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2015 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.
-
-import os
-import re
-import time
-
-from profile_chrome import controllers
-from profile_chrome import util
-
-_DDMS_SAMPLING_FREQUENCY_US = 100
-
-
-class DdmsController(controllers.BaseController):
- def __init__(self, device, package_info):
- controllers.BaseController.__init__(self)
- self._device = device
- self._package = package_info.package
- self._output_file = None
- self._supports_sampling = self._SupportsSampling()
-
- def __repr__(self):
- return 'ddms profile'
-
- def _SupportsSampling(self):
- for line in self._device.RunShellCommand('am --help'):
- if re.match(r'.*am profile start.*--sampling', line):
- return True
- return False
-
- def StartTracing(self, _):
- self._output_file = (
- '/data/local/tmp/ddms-profile-%s' % util.GetTraceTimestamp())
- cmd = 'am profile start '
- if self._supports_sampling:
- cmd += '--sampling %d ' % _DDMS_SAMPLING_FREQUENCY_US
- cmd += '%s %s' % (self._package, self._output_file)
- self._device.RunShellCommand(cmd)
-
- def StopTracing(self):
- self._device.RunShellCommand('am profile stop %s' % self._package)
-
- def PullTrace(self):
- if not self._output_file:
- return None
-
- # Wait for the trace file to get written.
- time.sleep(1)
-
- host_file = os.path.join(
- os.path.curdir, os.path.basename(self._output_file))
- self._device.PullFile(self._output_file, host_file)
- return host_file
« no previous file with comments | « tools/profile_chrome/controllers_unittest.py ('k') | tools/profile_chrome/ddms_controller_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698