Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35274

Add scons flag which enables -pg

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Build, Performance
    • 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.

      Attachments

        Activity

          People

            backlog-server-devtools DO NOT USE - Backlog - Dev Tools
            spencer.jackson@mongodb.com Spencer Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: