Details
-
Improvement
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
-
Developer Tools
Description
Gprof is a performance profiler. To enable it, you must pass the -pg flag to the compiler. Binaries so compiled will dump performance counters to 'gmon.out' on process exit. However, mongod does not exit normally, which prevents 'gmon.out' from being generated. To properly flush the counters, we must declare an external function called "_mcleanup()" and call it during quickExit. This is a pattern used for coverage analysis, where we manually declare and call GCov's __gcov_flush function.
We should add a scons flag which passes -pg to the compiler, and enables a preprocessor flag which enables the declaration and call of _mcleanup.