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

Unified Diff: tools/telemetry/telemetry/core/platform/mac_platform_backend.py

Issue 144543007: [Telemetry] Add power usage metric (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix review comments Created 6 years, 11 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
« tools/perf/unit-info.json ('K') | « tools/perf/unit-info.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/mac_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
index a427a7e692b968b7f3de48be18aa46c452bb6a94..fdace990343e4d6c4c3165f8fc61b659ce2e7631 100644
--- a/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/mac_platform_backend.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import ctypes
+import logging
import os
import plistlib
import signal
@@ -35,9 +36,15 @@ class MacPlatformBackend(posix_platform_backend.PosixPlatformBackend):
self._powermetrics_output_file = tempfile.NamedTemporaryFile().name
args = ['sudo', self.binary_path, '-f', 'plist', '-i',
'%d' % SAMPLE_INTERVAL_MS, '-u', self._powermetrics_output_file]
- # TODO(jeremy): Need to ensure command is run as root user.
+
+ # powermetrics writes lots of output to stderr, don't echo unless verbose
+ # logging enabled.
+ stderror_destination = subprocess.PIPE
+ if logging.getLogger().isEnabledFor(logging.INFO):
tonyg 2014/01/23 19:11:24 The bots enable INFO, and we probably don't want t
+ stderror_destination = None
+
self._powermetrics_process = subprocess.Popen(args,
- stdout=subprocess.PIPE)
+ stdout=subprocess.PIPE, stderr=stderror_destination)
def _SendPrivilegedSignal(self, pid, signal_num):
args = ['sudo', 'kill', '-%d' % signal_num, '%d' % pid]
« tools/perf/unit-info.json ('K') | « tools/perf/unit-info.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698