Created
August 7, 2020 17:27
-
-
Save dayeol/95cf3d68fc3d162cd6345a1331e69578 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| NOW=$(date +"%Y-%m-%d-%H:%M:%S") | |
| PERFDATA="perf.script" | |
| INDIR=$1 | |
| NAME=$2 | |
| OUTDIR="$(pwd)/results/$2.$NOW" | |
| STACKCOLLAPSE=~/FlameGraph/stackcollapse-perf.pl | |
| FLAMEGRAPH=~/FlameGraph/flamegraph.pl | |
| if [ ! -f "$INDIR/$PERFDATA" ]; then | |
| echo "$INDIR/$PERFDATA does not exist!"; | |
| exit -1; | |
| fi | |
| # move perf output data | |
| echo "Generating $OUTDIR" | |
| mkdir -p $OUTDIR | |
| sudo chown $USER:$USER $INDIR/$PERFDATA | |
| sudo cp $INDIR/perf.* $OUTDIR/ | |
| sudo chown root:root $OUTDIR/$PERFDATA | |
| cd $OUTDIR; cat $PERFDATA | \ | |
| $STACKCOLLAPSE --all --addrs | \ | |
| $FLAMEGRAPH > $OUTDIR/$NAME.svg | |
| echo "Download:" | |
| echo " scp $USER@mehlow-prequal06.jf.intel.com:$OUTDIR/$NAME.svg ." | |
| cd - | |
| # remove original files | |
| sudo rm $INDIR/perf.* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment