views:

40

answers:

1

Good morning

Is it possible to change the default name of the file gmon.out, which is created when the profile flag (-pg) is set when compiling with gcc, to, for example, [executable name].gmon.out?

I need this because I have more than one executables, which are located in the same directory, and have to run parallel.

thanks in advance.

A: 

In short, no. The profiling file created by running your program once it has been compiled with the -pg command is ALWAYS called gmon.out. However, once produced you can safely rename it to something else (for example foo.bar) and analyse it later using the command:

gprof test.exe foo.bar > analysis.txt
qwerty1793
Thanks for your effort. Since this is not possible, I am now profiling with cachegrind and valgrind. This worked out for me.
Emiswelt