diff options
author | Pavel Kirienko <pavel.kirienko@gmail.com> | 2015-01-16 21:00:48 +0300 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-21 14:54:23 +0100 |
commit | c0937ec8cac523d4c8fad028584e2b87956f3019 (patch) | |
tree | 33e4a4cf418605b6df28a4875c62d996d4e21d5b /Debug/poor-mans-profiler.sh | |
parent | 9293950cdb17af28e344f710f9121e606710a006 (diff) | |
download | px4-firmware-c0937ec8cac523d4c8fad028584e2b87956f3019.tar.gz px4-firmware-c0937ec8cac523d4c8fad028584e2b87956f3019.tar.bz2 px4-firmware-c0937ec8cac523d4c8fad028584e2b87956f3019.zip |
Profiler fixes
Diffstat (limited to 'Debug/poor-mans-profiler.sh')
-rwxr-xr-x | Debug/poor-mans-profiler.sh | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/Debug/poor-mans-profiler.sh b/Debug/poor-mans-profiler.sh index 1d76eaa44..d2393b296 100755 --- a/Debug/poor-mans-profiler.sh +++ b/Debug/poor-mans-profiler.sh @@ -14,6 +14,21 @@ set -e root=$(dirname $0)/.. +function die() +{ + echo "$@" + exit 1 +} + +function usage() +{ + echo "Invalid usage. Supported options:" + cat $0 | sed -n 's/^\s*--\([^)\*]*\).*/\1/p' # Don't try this at home. + exit 1 +} + +which flamegraph.pl > /dev/null || die "Install flamegraph.pl first" + # # Parsing the arguments. Read this section for usage info. # @@ -25,13 +40,6 @@ append=0 fgfontsize=5 fgwidth=1900 -function usage() -{ - echo "Invalid usage. Supported options:" - cat $0 | sed -n 's/^\s*--\([^)\*]*\).*/\1/p' # Don't try this at home. - exit 1 -} - for i in "$@" do case $i in @@ -103,10 +111,7 @@ fi # # Folding the stacks. # -if [ ! -f $stacksfile ]; then - echo "Where are the stack samples?" - exit 1 -fi +[ -f $stacksfile ] || die "Where are the stack samples?" cat $stacksfile | perl -e 'use File::Basename; my $current = ""; |