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

Side by Side Diff: tools/telemetry/telemetry/core/platform/profiler/sample_profiler.py

Issue 23458037: Profiler.is_supported takes browser_type instead of options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix loading_profile.py 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
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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 import signal 5 import signal
6 import subprocess 6 import subprocess
7 import sys 7 import sys
8 import tempfile 8 import tempfile
9 9
10 from telemetry.core import exceptions 10 from telemetry.core import exceptions
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 # So we won't have permissing to profile it 68 # So we won't have permissing to profile it
69 continue 69 continue
70 self._process_profilers.append( 70 self._process_profilers.append(
71 _SingleProcessSampleProfiler(pid, output_file)) 71 _SingleProcessSampleProfiler(pid, output_file))
72 72
73 @classmethod 73 @classmethod
74 def name(cls): 74 def name(cls):
75 return 'sample' 75 return 'sample'
76 76
77 @classmethod 77 @classmethod
78 def is_supported(cls, options): 78 def is_supported(cls, browser_type):
79 if sys.platform != 'darwin': 79 if sys.platform != 'darwin':
80 return False 80 return False
81 if not options: 81 if browser_type == 'any':
82 return True 82 return True
83 return (not options.browser_type.startswith('android') and 83 return (not browser_type.startswith('android') and
84 not options.browser_type.startswith('cros')) 84 not browser_type.startswith('cros'))
85 85
86 def CollectProfile(self): 86 def CollectProfile(self):
87 output_paths = [] 87 output_paths = []
88 for single_process in self._process_profilers: 88 for single_process in self._process_profilers:
89 output_paths.append(single_process.CollectProfile()) 89 output_paths.append(single_process.CollectProfile())
90 return output_paths 90 return output_paths
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698