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
Post a Comment