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

all threads must call ProfilerRegisterThread() for gperftools

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.6.0
    • Component/s: Diagnostics
    • Labels:
      None
    • ALL
    • Hide

      see https://code.google.com/p/gperftools/issues/detail?id=335 where gperftool maintainers admit this is probably needed and the thread at https://groups.google.com/forum/#!topic/google-perftools/gEpE7_AdibI. This is a regression in gperftools as it wasn't needed in the near past. But many, many years ago it was needed when I was profiling mysqld. I added the call to ProfilerRegisterThread to to handleIncomingMsg.

      In this case I compiled the server with --user-cpu-profiler, called _cpuProfilerStart, ran a workload, called _cpuProfilerStop

      Show
      see https://code.google.com/p/gperftools/issues/detail?id=335 where gperftool maintainers admit this is probably needed and the thread at https://groups.google.com/forum/#!topic/google-perftools/gEpE7_AdibI . This is a regression in gperftools as it wasn't needed in the near past. But many, many years ago it was needed when I was profiling mysqld. I added the call to ProfilerRegisterThread to to handleIncomingMsg. In this case I compiled the server with --user-cpu-profiler, called _cpuProfilerStart, ran a workload, called _cpuProfilerStop

      To get CPU profiling from gperftools on recent Linux systems/kernels, all threads should call ProfilerRegisterThread. This issue is forked from https://jira.mongodb.org/browse/SERVER-6628

      Without adding the calls to ProfilerRegisterThread the gperftools profiler output file has nothing useful...
      pprof --pdf /path/to/mongod /path/to/profiler/output
      Using local file mongodb-src-r2.6.0/build/linux2/norm/mongo/mongod.
      Using local file prof2.260.
      No nodes to print

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            mdcallag Mark Callaghan
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: