I have been trying to use gprof with MongoDB to do profiling. Having the corresponding build file to mongod, which is in Scons, modified to include the proper linker and compiler flags (based on the hints at How to build-in gprof support to a program built with SCons?), I am still unable to see the expected output file (gmon.out). I have made the same changes on a toy project and it's working just fine. I was wondering if there is any change that I can make on MongoDB to make it work with gprof. If there is no hope in using these two together, I'd appreciate any suggestions on other tools that I can use to get similar profiling numbers.
Asked
Active
Viewed 122 times
1
-
I assume MongoDB does a lot of I/O. *gprof* ignores I/O, and for CPU time it's very weak in calculating inclusive time, which is what you need in any non-toy program. I would think you need a wall-clock-time stack sampler. I and others use [*an old-fashioned but very effective method*](http://stackoverflow.com/a/378024/23771). – Mike Dunlavey Jun 04 '14 at 20:01