Can't analyse the output (the profile file) of gperftools profiler

I'm using gperftools for analysing my C code. An as a result I can't analyze the profile file using pprof application.

$ 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
$ 

What do I wrong? What's the profile.ftab file?


You're not using the correct 'pprof' tool. In particular, you're using http://www.cs.uoregon.edu/research/tau/docs/newguide/bk03ch01s08.html (which is totally unrelated), whereas you need the one here: https://code.google.com/p/gperftools/ I had the same issue and solved the problem by downloading the gperftools' source, building it, and using ./src/pprof

链接地址: http://www.djcxy.com/p/87952.html

上一篇: 剖析C代码

下一篇: 无法分析gperftools分析器的输出(配置文件)