Reputation: 29
How can I make my gcc -pg create a gmon.out file instead of an a.out? I'm trying to profile my CPU using gprof, but when I compile my .c file I get an a.out, which is not what I need.
Upvotes: 0
Views: 449
Reputation: 36423
The profile is generated when you run the compiled program, not upon compilation.
Upvotes: 1
Reputation: 121347
$ gcc -pg yourfile.c #compile with -pg
$ ./a.out #execute it
Now, you can see the gmon.out
file.
Upvotes: 0