Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何让我的 gcc -pg 创建一个 gmon.out 文件而不是 a.out?我正在尝试使用 gprof 分析我的 CPU,但是当我编译我的 .c 文件时,我得到了一个 a.out,这不是我需要的。
配置文件是在您运行已编译的程序时生成的,而不是在编译时生成的。
$ gcc -pg yourfile.c #compile with -pg $ ./a.out #execute it
现在,您可以看到该gmon.out文件。
gmon.out