OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 # Start / stop profiling in chrome. | 7 # Start / stop profiling in chrome. |
8 | 8 |
9 # The profiling data is saved to directory /sdcard/Download. The files | 9 # The profiling data is saved to directory /sdcard/Download. The files |
10 # are named beginning chrome-profile-results- | 10 # are named beginning chrome-profile-results- |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 local INTERVAL=$2 | 96 local INTERVAL=$2 |
97 shift | 97 shift |
98 shift | 98 shift |
99 echo -n "Capturing trace..." | 99 echo -n "Capturing trace..." |
100 send_intent ${PACKAGE} "GPU_PROFILER_START" $* > /dev/null | 100 send_intent ${PACKAGE} "GPU_PROFILER_START" $* > /dev/null |
101 sleep ${INTERVAL} | 101 sleep ${INTERVAL} |
102 send_intent ${PACKAGE} "GPU_PROFILER_STOP" > /dev/null | 102 send_intent ${PACKAGE} "GPU_PROFILER_STOP" > /dev/null |
103 echo "done" | 103 echo "done" |
104 | 104 |
105 echo -n "Downloading trace..." | 105 echo -n "Downloading trace..." |
| 106 sleep $[${INTERVAL} / 4 + 1] |
106 download_latest_trace | 107 download_latest_trace |
107 echo "done" | 108 echo "done" |
108 | 109 |
109 echo "Trace written to ${PWD}/${LOCAL_TRACE_FILE}" | 110 echo "Trace written to ${PWD}/${LOCAL_TRACE_FILE}" |
110 } | 111 } |
111 | 112 |
112 PACKAGE=${DEFAULT_PACKAGE:-com.android.chrome} | 113 PACKAGE=${DEFAULT_PACKAGE:-com.android.chrome} |
113 | 114 |
114 while test -n "$1"; do | 115 while test -n "$1"; do |
115 case "$1" in | 116 case "$1" in |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 if [ -z "${INTERVAL}" ] ; then | 164 if [ -z "${INTERVAL}" ] ; then |
164 if [ -z "${FUNCTION}" ] ; then | 165 if [ -z "${FUNCTION}" ] ; then |
165 usage | 166 usage |
166 else | 167 else |
167 send_intent ${PACKAGE} ${FUNCTION} ${OUTPUT} ${CATEGORIES} ${CONTINUOUS} | 168 send_intent ${PACKAGE} ${FUNCTION} ${OUTPUT} ${CATEGORIES} ${CONTINUOUS} |
168 fi | 169 fi |
169 else | 170 else |
170 do_timed_capture ${PACKAGE} ${INTERVAL} ${CATEGORIES} ${CONTINUOUS} | 171 do_timed_capture ${PACKAGE} ${INTERVAL} ${CATEGORIES} ${CONTINUOUS} |
171 fi | 172 fi |
172 exit 0 | 173 exit 0 |
OLD | NEW |