c++ - gmon.out is not created when executable forks another executable -


i using gprof profiling. gmon.out not created when fork executable inside main executable compiled option -pg. idea how resolve it.

but gmon.out not created when fork executable

it does. has same name other gmon.out files. silently overwrite each other.

gnu, in infinite wisdom, recommends each child process want profile executed in own current directory. use mkdir , chdir in code needed. since gmon.out written out process finishes, necessary chdir before calling exit.

i recommend looking @ valgrind. among other nice things, has output files named something.somethingelse.$pid.


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -