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

Unified Diff: telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py

Issue 1831143003: [Telemetry] Always clean up startup config file on Android (Closed) Base URL: git@github.com:catapult-project/catapult@master
Patch Set: Created 4 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
diff --git a/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py b/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
index 2f311bff214d4d18dec1c8064fee53eb3b15173c..d6485212e31c5c872c96612047e94111e007a667 100644
--- a/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
+++ b/telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_agent.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import atexit
import logging
import os
import shutil
@@ -154,6 +155,9 @@ class ChromeTracingAgent(tracing_agent.TracingAgent):
_CHROME_TRACE_CONFIG_FILE_NAME)
self._platform_backend.device.WriteFile(self._trace_config_file,
self._CreateTraceConfigFileString(config), as_root=True)
+ # The config file has fixed path on Android. We need to ensure it is
+ # always cleaned up.
+ atexit.register(self._RemoveTraceConfigFile)
nednguyen 2016/03/25 00:23:59 Where is the place that fail to call StopAgentTrac
elif self._platform_backend.GetOSName() in _DESKTOP_OS_NAMES:
self._trace_config_file = os.path.join(tempfile.mkdtemp(),
_CHROME_TRACE_CONFIG_FILE_NAME)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698