GProf profiling

From Emergent

Jump to: navigation, search

Contents

Using gprof profiler on Emergent

Compiling

This sets key g++ flag = -pg. also adds a _prof suffix to program, and defines GPROF ./configure --enable-profile

Coding: switching on and off

extern "C" moncontrol(int mode);

  • to turn on: moncontrol(1);
  • off; moncontrol(0);
  • ta/ta_project taRootBase has a MonControl function (in #MENU) enabled in GPROF mode.

Getting results

  • output goes to gmon.out when program quits (must not crash!)
  • src/emergent/bin/gprof_run has shell script to run:
  • gprof .libs/emergent_prof++ gmon.out | c++filt >$1
  • do man gprof to get info on how to read results.
Personal tools