Error using systrace on windows to debug android performance

0

I want to debug my react-native app, according to react native's docs, I need to run systrace. but it gives me this error:

Starting tracing (5 seconds)
Tracing completed. Collecting output...
Exception in thread Thread-11:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "D:\app\androidsdk\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 "D:\app\androidsdk\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 "D:\app\androidsdk\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 "D:\app\androidsdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 196, in main
    main_impl(sys.argv)
  File "D:\app\androidsdk\platform-tools\systrace\catapult\systrace\systrace\run_systrace.py", line 193, in main_impl
    controller.OutputSystraceResults(write_json=options.write_json)
  File "D:\app\androidsdk\platform-tools\systrace\catapult\systrace\systrace\systrace_runner.py", line 68, in OutputSystraceResults
    self._out_filename)
  File "D:\app\androidsdk\platform-tools\systrace\catapult\systrace\systrace\output_generator.py", line 98, in GenerateHTMLOutput
    html_file.write(_ConvertToHtmlString(result.raw_data))
  File "D:\app\androidsdk\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

and the html that I get is empty.

the command I use is:

C:\Python27\python2.exe .\systrace.py --time=5 -o trace.html sched gfx view -a com.ir.tccim

os: windows 10 64 bit

usb debugging is enabled

debugging on device: galaxy j7 pro

Ali Kazemkhanloo

Posted 2019-07-26T15:55:49.967

Reputation: 41

just found out there is System Tracing app on android pie and higher, it will create a file that can be used by systrace to visualize the results :| – Ali Kazemkhanloo – 2019-07-26T16:08:49.577

No answers