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

Unified Diff: tools/telemetry/telemetry/core/browser.py

Issue 14978006: Telemetry: makes profilers a bit more generic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dict / member name Created 7 years, 7 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 | « no previous file | tools/telemetry/telemetry/core/platform/profiler/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/browser.py
diff --git a/tools/telemetry/telemetry/core/browser.py b/tools/telemetry/telemetry/core/browser.py
index 98b808206b583f654c028f1a9455311a5de2a76a..c9c8fca9fc3b42981fbca114e025f78d16721828 100644
--- a/tools/telemetry/telemetry/core/browser.py
+++ b/tools/telemetry/telemetry/core/browser.py
@@ -1,7 +1,7 @@
# Copyright (c) 2012 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 collections
+
import os
from telemetry.core import browser_credentials
@@ -189,24 +189,15 @@ class Browser(object):
|base_output_file|.<process_name>."""
assert not self._active_profilers
- all_pids = ([self._browser_backend.pid] +
- self._platform_backend.GetChildPids(self._browser_backend.pid))
profiler_class = profiler_finder.FindProfiler(options.profiler_tool)
if not profiler_class.is_supported(options):
raise Exception('The %s profiler is not ' +
'supported on this platform.' % options.profiler_tool)
- process_name_counts = collections.defaultdict(int)
-
- for pid in all_pids:
- cmd_line = self._platform_backend.GetCommandLine(pid)
- process_name = self._browser_backend.GetProcessName(cmd_line)
- output_file = '%s.%s%s' % (base_output_file, process_name,
- process_name_counts[process_name])
- process_name_counts[process_name] += 1
- self._active_profilers.append(
- profiler_class(self._browser_backend, pid, output_file))
+ self._active_profilers.append(
+ profiler_class(self._browser_backend, self._platform_backend,
+ base_output_file))
def StopProfiling(self):
"""Stops all active profilers and saves their results."""
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/profiler/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698