我使用喷雾器来分析我的C代码。因此,我无法使用pprof应用程序分析概要文件。
$ gcc -g prog.c -o prog -lprofiler
$ export CPUPROFILE=info.prof
$ ./prog
Inside main()
Inside func1
Inside new_func1()
Inside func2
PROFILE: interrupts/evictions/bytes = 1133/0/300
$ ls
info.prof prog prog.c
$ ls -lah info.prof
-rw-rw-r-- 1 mm mm 2.6K Jun 6 09:36 info.prof
$ pprof info.prof prog
Reading Profile files in profile.*
Error: Could not open profile.0.0.0: No such file or directory
profile.ftab: No such file or directory
$ 我做错什么了?profile.ftab文件是什么?
发布于 2014-11-14 05:02:57
你没有使用正确的'pprof‘工具。特别是,您使用的是http://www.cs.uoregon.edu/research/tau/docs/newguide/bk03ch01s08.html (这是完全不相关的),而您需要这里的一个:https://code.google.com/p/gperftools/ I有相同的问题,并通过下载gperftools的源代码、构建它和使用./src/pprof来解决这个问题。
发布于 2018-12-27 16:23:06
我刚刚遇到了这个问题,我认为在最近版本的Ubuntu (特别是18.04)中,应该提到如何处理这个问题。
当您尝试运行pprof命令时,系统建议安装tau包:
Command 'pprof' not found, but can be installed with:
sudo apt install tau但是,不要安装这个软件包,因为正如David在他的回答中指出的那样,它是完全不相关的。相反,请安装google-perftools包,但是要注意它中的可执行文件名为google-pprof,而不仅仅是pprof。
https://stackoverflow.com/questions/24086867
复制相似问题