Bug 1628073 - Use mozlog in the mozgeckoprofiler; r=gbrown
authorGreg Tatum <gtatum@mozilla.com>
Fri, 22 May 2020 13:19:27 +0000
changeset 531616 e2f1ffe1f7696f9400fb27c446d147ffe1bc28fa
parent 531615 699e0e8cd072d7cb9ff4250e17020244a410ec52
child 531617 0c606644f4e3232c15742551b9a9fcc5a25bc7e6
push id37441
push userapavel@mozilla.com
push dateFri, 22 May 2020 21:38:53 +0000
treeherdermozilla-central@d6abd35b54ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1628073
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1628073 - Use mozlog in the mozgeckoprofiler; r=gbrown This patch changes over all of the logging to use the structured mozlog package. I also ensured that the messages were logged in a way to be useful for end users of mochitests. This means there were a few small changes in methods in order to accommodate the logging. The behavior outside of logging should be the same. Differential Revision: https://phabricator.services.mozilla.com/D74291
testing/mochitest/runtests.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/__init__.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/profiling.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symFileManager.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symLogging.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolicationRequest.py
testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/viewgeckoprofile.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -68,17 +68,17 @@ from leaks import ShutdownLeaks, LSANLea
 from mochitest_options import (
     MochitestArgumentParser, build_obj, get_default_valgrind_suppression_files
 )
 from mozprofile import Profile
 from mozprofile.cli import parse_preferences, parse_key_value, KeyValueParseError
 from mozprofile.permissions import ServerLocations
 from urllib import quote_plus as encodeURIComponent
 from mozlog.formatters import TbplFormatter
-from mozlog import commandline
+from mozlog import commandline, get_proxy_logger
 from mozrunner.utils import get_stack_fixer_function, test_environment
 from mozscreenshot import dump_screen
 import mozleak
 
 HAVE_PSUTIL = False
 try:
     import psutil
     HAVE_PSUTIL = True
@@ -2723,21 +2723,21 @@ toolbar#nav-bar {
             print("5 INFO SimpleTest FINISHED")
 
         # If shutdown profiling was enabled, then the user will want to access the
         # performance profile. The following code with display helpful log messages
         # and automatically open the profile if it is requested.
         if self.browserEnv and "MOZ_PROFILER_SHUTDOWN" in self.browserEnv:
             profile_path = self.browserEnv["MOZ_PROFILER_SHUTDOWN"]
 
-            print("TEST-INFO | Shutdown profiling was enabled")
-            print("TEST-INFO | Profile saved locally to: %s" % profile_path)
-            print("TEST-INFO | Symbolicating the profile... This could take a couple of minutes.")
+            profiler_logger = get_proxy_logger("profiler")
+            profiler_logger.info("Shutdown performance profiling was enabled")
+            profiler_logger.info("Profile saved locally to: %s" % profile_path)
             symbolicate_profile_json(profile_path, options.topobjdir)
-            view_gecko_profile_from_mochitest(profile_path, options)
+            view_gecko_profile_from_mochitest(profile_path, options, profiler_logger)
 
             # Clean up the temporary file if it exists.
             if self.profiler_tempdir:
                 shutil.rmtree(self.profiler_tempdir)
 
         if not result:
             if self.countfail or \
                not (self.countpass or self.counttodo):
@@ -3230,17 +3230,17 @@ def cli(args=sys.argv[1:]):
 
     return run_test_harness(parser, options)
 
 
 if __name__ == "__main__":
     sys.exit(cli())
 
 
-def view_gecko_profile_from_mochitest(profile_path, options):
+def view_gecko_profile_from_mochitest(profile_path, options, profiler_logger):
     """Getting shutdown performance profiles from just the command line arguments is
     difficult. This function makes the developer ergonomics a bit easier by taking the
     generated Gecko profile, and automatically serving it to profiler.firefox.com. The
     Gecko profile during shutdown is dumped to disk at:
 
     {objdir}/_tests/testing/mochitest/{profilename}
 
     This function takes that file, and launches a local webserver, and then points
@@ -3248,14 +3248,15 @@ def view_gecko_profile_from_mochitest(pr
     or save the profile.
     """
 
     if options.profilerSaveOnly:
         # The user did not want this to automatically open, only share the location.
         return
 
     if not os.path.exists(profile_path):
