Profiling with the Gecko Profiler and Local Symbols on Windows

Profiling local talos runs

If you would like to use the Gecko Profiler with a local talos run of a local build of Firefox for Windows, you will need to point talos to a zipfile containing breakpad-style symbols for your build. Follow the steps below:

NOTE: You only need to do this if you're on Windows and you've built Firefox yourself. For any official release of Firefox (Nightly, Beta, etc), you do not need to use these steps.

  1. Add ac_add_options --enable-profiling to your Firefox .mozconfig file.
  2. Generate the Breakpad symbol files by running ./mach buildsymbols: https://developer.mozilla.org/en/Building_Firefox_with_Debug_Symbols#Breakpad_symbol_files
  3. This will have created symbols under $OBJDIR/dist/ , named after the binary name, architecture and version, so something like "firefox-40.0a1.en-US-win32.crashreporter-symbols.zip"
    Point talos to this zipfile by passing its path to the --symbolsPath flag.

Profiling local builds (without using talos)

If you would like to use the Gecko Profiler with a local build of Firefox for Windows, you will need to point the profiler to a local Snappy Symbolication Server instead of the official Mozilla symbolication server. The server will host the local Firefox symbols for the profiler and it will fetch any symbols not available locally from the official Mozilla symbolication server (e.g. symbols for Windows DLLs and plugin DLLs).

NOTE: You only need to run a local symbolication server if you're on Windows and you've built Firefox yourself. For any official release of Firefox (Nightly, Beta, etc), you do not need a local symbolication server.

How to deploy the Snappy Symbolication Server locally:

  1. Add ac_add_options --enable-profiling to your Firefox .mozconfig file.
  2. Generate the Breakpad symbol files by running ./mach buildsymbols: https://developer.mozilla.org/en/Building_Firefox_with_Debug_Symbols#Breakpad_symbol_files
  3. Get a copy of the Snappy Symbolication Server source code:
    git clone git://github.com/mozilla/Snappy-Symbolication-Server.git
  4. Follow the instructions at https://github.com/mozilla/Snappy-Symbolication-Server#quick-start-without-docker, but make sure to do the following:
    • Edit the server's sample_config.json configuration file:
      • Set DiskCache.localSymbolDirs to your crashreporter symbols (i.e. C:\mozilla-central\objdir\dist\crashreporter-symbols\)
      • Set SymServer.memCachedServers to [] (we shouldn't need memcached for a local run, and getting memcached set up on Windows would be more trouble than it's worth)
      • Set quickstart.memcached.start to false
  5. Once it's running, make a quick test request (Powershell):
    • Invoke-WebRequest -Uri "http://127.0.0.1:8080" -Method POST -ContentType 'application/json' -Body '{"stacks":[[[0,11723767],[1, 65802]]],"memoryMap":[["xul.pdb","44E4EC8C2F41492
      B9369D6B9A059577C2"],["wntdll.pdb","D74F79EB1F8D4A45ABCD2F476CCABACC2"]],"version":4}' -UseBasicParsing
      
    • The response should look something like this:
    • StatusCode        : 200
      StatusDescription : OK
      Content           : {"symbolicatedStacks": [["XREMain::XRE_mainRun() (in xul.pdb)", "KiUserCallbackDispatcher (in
                          wntdll.pdb)"]], "knownModules": [true, true]}
  6. Point the Gecko Profiler extension to the local symbolication server by adding a new string property "profiler.symbolicationUrl" to your browser's about:config page. Set the property value to http://127.0.0.1:8080

You should now be able to get full Windows and Firefox symbols in your profiler traces.

Document Tags and Contributors

 Last updated by: nnethercote,