我在我的android工作室项目上运行systrace以查找一些性能错误但是在跟踪过程结束后,我收到以下错误,如果我在chrome中打开trace.html输出文件,则跟踪视图为空:
Starting tracing (10 seconds)
Tracing completed. Collecting output...
Exception in thread Thread-13:
Traceback (most recent call last):
File "C:\Python27\lib\threading.py", line 801, in __bootstrap_inner
self.run()
File "C:\Python27\lib\threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 194, in _collect_and_preprocess
self._trace_data = self._preprocess_trace_data(trace_data)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 272, in _preprocess_trace_data
trace_data = strip_and_decompress_trace(trace_data)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\tracing_agents\atrace_agent.py", line 332, in strip_and_decompress_trace
trace_data = zlib.decompress(trace_data)
error: Error -5 while decompressing data: incomplete or truncated stream
Outputting Systrace results...
Tracing complete, writing results
Traceback (most recent call last):
File "systrace.py", line 49, in <module>
sys.exit(run_systrace.main())
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 196, in main
main_impl(sys.argv)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 193, in main_impl
controller.OutputSystraceResults(write_json=options.write_json)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\systrace_runner.py", line 68, in OutputSystraceResults
self._out_filename)
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 98, in GenerateHTMLOutput
html_file.write(_ConvertToHtmlString(result.raw_data))
File "C:\Users\Steli\AppData\Local\Android\sdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 120, in _ConvertToHtmlString
raise ValueError('Invalid trace result format for HTML output')
ValueError: Invalid trace result format for HTML output
任何人都有这个或任何建议的解决方案吗?
答案 0 :(得分:2)
Systrace.py具有--no-compress选项。使用它应该使跟踪完成,而无需执行失败的解压缩步骤。
我的Windows 10系统上发生了同样的问题,这为我解决了这个问题。