adb_profile_chrome is used to capture and download traces from Chrome on
Android. To prepare for future feature improvements and reduce the
maintenance burden, rewrite this bash script in Python.
This reimplementation keeps all the features and command line options of
the original and adds these new ones:
--trace-cc Enable extra trace categories for compositor frame
viewer data.
--trace-gpu Enable extra trace categories for GPU data.
-z, --compress Compress the resulting trace with gzip.
BUG=299822,294883
Review URL: https://codereview.chromium.org/25044004
git-svn-id: http://src.chromium.org/svn/trunk/src/build@226259 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
When downloading the latest trace file from Chrome, wait for Chrome to
actually finish writing it to avoid getting back a partially written
trace.
Chrome logs two different messages related to tracing:
1. "Logging performance trace to file [...]"
2. "Profiler finished. Results are in [...]"
The first one is printed when tracing starts and the second one indicates
that the trace file is ready to be downloaded.
We have to look for both of these messages to make sure we get the results
from the latest trace and that the trace file is complete. This is done by
first looking for the last instance of the first message and then checking
for the second message in the remaining part of the log.
Review URL: https://chromiumcodereview.appspot.com/23477016
git-svn-id: http://src.chromium.org/svn/trunk/src/build@220298 4ff67af0-8c30-449e-8e8b-ad334ec8d88c