CrazyPython
6/29/2016 - 7:25 PM

pprof final script code for you googlers :) - executable will be stored in `./.executables/profiler/`; modify for yourself.

pprof final script code for you googlers :) - executable will be stored in ./.executables/profiler/; modify for yourself.

  1. download file
  2. chmod 777 profile.sh
  3. put a symlink to it in /usr/bin, or just put it in there (optional)
  1. profile.sh <cpp file>
  2. You're greeted by the pprof interactive prompt
#!/usr/bin/env bash
# Licensed under the Unlicense. Full text at (http://unlicense.org/) - CrazyPython
g++ -std=c++11 $1 -o ./.executables/profiler/$(basename $1 .cpp) -g -O -lprofiler
echo "Finished compiling + linking"
CPUPROFILE=$1.out ./.executables/profiler/$(basename $1 .cpp)
./.executables/profiler/$(basename $1 .cpp)
pprof ./.executables/profiler/$(basename $1 .cpp) $1.out