File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 33event=cpu
44format=flat
55seconds=12
6- usage =" Usage: profile [-h] [-s seconds] [-w seconds] [-e event] [-f format] [--] executable args"
6+ usage1 =" Usage: profile [-h] [-s seconds] [-w seconds] [-e event] [-f format] [--] executable args"
77usage2=" Usage: profile [options] executable args\nOptions:\n\t[-h] [-s seconds] [-w seconds]\n\t[-e cpu|alloc|nativemem|lock|cache-misses]\n\t[-f flat|traces|collapsed|flamegraph|tree|jfr|otlp]"
88
99while getopts s:f:e:o:w:h opt
1616 w) warmup=$OPTARG ;;
1717 h) echo -e $usage2 && exit 0 ;;
1818 --) break ;;
19- \? ) echo $usage && exit 1 ;;
20- # :) echo $usage && exit 2 ;;
19+ \? ) echo $usage1 && exit 1 ;;
20+ # :) echo $usage1 && exit 2 ;;
2121 esac
2222done
2323
@@ -26,10 +26,10 @@ executable=$1
2626arguments=${@: 2}
2727
2828which asprof >& /dev/null
29- [ " $? " -ne 0 ] && echo ' ERROR: asprof is not in $PATH.' && exit 3
29+ [ " $? " -ne 0 ] && echo ' ERROR: asprof is not in $PATH.' && echo -e $usage2 && exit 3
3030
3131which $executable >& /dev/null
32- [ " $? " -ne 0 ] && echo " ERROR: $executable is not in \$ PATH." && exit 4
32+ [ " $? " -ne 0 ] && echo " ERROR: $executable is not in \$ PATH." && echo -e $usage2 && exit 4
3333
3434echo " Running asprof on '$executable $arguments ' ..."
3535
You can’t perform that action at this time.
0 commit comments