-->

Unable to view HTML trace report generated by Syst

2019-02-05 14:26发布

问题:

I am trying to generate trace reports with Systrace tool in the Android SDK, but I cant view the report in the browser. It is blank and does not contain any information. I read in some forums that I need to open the report in Chrome browser, I opened it with Chrome as well but the report is blank.

I have enabled USB Debugging from the Developer Options and device is running Android 4.2 and I am using DDMS tool from the Android SDK to generate the traces.

http://developer.android.com/tools/help/systrace.html

回答1:

Firstly, if anyone is using Chrome v50.0+ on OS X or Windows, just try this please.

  1. open chrome browser and go to "chrome://tracing"

  2. in the tracing page, click load and select the systrace generated html file.

Secondly, I think it's a bug which is confirmed by Google.

It looks like this is because modern versions of Chrome have deprecated the Object.observe function[1][2].

For more information, please see this, https://code.google.com/p/android/issues/detail?id=57135



回答2:

I also have this problem running chrome on linux.

It seems they have bug in the implementation of javascript drawing the results.

Check JavaScript console. Mine says.

Uncaught TypeError: undefined is not a function



回答3:

On Windows , I just can see the result by doing this:

  1. get the trace.html
  2. open trace.html with chrome browser and open the chrome's developer tools then i find out there is 3 error in trace.html showing like this
  3. go to the error line ,then comment the error function like this
  4. save the modified html then refresh chrome , you can see the trace result

This is just not the best solution, but any way we can see the result.



回答4:

I was having the same issue when capturing through eclipse on Ubuntu 12.04.

Worked around it by running the tool directly from the systrace folder (sdk/tools/systrace/)

./systrace.py -t 5 -o trace.html


回答5:

Update your SDK using SDK manager, select tools and platforms tools to be updated. Follow the normal procedure, and that's it. Chrome is recomended to see results.



回答6:

I solved this issue just by updating the SDK, use the SDK manager select tools and platform tools for update and you're done. Python script doesn't work on Windows. However even if the trace.html is generated and it can be seen, when data overflows, it is not possible to see the bottom part of the page. This because wasd navigation is not enough making the use of the scroll bar needed.

To do this you need to:

  • If you're in Linux modify the Python script and eliminate the overflow:hidden wherever is found.
  • If you're using SDK, edit the trace.html and eliminate the overflow:hidden wherever is found.

Hope it helps, it'll be nice that someone in Google can fix this on the source.



回答7:

I just found the my trace.html, which failed to open in IE/Firefox/Chrome, opened fine in the latest Opera (on my Windows PC).



回答8:

For me, it didn't work on Firefox v34 but worked in Chrome v37 and I am on Ubuntu 12.04.



回答9:

I also faced similar issues while trying to open a Systrace generated html file (around 10 MB ) on Firefox 37.0.1. However the same file works brilliantly on Chromium Version 37.0.2062.120 Ubuntu 12.04 (281580) (64-bit).



回答10:

I've done following:

cd $ANDROID_HOME/platform-tools

git clone https://android.googlesource.com/platform/external/chromium-trace/

mv systrace old-systrace

ln -s chromium-trace/catapult/systrace/systrace/ systrace

that fixed my systrace issue

systrace report work in latest chrome at least



回答11:

You can try my sample trace.html file to check if your Chrome version is okay or not. https://github.com/tngotran/systrace-android/blob/master/trace.html

Also here is a link to the official trace.html sample from Google https://source.android.com/devices/tech/debug/perf_traces.zip

By the way, from my experience, the command tool python systrace.py can create an output file trace.html without error, but result is an empty file (even the file size is larger than 5Mb or more).

We have to:

  1. Run the command adb root from your terminal to restart adbd as root
  2. Run the python systrace.py again

Then check your created report .html file in Chrome :)



回答12:

Suggestion: Try to trace an emulator (they are for development)


The issue may be manufacture customization to the Android OS, making the problem potentially a device configuration issue caused by the manufacture.

There are several answers that may be helpful here.

None of these worked for me... but because of answer https://stackoverflow.com/a/52379567/1815624

I found that it would load data by using the linked trace files:

Also here is a link to the official trace.html sample from Google https://source.android.com/devices/tech/debug/perf_traces.zip

Using adb root did not work.

On a different device it worked flawlessly right off as well as using an emulator.