Profiling with gprof

Has anyone tried successfully compiling and running a program for profiling with gprof? According to some documentation on gprof, I’ve noticed that I need my program to call exit(), so I’m calling std::exit() in the ofApp class when a key is pressed. I’ve also added the -pg flags to the list of compiler flags in config.make. Unfortunately, this still doesn’t generate the necessary gprof.out file that gprof needs to do the analysis. Has anyone successfully profiled with gprof before?


hi @poofjunior have you found a way to do profiling?

@poofjunior @synthnassizer Same question here, gmon.out is not generated… Any clue ?

OF uses atexit() method to callback to ofExit() when the application calls std::exit(). Maybe this tips you on where something is going wrong (my guess is that gprof also attaches to atexit callback, but there is an issue in the callback orders)