The scripts I am using to test the application change directories to get a large data-set. This affected the gmon.out
location so when the application exited it was written to that far off directory. As the GNU GProf manual says,
The gmon.out file is written in the program's current working directory at the time it exits. This means that if your program calls chdir, the gmon.out file will be left in the last directory your program chdir'd to. If you don't have permission to write in this directory, the file is not written, and you will get an error message.
Last night I had the scripts running like,
GMON_OUT_PREFIX=test1.ver1.out ./test test1.script
GMON_OUT_PREFIX=test2.ver1.out ./test test2.script
GMON_OUT_PREFIX=test3.ver1.out ./test test3.script
And although, I couldn't find the files in my working directory, I did eventually find the files in the data folder. In the above, it is not important to specify different names for the output since they are proceeded by their process id (like, GMON_OUT_PREFIX.PID
), but was necessary in my case to distinguish the tests.