OLD | NEW |
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 Loading... |
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 |
OLD | NEW |