Telemetry fails with "Tracing is already started" on Android |
|||
Issue description
Steps to reproduce:
1. Build content_shell_apk
2. tools/perf/run_benchmark v8.infinite_scroll --story-filter=facebook --show-stdout --chrome-root=$(pwd)
The run fails with:
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/browser/browser.py", line 55, in __init__
self._browser_backend.Start()
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/android_browser_backend.py", line 142, in Start
self._InitDevtoolsClientBackend(remote_devtools_port)
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/chrome_browser_backend.py", line 161, in _InitDevtoolsClientBackend
self._port, remote_devtools_port or self._port, self)
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend.py", line 127, in __init__
custom_categories=trace_config.tracing_category_filter.filter_string)
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend.py", line 337, in StartChromeTracing
trace_config, custom_categories, timeout)
File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/tracing_backend.py", line 126, in StartTracing
'Tracing.start:\n' + json.dumps(response, indent=2))
TracingUnexpectedResponseException: Inspector returned unexpected response for Tracing.start:
{
"id": 1,
"error": {
"message": "Tracing is already started",
"code": -32603
}
}
(ERROR) 2016-04-01 15:04:58,934 android_browser_finder.Create:130 Failure while creating Android browser.
Debugging showed that tracing is indeed already started in void BrowserMainLoop::PostMainMessageLoopStart()
[https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/browser_main_loop.cc&rcl=1459496138&l=615] because there is a trace config file.
Commenting out the error handling in tracing_backend.py allows the benchmark to run successfully.
,
Apr 1 2016
ulan@ what is the location of the trace config file of content_shell on the device? Telemetry is supposed to clean up the trace config file before it starts browser after Zhen's fix in https://codereview.chromium.org/1818593002/
,
Apr 4 2016
Android hardcodes the file location in /data/local/chrome-trace-config.json. I verified that the trace file is indeed there when benchmark is running. The failure happens on f98a1ff33ee6d3575cdbb338b2a2f9fde11e7ee3 (March 30), so Zhen's fix is included but doesn't help.
,
Apr 4 2016
Can you show the full stack, the actual fix is in https://codereview.chromium.org/1827323003/ (See line 244 in telemetry/telemetry/page/shared_page_state.py). If that line is called before browser started, telemetry should have been able to remove the old trace file, hmhh
,
Apr 4 2016
Yes, https://codereview.chromium.org/1827323003/ is in my checkout. I checked that there is no old trace file in /data/local/chrome-trace-config.json before the benchmark starts. The file appears when the benchmark start running. The stack trace in #1 is all I get for the exception. Here is what I get with manual traceback.print_stack(): File "tools/perf/run_benchmark", line 22, in <module> sys.exit(main()) File "tools/perf/run_benchmark", line 19, in main return benchmark_runner.main(config, [trybot_command.Trybot]) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/benchmark_runner.py", line 417, in main return command_instance.Run(options) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/benchmark_runner.py", line 236, in Run return min(255, self._benchmark().Run(args)) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/benchmark.py", line 91, in Run return story_runner.RunBenchmark(self, finder_options) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/story_runner.py", line 311, in RunBenchmark benchmark.ShouldTearDownStateAfterEachStoryRun()) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/story_runner.py", line 224, in Run _RunStoryAndProcessErrorIfNeeded(story, results, state, test) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/story_runner.py", line 77, in _RunStoryAndProcessErrorIfNeeded state.WillRunStory(story) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/page/shared_page_state.py", line 262, in WillRunStory self._StartBrowser(page) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/page/shared_page_state.py", line 190, in _StartBrowser self._browser = self._possible_browser.Create(self._finder_options) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/android_browser_finder.py", line 128, in Create browser_backend, self._platform_backend, self._credentials_path) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/browser/browser.py", line 55, in __init__ self._browser_backend.Start() File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/android_browser_backend.py", line 142, in Start self._InitDevtoolsClientBackend(remote_devtools_port) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome/chrome_browser_backend.py", line 161, in _InitDevtoolsClientBackend self._port, remote_devtools_port or self._port, self) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend.py", line 127, in __init__ custom_categories=trace_config.tracing_category_filter.filter_string) File "/drive/android-chrome/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/devtools_client_backend.py", line 334, in StartChromeTracing
,
Apr 4 2016
+Kari: can you look into this?
,
Sep 2 2016
|
|||
►
Sign in to add a comment |
|||
Comment 1 by nedngu...@google.com
, Apr 1 2016