2012-07-11 57 views
0

如何讓我的gcc -pg創建gmon.out文件而不是a.out?我試圖用gprof來剖析我的CPU,但是當我編譯我的.c文件時,我得到了一個a.out,這不是我所需要的。gcc -pg創建a.out而不是gmon.out

回答

1

當您運行編譯的程序而不是編譯時生成配置文件。

0
$ gcc -pg yourfile.C#compile with -pg 

$ ./a.out #execute it 

現在,您可以看到gmon.out文件。