-        print("\tNo profile was found at the profile path, cannot launch profiler.firefox.com.")
+        profiler_logger.error("No profile was found at the profile path, cannot "
+                              "launch profiler.firefox.com.")
         return
 
-    print('TEST-INFO | Loading this profile in profiler.firefox.com')
+    profiler_logger.info('Loading this profile in the Firefox Profiler')
 
     view_gecko_profile(profile_path)
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/__init__.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/__init__.py
@@ -4,15 +4,16 @@
 
 """
 mozgeckoprofiler has utilities to symbolicate and load gecko profiles.
 """
 from __future__ import absolute_import
 
 from .profiling import save_gecko_profile, symbolicate_profile_json
 from .symbolication import ProfileSymbolicator
+from .viewgeckoprofile import view_gecko_profile
 
 __all__ = [
   'save_gecko_profile',
   'symbolicate_profile_json',
   'ProfileSymbolicator',
   'view_gecko_profile'
 ]
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/profiling.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/profiling.py
@@ -1,19 +1,22 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import, print_function
+from __future__ import absolute_import
 
 import json
 import tempfile
 import shutil
 import os
 import mozfile
 from .symbolication import ProfileSymbolicator
+from mozlog import get_proxy_logger
+
+LOG = get_proxy_logger('profiler')
 
 
 def save_gecko_profile(profile, filename):
     with open(filename, "w") as f:
         json.dump(profile, f)
 
 
 def symbolicate_profile_json(profile_path, objdir_path):
