Systrace Output Error

2019-05-01 04:00发布

I ran systrace on my android studio project in order to find some performance bugs but after the end of the tracing process, i get the following error and if i open the trace.html output file in chrome, the trace view is empty:

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

Anyone have a solution for this or any advice?

1条回答
Fickle 薄情
2楼-- · 2019-05-01 04:08

Systrace.py has a --no-compress option. Using it should allow the trace to complete without hitting the failing decompression step.

The same problem was occurring on my Windows 10 system and this solved it for me.

查看更多
登录 后发表回答