3 ## pyprofile: profile Python script
6 ## Copyright 2011 Michael M. Hoffman <mmh1@uw.edu>
7 ## Modified by Tao Liu: Correctly get the command name.
14 echo usage
: "$0" PROF CMDLINE...
23 # run CMD with cProfile
24 python
-m cProfile
-o $PROF $CMD
27 .
/pyprofile_stat
$PROF tottime
> ${PROF/.prof/}.tottime
28 .
/pyprofile_stat
$PROF calls
> ${PROF/.prof/}.calls
29 .
/pyprofile_stat
$PROF cumulative
> ${PROF/.prof/}.cumulative
31 echo "check ${PROF/.prof/}.tottime, ${PROF/.prof/}.calls, and ${PROF/.prof/}.cumulative"