Permalink
Browse files

Merge pull request #169 from dhylands/dhylands-810536-capture

Bug 810536 - Fix capture command to make sure profilerhas been started.
  • Loading branch information...
dhylands committed Nov 12, 2012
2 parents fc63d5f + 606a410 commit 5c386da771e1ea51f862c7d1e1607878b9c05440
Showing with 9 additions and 1 deletion.
  1. +9 −1 profile.sh
View
@@ -107,7 +107,15 @@ is_profiler_running() {
#
HELP_capture="Signals, pulls, and symbolicates the profile data"
cmd_capture() {
+ # Send the signal right away. If the profiler wasn't started we'll catch
+ # that later.
cmd_signal $1
+ # Verify that b2g was started with the profiler enabled
+ if ! is_profiler_running $(get_b2g_pid); then
+ echo "Profiler doesn't seem to be running"
+ echo "Did you start the profiler using ${SCRIPT_NAME} start ?"
+ exit 1
+ fi
get_comms
declare -a local_filename
local timestamp=$(date +"%H%M")
@@ -223,7 +231,7 @@ cmd_pull() {
if [ "${profile_filename}" == "${profile_pattern}" ]; then
echo
echo "Profiler doesn't seem to have created file: '${profile_pattern}'"
- echo "Did you build with B2G_PROF=1 in your .userconfig ?"
+ echo "Did you start the profiler using ${SCRIPT_NAME} start ?"
exit 1
fi
local prev_ls

0 comments on commit 5c386da

Please sign in to comment.