@@ -67,30 +70,31 @@ def symbolicate_profile_json(profile_pat
     elif os.path.isfile(symbol_path):
         symbolicator.integrate_symbol_zip_from_file(
             symbol_path
         )
     elif os.path.isdir(symbol_path):
         symbol_paths["FIREFOX"] = symbol_path
 
 
-    print("Symbolicating profile at %s" % profile_path)
+    LOG.info("Symbolicating the performance profile... This could take a couple "
+             "of minutes.")
+
     try:
         with open(profile_path, 'r') as profile_file:
             profile = json.load(profile_file)
         symbolicator.dump_and_integrate_missing_symbols(
             profile,
             missing_symbols_zip)
         symbolicator.symbolicate_profile(profile)
         # Overwrite the profile in place.
         save_gecko_profile(profile, profile_path)
     except MemoryError:
-        print(
+        LOG.error(
             "Ran out of memory while trying"
             " to symbolicate profile {0}"
             .format(profile_path)
         )
-    except Exception:
-        print("Encountered an exception during profile"
-              " symbolication {0}"
-              .format(profile_path))
+    except Exception as e:
+        LOG.error("Encountered an exception during profile symbolication")
+        LOG.error(e)
 
     shutil.rmtree(temp_dir)
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symFileManager.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symFileManager.py
@@ -4,18 +4,19 @@
 from __future__ import absolute_import
 
 import itertools
 import os
 import re
 import threading
 import time
 from bisect import bisect
+from mozlog import get_proxy_logger
 
-from .symLogging import LogTrace, LogError, LogMessage
+LOG = get_proxy_logger('profiler')
 
 # Libraries to keep prefetched
 PREFETCHED_LIBS = ["xul.pdb", "firefox.pdb"]
 
 
 class SymbolInfo:
 
     def __init__(self, addressMap):
@@ -77,17 +78,17 @@ class SymFileManager:
         try:
             if libName in self.sCache and breakpadId in self.sCache[libName]:
                 libSymbolMap = self.sCache[libName][breakpadId]
                 self.UpdateMruList(libName, breakpadId)
         finally:
             self.sCacheLock.release()
 
         if libSymbolMap is None:
-            LogTrace(
+            LOG.debug(
                 "Need to fetch PDB file for " + libName + " " + breakpadId)
 
             # Guess the name of the .sym or .nmsym file on disk
             if libName[-4:] == ".pdb":
                 symFileNameWithoutExtension = re.sub(r"\.[^\.]+$", "", libName)
             else:
                 symFileNameWithoutExtension = libName
 
@@ -98,71 +99,71 @@ class SymFileManager:
                 pathSuffix = os.sep + libName + os.sep + \
                     breakpadId + os.sep + symFileName
                 path = self.sOptions["symbolPaths"][source] + pathSuffix
                 libSymbolMap = self.FetchSymbolsFromFile(path)
                 if libSymbolMap:
                     break
 
             if not libSymbolMap:
-                LogTrace("No matching sym files, tried " + str(symbolSources))
+                LOG.debug("No matching sym files, tried " + str(symbolSources))
                 return None
 
-            LogTrace("Storing libSymbolMap under [" + libName + "][" +
-                     breakpadId + "]")
+            LOG.debug("Storing libSymbolMap under [" + libName + "][" +
+                      breakpadId + "]")
             self.sCacheLock.acquire()
             try:
                 self.MaybeEvict(libSymbolMap.GetEntryCount())
                 if libName not in self.sCache:
                     self.sCache[libName] = {}
                 self.sCache[libName][breakpadId] = libSymbolMap
                 self.sCacheCount += libSymbolMap.GetEntryCount()
                 self.UpdateMruList(libName, breakpadId)
-                LogTrace(str(self.sCacheCount) +
-                         " symbols in cache after fetching symbol file")
+                LOG.debug(str(self.sCacheCount) +
+                          " symbols in cache after fetching symbol file")
             finally:
                 self.sCacheLock.release()
 
         return libSymbolMap
 
     def FetchSymbolsFromFile(self, path):
         try:
             symFile = open(path, "r")
         except Exception as e:
-            LogTrace("Error opening file " + path + ": " + str(e))
+            LOG.debug("Error opening file " + path + ": " + str(e))
             return None
 
-        LogMessage("Parsing SYM file at " + path)
+        LOG.debug("Parsing SYM file at " + path)
 
         try:
             symbolMap = {}
             lineNum = 0
             publicCount = 0
             funcCount = 0
             if path.endswith(".sym"):
                 for line in symFile:
                     lineNum += 1
                     if line[0:7] == "PUBLIC ":
                         line = line.rstrip()
                         fields = line.split(" ")
                         if len(fields) < 4:
-                            LogTrace("Line " + str(lineNum) + " is messed")
+                            LOG.debug("Line " + str(lineNum) + " is messed")
                             continue
                         if fields[1] == "m":
                             address = int(fields[2], 16)
                             symbolMap[address] = " ".join(fields[4:])
                         else:
                             address = int(fields[1], 16)
                             symbolMap[address] = " ".join(fields[3:])
                         publicCount += 1
                     elif line[0:5] == "FUNC ":
                         line = line.rstrip()
                         fields = line.split(" ")
                         if len(fields) < 5:
-                            LogTrace("Line " + str(lineNum) + " is messed")
+                            LOG.debug("Line " + str(lineNum) + " is messed")
                             continue
                         if fields[1] == "m":
                             address = int(fields[2], 16)
                             symbolMap[address] = " ".join(fields[5:])
                         else:
                             address = int(fields[1], 16)
                             symbolMap[address] = " ".join(fields[4:])
                         funcCount += 1
@@ -181,32 +182,32 @@ class SymFileManager:
                     # The letter has a meaning, but we ignore it.
                     if line[addressLength + 2] == " ":
                         symbol = line[addressLength + 3:].rstrip()
                     else:
                         symbol = line[addressLength + 1:].rstrip()
                     symbolMap[address] = symbol
                     publicCount += 1
         except Exception:
-            LogError("Error parsing SYM file " + path)
+            LOG.error("Error parsing SYM file " + path)
             return None
 
         logString = "Found " + \
             str(len(symbolMap.keys())) + " unique entries from "
         logString += str(publicCount) + " PUBLIC lines, " + \
             str(funcCount) + " FUNC lines"
-        LogTrace(logString)
+        LOG.debug(logString)
 
         return SymbolInfo(symbolMap)
 
     def PrefetchRecentSymbolFiles(self):
         """This method runs in a loop. Use the options "prefetchThreshold" to adjust"""
         global PREFETCHED_LIBS
 
-        LogMessage("Prefetching recent symbol files")
+        LOG.info("Prefetching recent symbol files")
         # Schedule next timer callback
         interval = self.sOptions['prefetchInterval'] * 60 * 60
         self.sCallbackTimer = threading.Timer(
             interval, self.PrefetchRecentSymbolFiles)
         self.sCallbackTimer.start()
 
         thresholdTime = time.time() - \
             self.sOptions['prefetchThreshold'] * 60 * 60
@@ -220,20 +221,20 @@ class SymFileManager:
                 symbolDirs = os.listdir(topLibPath)
                 for symbolDir in symbolDirs:
                     candidatePath = topLibPath + os.sep + symbolDir
                     mtime = os.path.getmtime(candidatePath)
                     if mtime > thresholdTime:
                         symDirsToInspect[pdbName].append(
                             (mtime, candidatePath))
             except Exception as e:
-                LogError("Error while pre-fetching: " + str(e))
+                LOG.error("Error while pre-fetching: " + str(e))
 
-            LogMessage("Found " + str(len(symDirsToInspect[pdbName])) +
-                       " new " + pdbName + " recent dirs")
+            LOG.info("Found " + str(len(symDirsToInspect[pdbName])) +
+                     " new " + pdbName + " recent dirs")
 
             # Only prefetch the most recent N entries
             symDirsToInspect[pdbName].sort(reverse=True)
             symDirsToInspect[pdbName] = symDirsToInspect[pdbName][
                 :self.sOptions['prefetchMaxSymbolsPerLib']]
 
         # Don't fetch symbols already in cache.
         # Ideally, mutex would be held from check to insert in self.sCache,
@@ -265,18 +266,18 @@ class SymFileManager:
                 if symbolInfo:
                     # Stop if the prefetched items are bigger than the cache
                     if fetchedCount + symbolInfo.GetEntryCount() > \
                             self.sOptions["maxCacheEntries"]:
                         break
                     fetchedSymbols[(pdbName, pdbId)] = symbolInfo
                     fetchedCount += symbolInfo.GetEntryCount()
                 else:
-                    LogError("Couldn't fetch .sym file symbols for " +
-                             symbolFilePath)
+                    LOG.error("Couldn't fetch .sym file symbols for " +
+                              symbolFilePath)
                     continue
 
         # Insert new symbols into global symbol cache
         self.sCacheLock.acquire()
         try:
             # Make room for the new symbols
             self.MaybeEvict(fetchedCount)
 
@@ -292,28 +293,28 @@ class SymFileManager:
                 self.sCacheCount += newSymbolFile.GetEntryCount()
 
                 # Move new symbols to front of MRU list to give them a chance
                 self.UpdateMruList(pdbName, pdbId)
 
         finally:
             self.sCacheLock.release()
 
-        LogMessage("Finished prefetching recent symbol files")
+        LOG.info("Finished prefetching recent symbol files")
 
     def UpdateMruList(self, pdbName, pdbId):
         libId = (pdbName, pdbId)
         if libId in self.sMruSymbols:
             self.sMruSymbols.remove(libId)
         self.sMruSymbols.insert(0, libId)
 
     def MaybeEvict(self, freeEntriesNeeded):
         maxCacheSize = self.sOptions["maxCacheEntries"]
-        LogTrace("Cache occupancy before MaybeEvict: " +
-                 str(self.sCacheCount) + "/" + str(maxCacheSize))
+        LOG.debug("Cache occupancy before MaybeEvict: " +
+                  str(self.sCacheCount) + "/" + str(maxCacheSize))
 
         if self.sCacheCount == 0 or \
                 self.sCacheCount + freeEntriesNeeded <= maxCacheSize:
             # No need to lock mutex here, this doesn't need to be 100%
             return
 
         # If adding the new entries would exceed the max cache size,
         # evict so that cache is at 70% capacity after new entries added
@@ -330,10 +331,10 @@ class SymFileManager:
             evicteeCount = self.sCache[pdbName][pdbId].GetEntryCount()
 
             del self.sCache[pdbName][pdbId]
             self.sCacheCount -= evicteeCount
             self.sMruSymbols.pop()
 
             numToEvict -= evicteeCount
 
-        LogTrace("Cache occupancy after MaybeEvict: " +
-                 str(self.sCacheCount) + "/" + str(maxCacheSize))
+        LOG.debug("Cache occupancy after MaybeEvict: " +
+                  str(self.sCacheCount) + "/" + str(maxCacheSize))
deleted file mode 100644
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symLogging.py
+++ /dev/null
@@ -1,27 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-from __future__ import absolute_import, print_function
-
-import sys
-import threading
-import time
-
-gEnableTracing = False
-
-
-def LogTrace(string):
-    global gEnableTracing
-    if gEnableTracing:
-        threadName = threading.currentThread().getName().ljust(12)
-        print(time.asctime() + " " + threadName + " TRACE " + string, file=sys.stdout)
-
-
-def LogError(string):
-    threadName = threading.currentThread().getName().ljust(12)
-    print(time.asctime() + " " + threadName + " ERROR " + string, file=sys.stderr)
-
-
-def LogMessage(string):
-    threadName = threading.currentThread().getName().ljust(12)
-    print(time.asctime() + " " + threadName + "       " + string, file=sys.stdout)
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py
@@ -6,21 +6,23 @@ from __future__ import absolute_import
 import cStringIO
 import hashlib
 import os
 import platform
 import subprocess
 import urllib2
 import zipfile
 from distutils import spawn
+from mozlog import get_proxy_logger
 
 from .symFileManager import SymFileManager
-from .symLogging import LogMessage
 from .symbolicationRequest import SymbolicationRequest
 
+LOG = get_proxy_logger("profiler")
+
 """
 Symbolication is broken when using type 'str' in python 2.7, so we use 'basestring'.
 But for python 3.0 compatibility, 'basestring' isn't defined, but the 'str' type works.
 So we force 'basestring' to 'str'.
 """
 try:
     basestring
 except NameError:
@@ -144,25 +146,25 @@ class ProfileSymbolicator:
             elif platform.system() == "Linux":
                 return LinuxSymbolDumper()
         except SymbolError:
             return None
 
     def integrate_symbol_zip_from_url(self, symbol_zip_url):
         if self.have_integrated(symbol_zip_url):
             return
-        LogMessage("Retrieving symbol zip from {symbol_zip_url}...".format(
+        LOG.info("Retrieving symbol zip from {symbol_zip_url}...".format(
             symbol_zip_url=symbol_zip_url))
         try:
             io = urllib2.urlopen(symbol_zip_url, None, 30)
             with zipfile.ZipFile(cStringIO.StringIO(io.read())) as zf:
                 self.integrate_symbol_zip(zf)
             self._create_file_if_not_exists(self._marker_file(symbol_zip_url))
         except IOError:
-            LogMessage("Symbol zip request failed.")
+            LOG.info("Symbol zip request failed.")
 
     def integrate_symbol_zip_from_file(self, filename):
         if self.have_integrated(filename):
             return
         with open(filename, 'rb') as f:
             with zipfile.ZipFile(f) as zf:
                 self.integrate_symbol_zip(zf)
         self._create_file_if_not_exists(self._marker_file(filename))
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolicationRequest.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolicationRequest.py
@@ -1,18 +1,19 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 from __future__ import absolute_import
 
 import json
 import re
 import urllib2
+from mozlog import get_proxy_logger
 
-from .symLogging import LogTrace, LogError
+LOG = get_proxy_logger('profiler')
 
 # Precompiled regex for validating lib names
 # Empty lib name means client couldn't associate frame with any lib
 gLibNameRE = re.compile("[0-9a-zA-Z_+\-\.]*$")
 
 # Maximum number of times a request can be forwarded to a different server
 # for symbolication. Also prevents loops.
 MAX_FORWARDED_REQUESTS = 3
@@ -32,21 +33,21 @@ class ModuleV3:
 
     def __init__(self, libName, breakpadId):
         self.libName = libName
         self.breakpadId = breakpadId
 
 
 def getModuleV3(libName, breakpadId):
     if not isinstance(libName, basestring) or not gLibNameRE.match(libName):
-        LogTrace("Bad library name: " + str(libName))
+        LOG.debug("Bad library name: " + str(libName))
         return None
 
     if not isinstance(breakpadId, basestring):
-        LogTrace("Bad breakpad id: " + str(breakpadId))
+        LOG.debug("Bad breakpad id: " + str(breakpadId))
         return None
 
     return ModuleV3(libName, breakpadId)
 
 
 class SymbolicationRequest:
 
     def __init__(self, symFileManager, rawRequests):
@@ -66,116 +67,116 @@ class SymbolicationRequest:
         self.stacks = []
         self.forwardCount = 0
 
     def ParseRequests(self, rawRequests):
         self.isValidRequest = False
 
         try:
             if not isinstance(rawRequests, dict):
-                LogTrace("Request is not a dictionary")
+                LOG.debug("Request is not a dictionary")
                 return
 
             if "version" not in rawRequests:
-                LogTrace("Request is missing 'version' field")
+                LOG.debug("Request is missing 'version' field")
                 return
             version = rawRequests["version"]
             if version != 4:
-                LogTrace("Invalid version: %s" % version)
+                LOG.debug("Invalid version: %s" % version)
                 return
 
             if "forwarded" in rawRequests:
                 if not isinstance(rawRequests["forwarded"], (int, int)):
-                    LogTrace("Invalid 'forwards' field: %s"
-                             % rawRequests["forwarded"])
+                    LOG.debug("Invalid 'forwards' field: %s"
+                              % rawRequests["forwarded"])
                     return
                 self.forwardCount = rawRequests["forwarded"]
 
             # Client specifies which sets of symbols should be used
             if "symbolSources" in rawRequests:
                 try:
                     sourceList = [x.upper()
                                   for x in rawRequests["symbolSources"]]
                     for source in sourceList:
                         if source in self.symFileManager\
                                 .sOptions["symbolPaths"]:
                             self.symbolSources.append(source)
                         else:
-                            LogTrace("Unrecognized symbol source: " + source)
+                            LOG.debug("Unrecognized symbol source: " + source)
                             continue
                 except Exception:
                     self.symbolSources = []
                     pass
 
             if not self.symbolSources:
                 self.symbolSources.append(
                     self.symFileManager.sOptions["defaultApp"])
                 self.symbolSources.append(
                     self.symFileManager.sOptions["defaultOs"])
 
             if "memoryMap" not in rawRequests:
-                LogTrace("Request is missing 'memoryMap' field")
+                LOG.debug("Request is missing 'memoryMap' field")
                 return
             memoryMap = rawRequests["memoryMap"]
             if not isinstance(memoryMap, list):
-                LogTrace("'memoryMap' field in request is not a list")
+                LOG.debug("'memoryMap' field in request is not a list")
 
             if "stacks" not in rawRequests:
-                LogTrace("Request is missing 'stacks' field")
+                LOG.debug("Request is missing 'stacks' field")
                 return
             stacks = rawRequests["stacks"]
             if not isinstance(stacks, list):
-                LogTrace("'stacks' field in request is not a list")
+                LOG.debug("'stacks' field in request is not a list")
                 return
 
             # Check memory map is well-formatted
             cleanMemoryMap = []
             for module in memoryMap:
                 if not isinstance(module, list):
-                    LogTrace(
+                    LOG.debug(
                         "Entry in memory map is not a list: " + str(module))
                     return
 
                 if len(module) != 2:
-                    LogTrace("Entry in memory map is not a 2 item list: " +
-                             str(module))
+                    LOG.debug("Entry in memory map is not a 2 item list: " +
+                              str(module))
                     return
                 module = getModuleV3(*module)
 
                 if module is None:
                     return
 
                 cleanMemoryMap.append(module)
 
             self.combinedMemoryMap = cleanMemoryMap
             self.knownModules = [False] * len(self.combinedMemoryMap)
 
             # Check stack is well-formatted
             for stack in stacks:
                 if not isinstance(stack, list):
-                    LogTrace("stack is not a list")
+                    LOG.debug("stack is not a list")
                     return
                 for entry in stack:
                     if not isinstance(entry, list):
-                        LogTrace("stack entry is not a list")
+                        LOG.debug("stack entry is not a list")
                         return
                     if len(entry) != 2:
-                        LogTrace("stack entry doesn't have exactly 2 elements")
+                        LOG.debug("stack entry doesn't have exactly 2 elements")
                         return
 
                 self.stacks.append(stack)
 
         except Exception as e:
-            LogTrace("Exception while parsing request: " + str(e))
+            LOG.debug("Exception while parsing request: " + str(e))
             return
 
         self.isValidRequest = True
 
     def ForwardRequest(self, indexes, stack, modules, symbolicatedStack):
-        LogTrace("Forwarding " + str(len(stack)) + " PCs for symbolication")
+        LOG.debug("Forwarding " + str(len(stack)) + " PCs for symbolication")
 
         try:
             url = self.symFileManager.sOptions["remoteSymbolServer"]
             rawModules = []
             moduleToIndex = {}
             newIndexToOldIndex = {}
             for moduleIndex, m in modules:
                 l = [m.libName, m.breakpadId]
@@ -211,48 +212,48 @@ class SymbolicationRequest:
                         # Try again with version 3
                         requestVersion = 3
                         continue
                     raise e
                 succeededVersion = requestVersion
                 break
 
         except Exception as e:
-            LogError("Exception while forwarding request: " + str(e))
+            LOG.error("Exception while forwarding request: " + str(e))
             return
 
         try:
             responseJson = json.loads(response.read())
         except Exception as e:
-            LogError("Exception while reading server response to forwarded"
-                     " request: " + str(e))
+            LOG.error("Exception while reading server response to forwarded"
+                      " request: " + str(e))
             return
 
         try:
             if succeededVersion == 4:
                 responseKnownModules = responseJson['knownModules']
                 for newIndex, known in enumerate(responseKnownModules):
                     if known and newIndex in newIndexToOldIndex:
                         self.knownModules[newIndexToOldIndex[newIndex]] = True
 
                 responseSymbols = responseJson['symbolicatedStacks'][0]
             else:
                 responseSymbols = responseJson[0]
             if len(responseSymbols) != len(stack):
-                LogError(str(len(responseSymbols)) + " symbols in response, " +
-                         str(len(stack)) + " PCs in request!")
+                LOG.error(str(len(responseSymbols)) + " symbols in response, " +
+                          str(len(stack)) + " PCs in request!")
                 return
 
             for index in range(0, len(stack)):
                 symbol = responseSymbols[index]
                 originalIndex = indexes[index]
                 symbolicatedStack[originalIndex] = symbol
         except Exception as e:
-            LogError("Exception while parsing server response to forwarded"
-                     " request: " + str(e))
+            LOG.error("Exception while parsing server response to forwarded"
+                      " request: " + str(e))
             return
 
     def Symbolicate(self, stackNum):
         # Check if we should forward requests when required sym files don't
         # exist
         shouldForwardRequests = False
         if self.symFileManager.sOptions["remoteSymbolServer"] and \
                 self.forwardCount < MAX_FORWARDED_REQUESTS:
--- a/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/viewgeckoprofile.py
+++ b/testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/viewgeckoprofile.py
@@ -7,39 +7,39 @@
 from __future__ import absolute_import
 
 import argparse
 import os
 import socket
 import sys
 import urllib
 
-from mozlog import commandline, get_default_logger
+from mozlog import commandline, get_proxy_logger
 from mozlog.commandline import add_logging_group
 
 import SocketServer
 import SimpleHTTPServer
 
 here = os.path.abspath(os.path.dirname(__file__))
+LOG = get_proxy_logger('profiler')
 
 
 class ProfileServingHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
     """Extends the basic SimpleHTTPRequestHandler (which serves a directory
     of files) to include request headers required by profiler.firefox.com"""
 
     def end_headers(self):
         self.send_header("Access-Control-Allow-Origin", "https://profiler.firefox.com")
         SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
 
 
 class ViewGeckoProfile(object):
     """Container class for ViewGeckoProfile"""
 
     def __init__(self, gecko_profile_data_path):
-        self.log = get_default_logger(component='view-gecko-profile')
         self.gecko_profile_data_path = gecko_profile_data_path
         self.gecko_profile_dir = os.path.dirname(gecko_profile_data_path)
         self.profiler_url = "https://profiler.firefox.com/from-url/"
         self.httpd = None
         self.host = '127.0.0.1'
         self.port = None
         self.oldcwd = os.getcwd()
 
@@ -49,39 +49,33 @@ class ViewGeckoProfile(object):
         sock.bind(('', 0))
         self.port = sock.getsockname()[1]
         sock.close()
 
         # Temporarily change the directory to the profile directory.
         os.chdir(self.gecko_profile_dir)
         self.httpd = SocketServer.TCPServer((self.host, self.port),
                                             ProfileServingHTTPRequestHandler)
-        self.log.info("File server started at: %s:%s" % (self.host, self.port))
 
     def handle_single_request(self):
         self.httpd.handle_request()
         # Go back to the old cwd, which some infrastructure may be relying on.
         os.chdir(self.oldcwd)
 
     def encode_url(self):
         # Encode url i.e.: https://profiler.firefox.com/from-url/http...
-        url = "http://{}:{}/{}".format(self.host, self.port,
-                                       os.basename(self.gecko_profile_data_path))
-        self.log.info("raw url is:")
-        self.log.info(url)
-        encoded_url = urllib.quote(url, safe='')
-        self.log.info('encoded url is:')
-        self.log.info(encoded_url)
-        self.profiler_url = self.profiler_url + encoded_url
-        self.log.info('full url is:')
-        self.log.info(self.profiler_url)
+        file_url = "http://{}:{}/{}".format(self.host, self.port,
+                                            os.path.basename(self.gecko_profile_data_path))
+
+        self.profiler_url = self.profiler_url + urllib.quote(file_url, safe='')
+        LOG.info("Temporarily serving the profile from: %s" % file_url)
 
     def open_profile_in_browser(self):
         # Open the file in the user's preferred browser.
-        self.log.info("Opening the profile data in profiler.firefox.com...")
+        LOG.info("Opening the profile: %s" % self.profiler_url)
         import webbrowser
         webbrowser.open_new_tab(self.profiler_url)
 
 
 def create_parser(mach_interface=False):
     parser = argparse.ArgumentParser()
     add_arg = parser.add_argument