OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 ast | 5 import ast |
6 from telemetry.internal.util import atexit_with_log | 6 from telemetry.internal.util import atexit_with_log |
7 import contextlib | 7 import contextlib |
8 import gc | 8 import gc |
9 import logging | 9 import logging |
10 import os | 10 import os |
11 import sys | 11 import sys |
12 import tempfile | 12 import tempfile |
13 import traceback | 13 import traceback |
14 import uuid | 14 import uuid |
15 | 15 |
16 from py_trace_event import trace_event | 16 from py_trace_event import trace_event |
17 from telemetry.core import discover | 17 from py_utils import discover |
18 from telemetry.core import exceptions | 18 from telemetry.core import exceptions |
19 from telemetry.core import util | 19 from telemetry.core import util |
20 from telemetry.internal.platform import tracing_agent | 20 from telemetry.internal.platform import tracing_agent |
21 from telemetry.internal.platform.tracing_agent import chrome_tracing_agent | 21 from telemetry.internal.platform.tracing_agent import chrome_tracing_agent |
22 from telemetry.timeline import tracing_config | 22 from telemetry.timeline import tracing_config |
23 from tracing.trace_data import trace_data as trace_data_module | 23 from tracing.trace_data import trace_data as trace_data_module |
24 | 24 |
25 | 25 |
26 def _IterAllTracingAgentClasses(): | 26 def _IterAllTracingAgentClasses(): |
27 tracing_agent_dir = os.path.join( | 27 tracing_agent_dir = os.path.join( |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 try: | 284 try: |
285 os.remove(self._trace_log) | 285 os.remove(self._trace_log) |
286 self._trace_log = None | 286 self._trace_log = None |
287 except OSError: | 287 except OSError: |
288 logging.exception('Error when deleting %s, will try again at exit.', | 288 logging.exception('Error when deleting %s, will try again at exit.', |
289 self._trace_log) | 289 self._trace_log) |
290 def DeleteAtExit(path): | 290 def DeleteAtExit(path): |
291 os.remove(path) | 291 os.remove(path) |
292 atexit_with_log.Register(DeleteAtExit, self._trace_log) | 292 atexit_with_log.Register(DeleteAtExit, self._trace_log) |
293 self._trace_log = None | 293 self._trace_log = None |
OLD | NEW |