Skip to content

Commit

Permalink
Bug 1084226 - Add TaskTracer feature to profile.sh. r=BenWa
Browse files Browse the repository at this point in the history
  • Loading branch information
shellylin committed Oct 28, 2014
1 parent b948ccf commit 3082a56
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions profile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ start_with_args() {
${ADB} shell rm $fileName &> /dev/null
features=""
threads=""
tasktracer=""
while getopts "i:m:t:f:p:e:s:" opt "$@"; do
case $opt in
Expand Down Expand Up @@ -198,15 +199,31 @@ start_with_args() {
fi
fi
if [ -z "$B2G_PID" ]
if [ -n "`echo $features | grep tasktracer`" ]
then
echo "No B2G process specified. Exiting"
exit 1
else
echo "Starting profiling PID $B2G_PID.."
${ADB} shell "kill -12 ${B2G_PID}"
tasktracer="true"
clear_pids
get_pids
echo "Enable feature TaskTracer requires profiling on all current running processes."
for pid in ${B2G_PIDS[*]}; do
echo "Starting profiling with TaskTracer on PID ${pid}"
${ADB} shell "kill -12 ${pid}"
done
echo "Profiler started"
echo
fi
if [ -z "$tasktracer" ]
then
if [ -z "$B2G_PID" ]
then
echo "No B2G process specified. Exiting"
exit 1
else
echo "Starting profiling PID $B2G_PID"
${ADB} shell "kill -12 ${B2G_PID}"
echo "Profiler started"
echo
fi
fi
}
Expand Down

0 comments on commit 3082a56

Please sign in to comment.