我正在尝试使用gprof配置我们的软件,但是当我执行以下命令时
gprof <binary-name> gmon.out我收到以下错误:
gprof: dimension unit changed between histogram records
gprof: from 'seconds'
gprof: to ''我假设我的二进制文件生成的是gmon.out,因此,编译器在编译过程中一定有-pg开关。
我做错了什么?
发布于 2018-05-20 15:42:55
来自AmeyaVS的评论已经暗示了答案:
# compile and link with -pg
gcc -pg file.c -o file
# run program to generate the gmon.out file
./file
# run gprof on your executable with matching gmon.out
gprof file gmon.out发布于 2019-04-05 11:02:10
尽量不要在守护进程或父子模式下运行应用程序。
https://stackoverflow.com/questions/44488066
复制相似问题