Bug 1170534 - Remove Visual Event Tracer. r=dougt
authorHonza Bambas <honzab.moz@firemni.cz>
Tue, 02 Jun 2015 11:44:00 -0400
changeset 269661 57718eaf0d6a344be3005ab151ccb45afb0bf47d
parent 269660 8cdcc90a47385c90660ceb9aa7b349b931fa6df0
child 269662 b95c3dd6b73e345c0746c9ab3cc411426277e075
push id2540
push userwcosta@mozilla.com
push dateWed, 03 Jun 2015 20:55:41 +0000
reviewersdougt
bugs1170534
milestone41.0a1
Bug 1170534 - Remove Visual Event Tracer. r=dougt
configure.in
docshell/base/nsDocShell.cpp
netwerk/base/nsSocketTransport2.cpp
netwerk/cache/nsCacheEntry.cpp
netwerk/cache/nsCacheService.cpp
netwerk/cache/nsDiskCacheMap.cpp
netwerk/cache/nsDiskCacheStreams.cpp
netwerk/cache2/CacheFileIOManager.cpp
netwerk/cache2/CacheIOThread.cpp
netwerk/cache2/CacheStorageService.cpp
netwerk/dns/nsDNSService2.cpp
netwerk/dns/nsHostResolver.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
xpcom/base/VisualEventTracer.cpp
xpcom/base/VisualEventTracer.h
xpcom/base/moz.build
xpcom/base/nsIVisualEventTracer.idl
xpcom/build/XPCOMInit.cpp
xpcom/build/XPCOMModule.inc
--- a/configure.in
+++ b/configure.in
@@ -7429,27 +7429,16 @@ fi
 dnl ========================================================
 dnl =
 dnl = Profiling and Instrumenting
 dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Profiling and Instrumenting)
 
 dnl ========================================================
-dnl = Enable runtime visual profiling logger
-dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
-[  --enable-visual-event-tracer   Enable visual event tracer instrumentation],
-    MOZ_VISUAL_EVENT_TRACER=1,
-    MOZ_VISUAL_EVENT_TRACER=)
-if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
-    AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
-fi
-
-dnl ========================================================
 dnl = Enable TaskTracer
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(tasktracer,
 [  --enable-tasktracer       Set compile flags necessary for using TaskTracer],
     MOZ_TASK_TRACER=1,
     MOZ_TASK_TRACER= )
 if test "$MOZ_WIDGET_TOOLKIT" = "gonk" -a -n "$MOZ_TASK_TRACER"; then
     AC_DEFINE(MOZ_TASK_TRACER)
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/workers/ServiceWorkerManager.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Services.h"
 #include "mozilla/StartupTimeline.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/unused.h"
-#include "mozilla/VisualEventTracer.h"
 #include "URIUtils.h"
 
 #include "nsIContent.h"
 #include "nsIContentInlines.h"
 #include "nsIDocument.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 
@@ -7495,18 +7494,16 @@ nsDocShell::OnSecurityChange(nsIWebProgr
 nsresult
 nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
                         nsIChannel* aChannel, nsresult aStatus)
 {
   if (!aChannel) {
     return NS_ERROR_NULL_POINTER;
   }
 
-  MOZ_EVENT_TRACER_DONE(this, "docshell::pageload");
-
   nsCOMPtr<nsIURI> url;
   nsresult rv = aChannel->GetURI(getter_AddRefs(url));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsITimedChannel> timingChannel = do_QueryInterface(aChannel);
   if (timingChannel) {
@@ -10477,23 +10474,16 @@ nsDocShell::DoURILoad(nsIURI* aURI,
                       nsIRequest** aRequest,
                       bool aIsNewWindowTarget,
                       bool aBypassClassifier,
                       bool aForceAllowCookies,
                       const nsAString& aSrcdoc,
                       nsIURI* aBaseURI,
                       nsContentPolicyType aContentPolicyType)
 {
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  nsAutoCString urlSpec;
-  aURI->GetAsciiSpec(urlSpec);
-  MOZ_EVENT_TRACER_NAME_OBJECT(this, urlSpec.BeginReading());
-  MOZ_EVENT_TRACER_EXEC(this, "docshell::pageload");
-#endif
-
   nsresult rv;
   nsCOMPtr<nsIURILoader> uriLoader;
 
   uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -17,17 +17,16 @@
 #include "nsNetUtil.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "plstr.h"
 #include "prerr.h"
 #include "NetworkActivityMonitor.h"
 #include "NSSErrorsService.h"
 #include "mozilla/net/NeckoChild.h"
-#include "mozilla/VisualEventTracer.h"
 #include "nsThreadUtils.h"
 #include "nsISocketProviderService.h"
 #include "nsISocketProvider.h"
 #include "nsISSLSocketControl.h"
 #include "nsIPipe.h"
 #include "nsIClassInfoImpl.h"
 #include "nsURLHelper.h"
 #include "nsIDNSService.h"
@@ -779,18 +778,16 @@ nsSocketTransport::CleanupTypes()
 }
 
 nsresult
 nsSocketTransport::Init(const char **types, uint32_t typeCount,
                         const nsACString &host, uint16_t port,
                         const nsACString &hostRoute, uint16_t portRoute,
                         nsIProxyInfo *givenProxyInfo)
 {
-    MOZ_EVENT_TRACER_NAME_OBJECT(this, host.BeginReading());
-
     nsCOMPtr<nsProxyInfo> proxyInfo;
     if (givenProxyInfo) {
         proxyInfo = do_QueryInterface(givenProxyInfo);
         NS_ENSURE_ARG(proxyInfo);
     }
 
     // init socket type info
 
@@ -1392,17 +1389,16 @@ nsSocketTransport::InitiateSocket()
                 return NS_ERROR_FAILURE;
             }
             mBindAddr = nullptr;
         }
     }
 
     NetAddrToPRNetAddr(&mNetAddr, &prAddr);
 
-    MOZ_EVENT_TRACER_EXEC(this, "net::tcp::connect");
     status = PR_Connect(fd, &prAddr, NS_SOCKET_CONNECT_TIMEOUT);
     if (status == PR_SUCCESS) {
         // 
         // we are connected!
         //
         OnSocketConnected();
     }
     else {
@@ -1637,18 +1633,16 @@ nsSocketTransport::OnSocketConnected()
     // Ensure keepalive is configured correctly if previously enabled.
     if (mKeepaliveEnabled) {
         nsresult rv = SetKeepaliveEnabledInternal(true);
         if (NS_WARN_IF(NS_FAILED(rv))) {
             SOCKET_LOG(("  SetKeepaliveEnabledInternal failed rv[0x%x]", rv));
         }
     }
 
-    MOZ_EVENT_TRACER_DONE(this, "net::tcp::connect");
-
     SendStatus(NS_NET_STATUS_CONNECTED_TO);
 }
 
 PRFileDesc *
 nsSocketTransport::GetFD_Locked()
 {
     mLock.AssertCurrentThreadOwns();
 
@@ -2439,17 +2433,16 @@ nsSocketTransport::SetSendBufferSize(uin
 NS_IMETHODIMP
 nsSocketTransport::OnLookupComplete(nsICancelable *request,
                                     nsIDNSRecord  *rec,
                                     nsresult       status)
 {
     // flag host lookup complete for the benefit of the ResolveHost method.
     mResolving = false;
 
-    MOZ_EVENT_TRACER_WAIT(this, "net::tcp::connect");
     nsresult rv = PostEvent(MSG_DNS_LOOKUP_COMPLETE, status, rec);
 
     // if posting a message fails, then we should assume that the socket
     // transport has been shutdown.  this should never happen!  if it does
     // it means that the socket transport service was shutdown before the
     // DNS service.
     if (NS_FAILED(rv))
         NS_WARNING("unable to post DNS lookup complete message");
--- a/netwerk/cache/nsCacheEntry.cpp
+++ b/netwerk/cache/nsCacheEntry.cpp
@@ -12,17 +12,16 @@
 #include "nsCacheMetaData.h"
 #include "nsCacheRequest.h"
 #include "nsThreadUtils.h"
 #include "nsError.h"
 #include "nsICacheService.h"
 #include "nsCacheService.h"
 #include "nsCacheDevice.h"
 #include "nsHashKeys.h"
-#include "mozilla/VisualEventTracer.h"
 
 using namespace mozilla;
 
 nsCacheEntry::nsCacheEntry(const nsACString &   key,
                            bool                 streamBased,
                            nsCacheStoragePolicy storagePolicy)
     : mKey(key),
       mFetchCount(0),
@@ -40,18 +39,16 @@ nsCacheEntry::nsCacheEntry(const nsACStr
     PR_INIT_CLIST(this);
     PR_INIT_CLIST(&mRequestQ);
     PR_INIT_CLIST(&mDescriptorQ);
 
     if (streamBased) MarkStreamBased();
     SetStoragePolicy(storagePolicy);
 
     MarkPublic();
-
-    MOZ_EVENT_TRACER_NAME_OBJECT(this, key.BeginReading());
 }
 
 
 nsCacheEntry::~nsCacheEntry()
 {
     MOZ_COUNT_DTOR(nsCacheEntry);
     
     if (mData)
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -36,17 +36,16 @@
 #include "nsDeleteDir.h"
 #include "nsNetCID.h"
 #include <math.h>  // for log()
 #include "mozilla/Services.h"
 #include "nsITimer.h"
 #include "mozIStorageService.h"
 
 #include "mozilla/net/NeckoCommon.h"
-#include "mozilla/VisualEventTracer.h"
 #include <algorithm>
 
 using namespace mozilla;
 
 /******************************************************************************
  * nsCacheProfilePrefObserver
  *****************************************************************************/
 #define DISK_CACHE_ENABLE_PREF      "browser.cache.disk.enable"
@@ -966,18 +965,16 @@ nsCacheProfilePrefObserver::CacheCompres
 /******************************************************************************
  * nsProcessRequestEvent
  *****************************************************************************/
 
 class nsProcessRequestEvent : public nsRunnable {
 public:
     explicit nsProcessRequestEvent(nsCacheRequest *aRequest)
     {
-        MOZ_EVENT_TRACER_NAME_OBJECT(aRequest, aRequest->mKey.get());
-        MOZ_EVENT_TRACER_WAIT(aRequest, "net::cache::ProcessRequest");
         mRequest = aRequest;
     }
 
     NS_IMETHOD Run()
     {
         nsresult rv;
 
         NS_ASSERTION(mRequest->mListener,
@@ -1134,18 +1131,16 @@ nsCacheService::Init()
 
     CACHE_LOG_INIT();
 
     nsresult rv;
 
     mStorageService = do_GetService("@mozilla.org/storage/service;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    MOZ_EVENT_TRACER_NAME_OBJECT(nsCacheService::gService, "nsCacheService");
-
     rv = NS_NewNamedThread("Cache I/O",
                            getter_AddRefs(mCacheIOThread));
     if (NS_FAILED(rv)) {
         NS_RUNTIMEABORT("Can't create cache IO thread");
     }
 
     rv = nsDeleteDir::Init();
     if (NS_FAILED(rv)) {
@@ -1874,22 +1869,16 @@ public:
         : mListener(listener)      // transfers reference
         , mDescriptor(descriptor)  // transfers reference (may be null)
         , mAccessGranted(accessGranted)
         , mStatus(status)
     {}
 
     NS_IMETHOD Run()
     {
-        mozilla::eventtracer::AutoEventTracer tracer(
-            static_cast<nsIRunnable*>(this),
-            eventtracer::eExec,
-            eventtracer::eDone,
-            "net::cache::OnCacheEntryAvailable");
-
         mListener->OnCacheEntryAvailable(mDescriptor, mAccessGranted, mStatus);
 
         NS_RELEASE(mListener);
         NS_IF_RELEASE(mDescriptor);
         return NS_OK;
     }
 
 private:
@@ -1921,33 +1910,25 @@ nsCacheService::NotifyListener(nsCacheRe
                                      accessGranted, status);
     if (!ev) {
         // Better to leak listener and descriptor if we fail because we don't
         // want to destroy them inside the cache service lock or on potentially
         // the wrong thread.
         return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    MOZ_EVENT_TRACER_NAME_OBJECT(ev.get(), request->mKey.get());
-    MOZ_EVENT_TRACER_WAIT(ev.get(), "net::cache::OnCacheEntryAvailable");
     return request->mThread->Dispatch(ev, NS_DISPATCH_NORMAL);
 }
 
 
 nsresult
 nsCacheService::ProcessRequest(nsCacheRequest *           request,
                                bool                       calledFromOpenCacheEntry,
                                nsICacheEntryDescriptor ** result)
 {
-    mozilla::eventtracer::AutoEventTracer tracer(
-        request,
-        eventtracer::eExec,
-        eventtracer::eDone,
-        "net::cache::ProcessRequest");
-
     // !!! must be called with mLock held !!!
     nsresult           rv;
     nsCacheEntry *     entry = nullptr;
     nsCacheEntry *     doomedEntry = nullptr;
     nsCacheAccessMode  accessGranted = nsICache::ACCESS_NONE;
     if (result) *result = nullptr;
 
     while(1) {  // Activate entry loop
@@ -2099,22 +2080,16 @@ nsresult
 nsCacheService::ActivateEntry(nsCacheRequest * request, 
                               nsCacheEntry ** result,
                               nsCacheEntry ** doomedEntry)
 {
     CACHE_LOG_DEBUG(("Activate entry for request %p\n", request));
     if (!mInitialized || mClearingEntries)
         return NS_ERROR_NOT_AVAILABLE;
 
-    mozilla::eventtracer::AutoEventTracer tracer(
-        request,
-        eventtracer::eExec,
-        eventtracer::eDone,
-        "net::cache::ActivateEntry");
-
     nsresult        rv = NS_OK;
 
     NS_ASSERTION(request != nullptr, "ActivateEntry called with no request");
     if (result) *result = nullptr;
     if (doomedEntry) *doomedEntry = nullptr;
     if ((!request) || (!result) || (!doomedEntry))
         return NS_ERROR_NULL_POINTER;
 
@@ -2206,23 +2181,16 @@ nsCacheService::ActivateEntry(nsCacheReq
 
 
 nsCacheEntry *
 nsCacheService::SearchCacheDevices(nsCString * key, nsCacheStoragePolicy policy, bool *collision)
 {
     Telemetry::AutoTimer<Telemetry::CACHE_DEVICE_SEARCH_2> timer;
     nsCacheEntry * entry = nullptr;
 
-    MOZ_EVENT_TRACER_NAME_OBJECT(key, key->BeginReading());
-    eventtracer::AutoEventTracer searchCacheDevices(
-        key,
-        eventtracer::eExec,
-        eventtracer::eDone,
-        "net::cache::SearchCacheDevices");
-
     CACHE_LOG_DEBUG(("mMemoryDevice: 0x%p\n", mMemoryDevice));
 
     *collision = false;
     if ((policy == nsICache::STORE_ANYWHERE) || (policy == nsICache::STORE_IN_MEMORY)) {
         // If there is no memory device, then there is nothing to search...
         if (mMemoryDevice) {
             entry = mMemoryDevice->FindEntry(key, collision);
             CACHE_LOG_DEBUG(("Searching mMemoryDevice for key %s found: 0x%p, "
@@ -2681,23 +2649,21 @@ nsCacheService::Lock(mozilla::Telemetry:
         lockerID = mainThreadLockerID;
         generalID = mozilla::Telemetry::CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_2;
     } else {
         lockerID = mozilla::Telemetry::HistogramCount;
         generalID = mozilla::Telemetry::CACHE_SERVICE_LOCK_WAIT_2;
     }
 
     TimeStamp start(TimeStamp::Now());
-    MOZ_EVENT_TRACER_WAIT(nsCacheService::gService, "net::cache::lock");
 
     gService->mLock.Lock();
     gService->LockAcquired();
 
     TimeStamp stop(TimeStamp::Now());
-    MOZ_EVENT_TRACER_EXEC(nsCacheService::gService, "net::cache::lock");
 
     // Telemetry isn't thread safe on its own, but this is OK because we're
     // protecting it with the cache lock. 
     if (lockerID != mozilla::Telemetry::HistogramCount) {
         mozilla::Telemetry::AccumulateTimeDelta(lockerID, start, stop);
     }
     mozilla::Telemetry::AccumulateTimeDelta(generalID, start, stop);
 }
@@ -2708,18 +2674,16 @@ nsCacheService::Unlock()
     gService->mLock.AssertCurrentThreadOwns();
 
     nsTArray<nsISupports*> doomed;
     doomed.SwapElements(gService->mDoomedObjects);
 
     gService->LockReleased();
     gService->mLock.Unlock();
 
-    MOZ_EVENT_TRACER_DONE(nsCacheService::gService, "net::cache::lock");
-
     for (uint32_t i = 0; i < doomed.Length(); ++i)
         doomed[i]->Release();
 }
 
 void
 nsCacheService::ReleaseObject_Locked(nsISupports * obj,
                                      nsIEventTarget * target)
 {
@@ -2815,22 +2779,16 @@ nsCacheService::DeactivateEntry(nsCacheE
         delete entry; // because no one else will
     }
 }
 
 
 nsresult
 nsCacheService::ProcessPendingRequests(nsCacheEntry * entry)
 {
-    mozilla::eventtracer::AutoEventTracer tracer(
-        entry,
-        eventtracer::eExec,
-        eventtracer::eDone,
-        "net::cache::ProcessPendingRequests");
-
     nsresult            rv = NS_OK;
     nsCacheRequest *    request = (nsCacheRequest *)PR_LIST_HEAD(&entry->mRequestQ);
     nsCacheRequest *    nextRequest;
     bool                newWriter = false;
     
     CACHE_LOG_DEBUG(("ProcessPendingRequests for %sinitialized %s %salid entry %p\n",
                     (entry->IsInitialized()?"" : "Un"),
                     (entry->IsDoomed()?"DOOMED" : ""),
--- a/netwerk/cache/nsDiskCacheMap.cpp
+++ b/netwerk/cache/nsDiskCacheMap.cpp
@@ -15,17 +15,16 @@
 #include "nsPrintfCString.h"
 
 #include "nsISerializable.h"
 #include "nsSerializationHelper.h"
 
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Snprintf.h"
 #include "mozilla/Telemetry.h"
-#include "mozilla/VisualEventTracer.h"
 #include <algorithm>
 
 using namespace mozilla;
 
 /******************************************************************************
  *  nsDiskCacheMap
  *****************************************************************************/
 
@@ -887,22 +886,16 @@ nsDiskCacheMap::CreateDiskCacheEntry(nsD
 
 
 nsresult
 nsDiskCacheMap::WriteDiskCacheEntry(nsDiskCacheBinding *  binding)
 {
     CACHE_LOG_DEBUG(("CACHE: WriteDiskCacheEntry [%x]\n",
         binding->mRecord.HashNumber()));
 
-    mozilla::eventtracer::AutoEventTracer writeDiskCacheEntry(
-        binding->mCacheEntry,
-        mozilla::eventtracer::eExec,
-        mozilla::eventtracer::eDone,
-        "net::cache::WriteDiskCacheEntry");
-
     nsresult            rv        = NS_OK;
     uint32_t            size;
     nsDiskCacheEntry *  diskEntry =  CreateDiskCacheEntry(binding, &size);
     if (!diskEntry)  return NS_ERROR_UNEXPECTED;
     
     uint32_t  fileIndex = CalculateFileIndex(size);
 
     // Deallocate old storage if necessary    
@@ -1017,22 +1010,16 @@ nsDiskCacheMap::ReadDataCacheBlocks(nsDi
 
 
 nsresult
 nsDiskCacheMap::WriteDataCacheBlocks(nsDiskCacheBinding * binding, char * buffer, uint32_t size)
 {
     CACHE_LOG_DEBUG(("CACHE: WriteDataCacheBlocks [%x size=%u]\n",
         binding->mRecord.HashNumber(), size));
 
-    mozilla::eventtracer::AutoEventTracer writeDataCacheBlocks(
-        binding->mCacheEntry,
-        mozilla::eventtracer::eExec,
-        mozilla::eventtracer::eDone,
-        "net::cache::WriteDataCacheBlocks");
-
     nsresult  rv = NS_OK;
     
     // determine block file & number of blocks
     uint32_t  fileIndex  = CalculateFileIndex(size);
     uint32_t  blockCount = 0;
     int32_t   startBlock = 0;
 
     if (size > 0) {
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -11,17 +11,16 @@
 #include "nsDiskCacheStreams.h"
 #include "nsCacheService.h"
 #include "mozilla/FileUtils.h"
 #include "nsThreadUtils.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include <algorithm>
-#include "mozilla/VisualEventTracer.h"
 
 // we pick 16k as the max buffer size because that is the threshold above which
 //      we are unable to store the data in the cache block files
 //      see nsDiskCacheMap.[cpp,h]
 #define kMaxBufferSize      (16 * 1024)
 
 // Assumptions:
 //      - cache descriptors live for life of streams
@@ -531,22 +530,16 @@ nsDiskCacheStreamIO::OpenCacheFile(int f
     // create PRFileDesc for input stream - the 00600 is just for consistency
     return localFile->OpenNSPRFileDesc(flags, 00600, fd);
 }
 
 
 nsresult
 nsDiskCacheStreamIO::ReadCacheBlocks(uint32_t bufferSize)
 {
-    mozilla::eventtracer::AutoEventTracer readCacheBlocks(
-        mBinding->mCacheEntry,
-        mozilla::eventtracer::eExec,
-        mozilla::eventtracer::eDone,
-        "net::cache::ReadCacheBlocks");
-
     NS_ASSERTION(mStreamEnd == mBinding->mCacheEntry->DataSize(), "bad stream");
     NS_ASSERTION(bufferSize <= kMaxBufferSize, "bufferSize too large for buffer");
     NS_ASSERTION(mStreamEnd <= bufferSize, "data too large for buffer");
 
     nsDiskCacheRecord * record = &mBinding->mRecord;
     if (!record->DataLocationInitialized()) return NS_OK;
 
     NS_ASSERTION(record->DataFile() != kSeparateFile, "attempt to read cache blocks on separate file");
@@ -560,22 +553,16 @@ nsDiskCacheStreamIO::ReadCacheBlocks(uin
     nsDiskCacheMap *map = mDevice->CacheMap();  // get map reference
     return map->ReadDataCacheBlocks(mBinding, mBuffer, mStreamEnd);
 }
 
 
 nsresult
 nsDiskCacheStreamIO::FlushBufferToFile()
 {
-    mozilla::eventtracer::AutoEventTracer flushBufferToFile(
-        mBinding->mCacheEntry,
-        mozilla::eventtracer::eExec,
-        mozilla::eventtracer::eDone,
-        "net::cache::FlushBufferToFile");
-
     nsresult  rv;
     nsDiskCacheRecord * record = &mBinding->mRecord;
     
     if (!mFD) {
         if (record->DataLocationInitialized() && (record->DataFile() > 0)) {
             // remove cache block storage
             nsDiskCacheMap * cacheMap = mDevice->CacheMap();
             rv = cacheMap->DeleteStorage(record, nsDiskCache::kData);
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -22,17 +22,16 @@
 #include "nsICacheStorageVisitor.h"
 #include "nsISizeOf.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Services.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "private/pprio.h"
-#include "mozilla/VisualEventTracer.h"
 #include "mozilla/Preferences.h"
 #include "nsNetUtil.h"
 
 // include files for ftruncate (or equivalent)
 #if defined(XP_UNIX)
 #include <unistd.h>
 #elif defined(XP_WIN)
 #include <windows.h>
@@ -548,19 +547,16 @@ public:
   OpenFileEvent(const nsACString &aKey, uint32_t aFlags,
                 CacheFileIOListener *aCallback)
     : mFlags(aFlags)
     , mCallback(aCallback)
     , mKey(aKey)
   {
     MOZ_COUNT_CTOR(OpenFileEvent);
     mIOMan = CacheFileIOManager::gInstance;
-
-    MOZ_EVENT_TRACER_NAME_OBJECT(static_cast<nsIRunnable*>(this), aKey.BeginReading());
-    MOZ_EVENT_TRACER_WAIT(static_cast<nsIRunnable*>(this), "net::cache::open-background");
   }
 
 protected:
   ~OpenFileEvent()
   {
     MOZ_COUNT_DTOR(OpenFileEvent);
   }
 
@@ -570,40 +566,34 @@ public:
     nsresult rv = NS_OK;
 
     if (!(mFlags & CacheFileIOManager::SPECIAL_FILE)) {
       SHA1Sum sum;
       sum.update(mKey.BeginReading(), mKey.Length());
       sum.finish(mHash);
     }
 
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::open-background");
     if (!mIOMan) {
       rv = NS_ERROR_NOT_INITIALIZED;
     } else {
       if (mFlags & CacheFileIOManager::SPECIAL_FILE) {
         rv = mIOMan->OpenSpecialFileInternal(mKey, mFlags,
                                              getter_AddRefs(mHandle));
       } else {
         rv = mIOMan->OpenFileInternal(&mHash, mKey, mFlags,
                                       getter_AddRefs(mHandle));
       }
       mIOMan = nullptr;
       if (mHandle) {
-        MOZ_EVENT_TRACER_NAME_OBJECT(mHandle.get(), mKey.get());
         if (mHandle->Key().IsEmpty()) {
           mHandle->Key() = mKey;
         }
       }
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::open-background");
-
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::open-result");
     mCallback->OnFileOpened(mHandle, rv);
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::open-result");
 
     return NS_OK;
   }
 
 protected:
   SHA1Sum::Hash                 mHash;
   uint32_t                      mFlags;
   nsCOMPtr<CacheFileIOListener> mCallback;
@@ -618,45 +608,37 @@ public:
             int32_t aCount, CacheFileIOListener *aCallback)
     : mHandle(aHandle)
     , mOffset(aOffset)
     , mBuf(aBuf)
     , mCount(aCount)
     , mCallback(aCallback)
   {
     MOZ_COUNT_CTOR(ReadEvent);
-
-    MOZ_EVENT_TRACER_NAME_OBJECT(static_cast<nsIRunnable*>(this), aHandle->Key().get());
-    MOZ_EVENT_TRACER_WAIT(static_cast<nsIRunnable*>(this), "net::cache::read-background");
   }
 
 protected:
   ~ReadEvent()
   {
     MOZ_COUNT_DTOR(ReadEvent);
   }
 
 public:
   NS_IMETHOD Run()
   {
     nsresult rv;
 
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::read-background");
     if (mHandle->IsClosed()) {
       rv = NS_ERROR_NOT_INITIALIZED;
     } else {
       rv = CacheFileIOManager::gInstance->ReadInternal(
         mHandle, mOffset, mBuf, mCount);
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::read-background");
-
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::read-result");
+
     mCallback->OnDataRead(mHandle, mBuf, rv);
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::read-result");
-
     return NS_OK;
   }
 
 protected:
   nsRefPtr<CacheFileHandle>     mHandle;
   int64_t                       mOffset;
   char                         *mBuf;
   int32_t                       mCount;
@@ -672,19 +654,16 @@ public:
     , mOffset(aOffset)
     , mBuf(aBuf)
     , mCount(aCount)
     , mValidate(aValidate)
     , mTruncate(aTruncate)
     , mCallback(aCallback)
   {
     MOZ_COUNT_CTOR(WriteEvent);
-
-    MOZ_EVENT_TRACER_NAME_OBJECT(static_cast<nsIRunnable*>(this), aHandle->Key().get());
-    MOZ_EVENT_TRACER_WAIT(static_cast<nsIRunnable*>(this), "net::cache::write-background");
   }
 
 protected:
   ~WriteEvent()
   {
     MOZ_COUNT_DTOR(WriteEvent);
 
     if (!mCallback && mBuf) {
@@ -692,37 +671,32 @@ protected:
     }
   }
 
 public:
   NS_IMETHOD Run()
   {
     nsresult rv;
 
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::write-background");
     if (mHandle->IsClosed()) {
       rv = NS_ERROR_NOT_INITIALIZED;
     } else {
       rv = CacheFileIOManager::gInstance->WriteInternal(
           mHandle, mOffset, mBuf, mCount, mValidate, mTruncate);
       if (NS_FAILED(rv) && !mCallback) {
         // No listener is going to handle the error, doom the file
         CacheFileIOManager::gInstance->DoomFileInternal(mHandle);
       }
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::write-background");
-
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::write-result");
     if (mCallback) {
       mCallback->OnDataWritten(mHandle, mBuf, rv);
     } else {
       free(const_cast<char *>(mBuf));
       mBuf = nullptr;
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::write-result");
 
     return NS_OK;
   }
 
 protected:
   nsRefPtr<CacheFileHandle>     mHandle;
   int64_t                       mOffset;
   const char                   *mBuf;
@@ -735,45 +709,38 @@ protected:
 class DoomFileEvent : public nsRunnable {
 public:
   DoomFileEvent(CacheFileHandle *aHandle,
                 CacheFileIOListener *aCallback)
     : mCallback(aCallback)
     , mHandle(aHandle)
   {
     MOZ_COUNT_CTOR(DoomFileEvent);
-
-    MOZ_EVENT_TRACER_NAME_OBJECT(static_cast<nsIRunnable*>(this), aHandle->Key().get());
-    MOZ_EVENT_TRACER_WAIT(static_cast<nsIRunnable*>(this), "net::cache::doom-background");
   }
 
 protected:
   ~DoomFileEvent()
   {
     MOZ_COUNT_DTOR(DoomFileEvent);
   }
 
 public:
   NS_IMETHOD Run()
   {
     nsresult rv;
 
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::doom-background");
     if (mHandle->IsClosed()) {
       rv = NS_ERROR_NOT_INITIALIZED;
     } else {
       rv = CacheFileIOManager::gInstance->DoomFileInternal(mHandle);
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::doom-background");
-
-    MOZ_EVENT_TRACER_EXEC(static_cast<nsIRunnable*>(this), "net::cache::doom-result");
+
     if (mCallback) {
       mCallback->OnFileDoomed(mHandle, rv);
     }
-    MOZ_EVENT_TRACER_DONE(static_cast<nsIRunnable*>(this), "net::cache::doom-result");
 
     return NS_OK;
   }
 
 protected:
   nsCOMPtr<CacheFileIOListener> mCallback;
   nsCOMPtr<nsIEventTarget>      mTarget;
   nsRefPtr<CacheFileHandle>     mHandle;
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -5,17 +5,16 @@
 #include "CacheIOThread.h"
 #include "CacheFileIOManager.h"
 
 #include "nsIRunnable.h"
 #include "nsISupportsImpl.h"
 #include "nsPrintfCString.h"
 #include "nsThreadUtils.h"
 #include "mozilla/IOInterposer.h"
-#include "mozilla/VisualEventTracer.h"
 
 namespace mozilla {
 namespace net {
 
 CacheIOThread* CacheIOThread::sSelf = nullptr;
 
 NS_IMPL_ISUPPORTS(CacheIOThread, nsIThreadObserver)
 
@@ -191,19 +190,16 @@ void CacheIOThread::ThreadFunc()
 loopStart:
       // Reset the lowest level now, so that we can detect a new event on
       // a lower level (i.e. higher priority) has been scheduled while
       // executing any previously scheduled event.
       mLowestLevelWaiting = LAST_LEVEL;
 
       // Process xpcom events first
       while (mHasXPCOMEvents) {
-        eventtracer::AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone,
-          "net::cache::io::level(xpcom)");
-
         mHasXPCOMEvents = false;
         mCurrentlyExecutingLevel = XPCOM_LEVEL;
 
         MonitorAutoUnlock unlock(mMonitor);
 
         bool processedEvent;
         nsresult rv;
         do {
@@ -260,19 +256,16 @@ static const char* const sLevelTraceName
   "net::cache::io::level(9)",
   "net::cache::io::level(10)",
   "net::cache::io::level(11)",
   "net::cache::io::level(12)"
 };
 
 void CacheIOThread::LoopOneLevel(uint32_t aLevel)
 {
-  eventtracer::AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone,
-    sLevelTraceName[aLevel]);
-
   nsTArray<nsCOMPtr<nsIRunnable> > events;
   events.SwapElements(mEventQueue[aLevel]);
   uint32_t length = events.Length();
 
   mCurrentlyExecutingLevel = aLevel;
 
   bool returnEvents = false;
   uint32_t index;
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -24,17 +24,16 @@
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsWeakReference.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/DebugOnly.h"
-#include "mozilla/VisualEventTracer.h"
 #include "mozilla/Services.h"
 
 namespace mozilla {
 namespace net {
 
 namespace {
 
 void AppendMemoryStorageID(nsAutoCString &key)
--- a/netwerk/dns/nsDNSService2.cpp
+++ b/netwerk/dns/nsDNSService2.cpp
@@ -29,17 +29,16 @@
 #include "nsIOService.h"
 #include "nsCharSeparatedTokenizer.h"
 #include "nsNetAddr.h"
 #include "nsProxyRelease.h"
 #include "nsIObserverService.h"
 #include "nsINetworkLinkService.h"
 
 #include "mozilla/Attributes.h"
-#include "mozilla/VisualEventTracer.h"
 #include "mozilla/net/NeckoCommon.h"
 #if !defined(MOZILLA_XPCOMRT_API)
 #include "mozilla/net/ChildDNSService.h"
 #endif // !defined(MOZILLA_XPCOMRT_API)
 #include "mozilla/net/DNSListenerProxy.h"
 #include "mozilla/Services.h"
 
 using namespace mozilla;
@@ -344,18 +343,16 @@ nsDNSAsyncRequest::OnLookupComplete(nsHo
     nsCOMPtr<nsIDNSRecord> rec;
     if (NS_SUCCEEDED(status)) {
         NS_ASSERTION(hostRecord, "no host record");
         rec = new nsDNSRecord(hostRecord);
         if (!rec)
             status = NS_ERROR_OUT_OF_MEMORY;
     }
 
-    MOZ_EVENT_TRACER_DONE(this, "net::dns::lookup");
-
     mListener->OnLookupComplete(this, rec, status);
     mListener = nullptr;
 
     // release the reference to ourselves that was added before we were
     // handed off to the host resolver.
     NS_RELEASE_THIS();
 }
 
@@ -795,19 +792,16 @@ nsDNSService::AsyncResolveExtended(const
 
     nsDNSAsyncRequest *req =
         new nsDNSAsyncRequest(res, hostname, listener, flags, af,
                               aNetworkInterface);
     if (!req)
         return NS_ERROR_OUT_OF_MEMORY;
     NS_ADDREF(*result = req);
 
-    MOZ_EVENT_TRACER_NAME_OBJECT(req, aHostname.BeginReading());
-    MOZ_EVENT_TRACER_WAIT(req, "net::dns::lookup");
-
     // addref for resolver; will be released when OnLookupComplete is called.
     NS_ADDREF(req);
     nsresult rv = res->ResolveHost(req->mHost.get(), flags, af,
                                    req->mNetworkInterface.get(),
                                    req);
     if (NS_FAILED(rv)) {
         NS_RELEASE(req);
         NS_RELEASE(*result);
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -28,17 +28,16 @@
 #include "plstr.h"
 #include "nsURLHelper.h"
 #include "nsThreadUtils.h"
 #include "GetAddrInfo.h"
 
 #include "mozilla/HashFunctions.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
-#include "mozilla/VisualEventTracer.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 // None of our implementations expose a TTL for negative responses, so we use a
 // constant always.
@@ -195,18 +194,16 @@ nsHostRecord::Create(const nsHostKey *ke
     size_t size = hostLen + netInterfaceLen + sizeof(nsHostRecord);
 
     // Use placement new to create the object with room for the hostname and
     // network interface name allocated after it.
     void *place = ::operator new(size);
     *result = new(place) nsHostRecord(key);
     NS_ADDREF(*result);
 
-    MOZ_EVENT_TRACER_NAME_OBJECT(*result, key->host);
-
     return NS_OK;
 }
 
 void
 nsHostRecord::SetExpiration(const mozilla::TimeStamp& now, unsigned int valid, unsigned int grace)
 {
     mValidStart = now;
     mGraceStart = now + TimeDuration::FromSeconds(valid);
@@ -1051,18 +1048,16 @@ nsHostResolver::ConditionallyCreateThrea
              LOG_HOST(rec->host, rec->netInterface)));
     }
     return NS_OK;
 }
 
 nsresult
 nsHostResolver::IssueLookup(nsHostRecord *rec)
 {
-    MOZ_EVENT_TRACER_WAIT(rec, "net::dns::resolve");
-
     nsresult rv = NS_OK;
     NS_ASSERTION(!rec->resolving, "record is already being resolved");
 
     // Add rec to one of the pending queues, possibly removing it from mEvictionQ.
     // If rec is on mEvictionQ, then we can just move the owning
     // reference over to the new active queue.
     if (rec->next == rec)
         NS_ADDREF(rec);
@@ -1312,18 +1307,16 @@ nsHostResolver::OnLookupComplete(nsHostR
                 DebugOnly<nsresult> rv = IssueLookup(rec);
                 NS_WARN_IF_FALSE(NS_SUCCEEDED(rv),
                                  "Could not issue second async lookup for TTL.");
             }
 #endif
         }
     }
 
-    MOZ_EVENT_TRACER_DONE(rec, "net::dns::resolve");
-
     if (!PR_CLIST_IS_EMPTY(&cbs)) {
         PRCList *node = cbs.next;
         while (node != &cbs) {
             nsResolveHostCallback *callback =
                     static_cast<nsResolveHostCallback *>(node);
             node = node->next;
             callback->OnLookupComplete(this, rec, status);
             // NOTE: callback must not be dereferenced after this point!!
@@ -1420,18 +1413,16 @@ nsHostResolver::ThreadFunc(void *arg)
     nsHostRecord *rec  = nullptr;
     AddrInfo *ai = nullptr;
 
     while (rec || resolver->GetHostToLookup(&rec)) {
         LOG(("DNS lookup thread - Calling getaddrinfo for host [%s%s%s].\n",
              LOG_HOST(rec->host, rec->netInterface)));
 
         TimeStamp startTime = TimeStamp::Now();
-        MOZ_EVENT_TRACER_EXEC(rec, "net::dns::resolve");
-
 #if TTL_AVAILABLE
         bool getTtl = rec->mGetTtl;
 #else
         bool getTtl = false;
 #endif
 
         // We need to remove IPv4 records manually
         // because PR_GetAddrInfoByName doesn't support PR_AF_INET6.
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -38,17 +38,16 @@
 #include "nsPrintfCString.h"
 #include "nsAlgorithm.h"
 #include "nsQueryObject.h"
 #include "GeckoProfiler.h"
 #include "nsIConsoleService.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/VisualEventTracer.h"
 #include "nsISSLSocketControl.h"
 #include "sslt.h"
 #include "nsContentUtils.h"
 #include "nsIClassOfService.h"
 #include "nsIPermissionManager.h"
 #include "nsIPrincipal.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsISSLStatus.h"
@@ -209,18 +208,16 @@ AutoRedirectVetoNotifier::ReportRedirect
     nsHttpChannel* channel = mChannel;
     mChannel = nullptr;
 
     if (vetoHook)
         vetoHook->OnRedirectResult(succeeded);
 
     // Drop after the notification
     channel->mHasAutoRedirectVetoNotifier = false;
-
-    MOZ_EVENT_TRACER_DONE(channel, "net::http::redirect-callbacks");
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpChannel <public>
 //-----------------------------------------------------------------------------
 
 nsHttpChannel::nsHttpChannel()
     : HttpAsyncAborter<nsHttpChannel>(this)
@@ -271,22 +268,16 @@ nsHttpChannel::~nsHttpChannel()
 
 nsresult
 nsHttpChannel::Init(nsIURI *uri,
                     uint32_t caps,
                     nsProxyInfo *proxyInfo,
                     uint32_t proxyResolveFlags,
                     nsIURI *proxyURI)
 {
-#ifdef MOZ_VISUAL_EVENT_TRACER
-    nsAutoCString url;
-    uri->GetAsciiSpec(url);
-    MOZ_EVENT_TRACER_NAME_OBJECT(this, url.get());
-#endif
-
     nsresult rv = HttpBaseChannel::Init(uri, caps, proxyInfo,
                                         proxyResolveFlags, proxyURI);
     if (NS_FAILED(rv))
         return rv;
 
     LOG(("nsHttpChannel::Init [this=%p]\n", this));
 
     return rv;
@@ -2669,18 +2660,16 @@ IsSubRangeRequest(nsHttpRequestHead &aRe
     nsAutoCString byteRange;
     aRequestHead.GetHeader(nsHttp::Range, byteRange);
     return !byteRange.EqualsLiteral("bytes=0-");
 }
 
 nsresult
 nsHttpChannel::OpenCacheEntry(bool isHttps)
 {
-    MOZ_EVENT_TRACER_EXEC(this, "net::http::OpenCacheEntry");
-
     // Handle correctly mCacheEntriesToWaitFor
     AutoCacheWaitFlags waitFlags(this);
 
     // Drop this flag here
     mConcurentCacheAccess = 0;
 
     nsresult rv;
 
@@ -4400,21 +4389,16 @@ nsHttpChannel::SetupReplacementChannel(n
 }
 
 nsresult
 nsHttpChannel::AsyncProcessRedirection(uint32_t redirectType)
 {
     LOG(("nsHttpChannel::AsyncProcessRedirection [this=%p type=%u]\n",
         this, redirectType));
 
-    // The channel is actually starting its operation now, at least because
-    // we want it to appear like being in the waiting phase until now.
-    MOZ_EVENT_TRACER_EXEC(this, "net::http::channel");
-    MOZ_EVENT_TRACER_EXEC(this, "net::http::redirect-callbacks");
-
     const char *location = mResponseHead->PeekHeader(nsHttp::Location);
 
     // if a location header was not given, then we can't perform the redirect,
     // so just carry on as though this were a normal response.
     if (!location)
         return NS_ERROR_FAILURE;
 
     // make sure non-ASCII characters in the location header are escaped.
@@ -4764,18 +4748,16 @@ nsHttpChannel::GetSecurityInfo(nsISuppor
     *securityInfo = mSecurityInfo;
     NS_IF_ADDREF(*securityInfo);
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context)
 {
-    MOZ_EVENT_TRACER_WAIT(this, "net::http::channel");
-
     LOG(("nsHttpChannel::AsyncOpen [this=%p]\n", this));
 
     NS_ENSURE_ARG_POINTER(listener);
     NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
     NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
     nsresult rv;
 
@@ -5693,18 +5675,16 @@ nsHttpChannel::OnStopRequest(nsIRequest 
         documentPerformance->AddEntry(this, this);
     }
 
     if (mListener) {
         LOG(("  calling OnStopRequest\n"));
         mListener->OnStopRequest(this, mListenerContext, status);
     }
 
-    MOZ_EVENT_TRACER_DONE(this, "net::http::channel");
-
     CloseCacheEntry(!contentComplete);
 
     if (mOfflineCacheEntry)
         CloseOfflineCacheEntry();
 
     if (mLoadGroup)
         mLoadGroup->RemoveRequest(this, nullptr, status);
 
@@ -5820,19 +5800,16 @@ nsHttpChannel::OnDataAvailable(nsIReques
         }
 
         //
         // we have to manually keep the logical offset of the stream up-to-date.
         // we cannot depend solely on the offset provided, since we may have
         // already streamed some data from another source (see, for example,
         // OnDoneReadingPartialCacheEntry).
         //
-        if (!mLogicalOffset)
-            MOZ_EVENT_TRACER_EXEC(this, "net::http::channel");
-
         int64_t offsetBefore = 0;
         nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(input);
         if (seekable && NS_FAILED(seekable->Tell(&offsetBefore))) {
             seekable = nullptr;
         }
 
         nsresult rv =  mListener->OnDataAvailable(this,
                                                   mListenerContext,
@@ -6406,17 +6383,16 @@ nsHttpChannel::OnRedirectVerifyCallback(
         // and let it be propagated to pumps.
         Cancel(result);
     }
 
     if (!mWaitingForRedirectCallback) {
         // We are not waiting for the callback. At this moment we must release
         // reference to the redirect target channel, otherwise we may leak.
         mRedirectChannel = nullptr;
-        MOZ_EVENT_TRACER_DONE(this, "net::http::channel");
     }
 
     // We always resume the pumps here. If all functions on stack have been
     // called we need OnStopRequest to be triggered, and if we broke out of the
     // loop above (and are thus waiting for a new callback) the suspension
     // count must be balanced in the pumps.
     if (mTransactionPump)
         mTransactionPump->Resume();
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -16,17 +16,16 @@
 #include "nsHttpChunkedDecoder.h"
 #include "nsTransportUtils.h"
 #include "nsNetUtil.h"
 #include "nsCRT.h"
 
 #include "nsISeekableStream.h"
 #include "nsMultiplexInputStream.h"
 #include "nsStringStream.h"
-#include "mozilla/VisualEventTracer.h"
 
 #include "nsComponentManagerUtils.h" // do_CreateInstance
 #include "nsServiceManagerUtils.h"   // do_GetService
 #include "nsIHttpActivityObserver.h"
 #include "nsSocketTransportService2.h"
 #include "nsICancelable.h"
 #include "nsIEventTarget.h"
 #include "nsIHttpChannelInternal.h"
@@ -213,22 +212,16 @@ nsHttpTransaction::Init(uint32_t caps,
                         nsHttpRequestHead *requestHead,
                         nsIInputStream *requestBody,
                         bool requestBodyHasHeaders,
                         nsIEventTarget *target,
                         nsIInterfaceRequestor *callbacks,
                         nsITransportEventSink *eventsink,
                         nsIAsyncInputStream **responseBody)
 {
-    MOZ_EVENT_TRACER_COMPOUND_NAME(static_cast<nsAHttpTransaction*>(this),
-                                   requestHead->PeekHeader(nsHttp::Host),
-                                   requestHead->RequestURI().BeginReading());
-
-    MOZ_EVENT_TRACER_WAIT(static_cast<nsAHttpTransaction*>(this),
-                          "net::http::transaction");
     nsresult rv;
 
     LOG(("nsHttpTransaction::Init [this=%p caps=%x]\n", this, caps));
 
     MOZ_ASSERT(cinfo);
     MOZ_ASSERT(requestHead);
     MOZ_ASSERT(target);
 
@@ -473,21 +466,16 @@ nsHttpTransaction::TakeSubTransactions(
 
 void
 nsHttpTransaction::SetConnection(nsAHttpConnection *conn)
 {
     {
         MutexAutoLock lock(mLock);
         mConnection = conn;
     }
-
-    if (conn) {
-        MOZ_EVENT_TRACER_EXEC(static_cast<nsAHttpTransaction*>(this),
-                              "net::http::transaction");
-    }
 }
 
 void
 nsHttpTransaction::GetSecurityCallbacks(nsIInterfaceRequestor **cb)
 {
     MutexAutoLock lock(mLock);
     nsCOMPtr<nsIInterfaceRequestor> tmp(mCallbacks);
     tmp.forget(cb);
@@ -653,21 +641,16 @@ nsHttpTransaction::ReadRequestSegment(ns
     nsresult rv = trans->mReader->OnReadSegment(buf, count, countRead);
     if (NS_FAILED(rv)) return rv;
 
     if (trans->TimingEnabled()) {
         // Set the timestamp to Now(), only if it null
         trans->SetRequestStart(TimeStamp::Now(), true);
     }
 
-    if (!trans->mSentData) {
-        MOZ_EVENT_TRACER_MARK(static_cast<nsAHttpTransaction*>(trans),
-                              "net::http::first-write");
-    }
-
     trans->CountSentBytes(*countRead);
     trans->mSentData = true;
     return NS_OK;
 }
 
 nsresult
 nsHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader,
                                 uint32_t count, uint32_t *countRead)
@@ -736,21 +719,16 @@ nsHttpTransaction::WritePipeSegment(nsIO
 
     nsresult rv;
     //
     // OK, now let the caller fill this segment with data.
     //
     rv = trans->mWriter->OnWriteSegment(buf, count, countWritten);
     if (NS_FAILED(rv)) return rv; // caller didn't want to write anything
 
-    if (!trans->mReceivedData) {
-        MOZ_EVENT_TRACER_MARK(static_cast<nsAHttpTransaction*>(trans),
-                              "net::http::first-read");
-    }
-
     MOZ_ASSERT(*countWritten > 0, "bad writer");
     trans->CountRecvBytes(*countWritten);
     trans->mReceivedData = true;
 
     // Let the transaction "play" with the buffer.  It is free to modify
     // the contents of the buffer and/or modify countWritten.
     // - Bytes in HTTP headers don't count towards countWritten, so the input
     // side of pipe (aka nsHttpChannel's mTransactionPump) won't hit
@@ -1030,19 +1008,16 @@ nsHttpTransaction::Close(nsresult reason
     mLineBuf.Truncate();
     if (mChunkedDecoder) {
         delete mChunkedDecoder;
         mChunkedDecoder = nullptr;
     }
 
     // closing this pipe triggers the channel's OnStopRequest method.
     mPipeOut->CloseWithStatus(reason);
-
-    MOZ_EVENT_TRACER_DONE(static_cast<nsAHttpTransaction*>(this),
-                          "net::http::transaction");
 }
 
 nsHttpConnectionInfo *
 nsHttpTransaction::ConnectionInfo()
 {
     return mConnInfo.get();
 }
 
deleted file mode 100644
--- a/xpcom/base/VisualEventTracer.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#include "mozilla/VisualEventTracer.h"
-#include "mozilla/Monitor.h"
-#include "mozilla/TimeStamp.h"
-#include "nscore.h"
-#include "prthread.h"
-#include "prprf.h"
-#include "prenv.h"
-#include "plstr.h"
-#include "nsThreadUtils.h"
-
-namespace mozilla {
-namespace eventtracer {
-
-#ifdef MOZ_VISUAL_EVENT_TRACER
-
-namespace {
-
-const uint32_t kBatchSize = 256;
-const char kTypeChars[eventtracer::eLast] = {' ', 'N', 'S', 'W', 'E', 'D'};
-
-// Flushing thread and records queue monitor
-mozilla::Monitor* gMonitor = nullptr;
-
-// gInitialized and gCapture can be accessed from multiple threads
-// simultaneously without any locking.  However, since they are only ever
-// *set* from the main thread, the chance of races manifesting is small
-// and unlikely to be a problem in practice.
-bool gInitialized;
-
-// Flag to allow capturing
-bool gCapture;
-
-// Time stamp of the epoch we have started to capture
-mozilla::TimeStamp* gProfilerStart;
-
-// Duration of the log to keep up to
-mozilla::TimeDuration* gMaxBacklogTime;
-
-
-// Record of a single event
-class Record
-{
-public:
-  Record()
-    : mType(::mozilla::eventtracer::eNone)
-    , mItem(nullptr)
-    , mText(nullptr)
-    , mText2(nullptr)
-  {
-    MOZ_COUNT_CTOR(Record);
-  }
-
-  Record& operator=(const Record& aOther)
-  {
-    mType = aOther.mType;
-    mTime = aOther.mTime;
-    mItem = aOther.mItem;
-    mText = PL_strdup(aOther.mText);
-    mText2 = aOther.mText2 ? PL_strdup(aOther.mText2) : nullptr;
-    return *this;
-  }
-
-  ~Record()
-  {
-    PL_strfree(mText2);
-    PL_strfree(mText);
-    MOZ_COUNT_DTOR(Record);
-  }
-
-  uint32_t mType;
-  TimeStamp mTime;
-  void* mItem;
-  char* mText;
-  char* mText2;
-};
-
-char* DupCurrentThreadName()
-{
-  if (NS_IsMainThread()) {
-    return PL_strdup("Main Thread");
-  }
-
-  PRThread* currentThread = PR_GetCurrentThread();
-  const char* name = PR_GetThreadName(currentThread);
-  if (name) {
-    return PL_strdup(name);
-  }
-
-  char buffer[128];
-  PR_snprintf(buffer, 127, "Nameless %p", currentThread);
-
-  return PL_strdup(buffer);
-}
-
-// An array of events, each thread keeps its own private instance
-class RecordBatch
-{
-public:
-  RecordBatch(size_t aLength = kBatchSize,
-              char* aThreadName = DupCurrentThreadName())
-    : mRecordsHead(new Record[aLength])
-    , mRecordsTail(mRecordsHead + aLength)
-    , mNextRecord(mRecordsHead)
-    , mNextBatch(nullptr)
-    , mThreadNameCopy(aThreadName)
-    , mClosed(false)
-  {
-    MOZ_COUNT_CTOR(RecordBatch);
-  }
-
-  ~RecordBatch()
-  {
-    delete [] mRecordsHead;
-    PL_strfree(mThreadNameCopy);
-    MOZ_COUNT_DTOR(RecordBatch);
-  }
-
-  void Close()
-  {
-    mClosed = true;
-  }
-
-  size_t Length() const
-  {
-    return mNextRecord - mRecordsHead;
-  }
-  bool CanBeDeleted(const TimeStamp& aUntil) const;
-
-  static RecordBatch* Register();
-  static void Close(void* aData);  // Registered on freeing thread data
-  static RecordBatch* Clone(RecordBatch* aLog, const TimeStamp& aSince);
-  static void Delete(RecordBatch* aLog);
-
-  static RecordBatch* CloneLog();
-  static void GCLog(const TimeStamp& aUntil);
-  static void DeleteLog();
-
-  Record* mRecordsHead;
-  Record* mRecordsTail;
-  Record* mNextRecord;
-
-  RecordBatch* mNextBatch;
-  char* mThreadNameCopy;
-  bool mClosed;
-};
-
-// Protected by gMonitor, accessed concurently
-// Linked list of batches threads want to flush on disk
-RecordBatch* gLogHead = nullptr;
-RecordBatch* gLogTail = nullptr;
-
-// Registers the batch in the linked list
-// static
-RecordBatch*
-RecordBatch::Register()
-{
-  MonitorAutoLock mon(*gMonitor);
-
-  if (!gInitialized) {
-    return nullptr;
-  }
-
-  if (gLogHead) {
-    RecordBatch::GCLog(TimeStamp::Now() - *gMaxBacklogTime);
-  }
-
-  RecordBatch* batch = new RecordBatch();
-  if (!gLogHead) {
-    gLogHead = batch;
-  } else { // gLogTail is non-null
-    gLogTail->mNextBatch = batch;
-  }
-  gLogTail = batch;
-
-  mon.Notify();
-  return batch;
-}
-
-void
-RecordBatch::Close(void* aData)
-{
-  RecordBatch* batch = static_cast<RecordBatch*>(aData);
-  batch->Close();
-}
-
-// static
-RecordBatch*
-RecordBatch::Clone(RecordBatch* aOther, const TimeStamp& aSince)
-{
-  if (!aOther) {
-    return nullptr;
-  }
-
-  size_t length = aOther->Length();
-  size_t min = 0;
-  size_t max = length;
-  Record* record = nullptr;
-
-  // Binary search for record with time >= aSince
-  size_t i;
-  while (min < max) {
-    i = (max + min) / 2;
-
-    record = aOther->mRecordsHead + i;
-    if (record->mTime >= aSince) {
-      max = i;
-    } else {
-      min = i + 1;
-    }
-  }
-  i = (max + min) / 2;
-
-  // How many Record's to copy?
-  size_t toCopy = length - i;
-  if (!toCopy) {
-    return RecordBatch::Clone(aOther->mNextBatch, aSince);
-  }
-
-  // Clone
-  RecordBatch* clone = new RecordBatch(toCopy, PL_strdup(aOther->mThreadNameCopy));
-  for (; i < length; ++i) {
-    record = aOther->mRecordsHead + i;
-    *clone->mNextRecord = *record;
-    ++clone->mNextRecord;
-  }
-  clone->mNextBatch = RecordBatch::Clone(aOther->mNextBatch, aSince);
-
-  return clone;
-}
-
-// static
-void
-RecordBatch::Delete(RecordBatch* aLog)
-{
-  while (aLog) {
-    RecordBatch* batch = aLog;
-    aLog = aLog->mNextBatch;
-    delete batch;
-  }
-}
-
-// static
-RecordBatch*
-RecordBatch::CloneLog()
-{
-  TimeStamp startEpoch = *gProfilerStart;
-  TimeStamp backlogEpoch = TimeStamp::Now() - *gMaxBacklogTime;
-
-  TimeStamp since = (startEpoch > backlogEpoch) ? startEpoch : backlogEpoch;
-
-  MonitorAutoLock mon(*gMonitor);
-
-  return RecordBatch::Clone(gLogHead, since);
-}
-
-// static
-void
-RecordBatch::GCLog(const TimeStamp& aUntil)
-{
-  // Garbage collect all unreferenced and old batches
-  gMonitor->AssertCurrentThreadOwns();
-
-  RecordBatch* volatile* referer = &gLogHead;
-  gLogTail = nullptr;
-
-  RecordBatch* batch = *referer;
-  while (batch) {
-    if (batch->CanBeDeleted(aUntil)) {
-      // The batch is completed and thus unreferenced by the thread
-      // and the most recent record has time older then the time
-      // we want to save records for, hence delete it.
-      *referer = batch->mNextBatch;
-      delete batch;
-      batch = *referer;
-    } else {
-      // We walk the whole list, so this will end up filled with
-      // the very last valid element of it.
-      gLogTail = batch;
-      // The current batch is active, examine the next in the list.
-      batch = batch->mNextBatch;
-      // When the next batch is found expired, we must extract it
-      // from the list, shift the referer.
-      referer = &((*referer)->mNextBatch);
-    }
-  }
-}
-
-// static
-void
-RecordBatch::DeleteLog()
-{
-  RecordBatch* batch;
-  {
-    MonitorAutoLock mon(*gMonitor);
-    batch = gLogHead;
-    gLogHead = nullptr;
-    gLogTail = nullptr;
-  }
-
-  RecordBatch::Delete(batch);
-}
-
-bool
-RecordBatch::CanBeDeleted(const TimeStamp& aUntil) const
-{
-  if (mClosed) {
-    // This flag is set when a thread releases this batch as
-    // its private data.  It happens when the list is full or
-    // when the thread ends its job.  We must not delete this
-    // batch from memory while it's held by a thread.
-
-    if (!Length()) {
-      // There are no records, just get rid of this empty batch.
-      return true;
-    }
-
-    if ((mNextRecord - 1)->mTime <= aUntil) {
-      // Is the last record older then the time we demand records
-      // for?  If not, this batch has expired.
-      return true;
-    }
-  }
-
-  // Not all conditions to close the batch met, keep it.
-  return false;
-}
-
-// Helper class for filtering events by MOZ_PROFILING_EVENTS
-class EventFilter
-{
-public:
-  static EventFilter* Build(const char* aFilterVar);
-  bool EventPasses(const char* aFilterVar);
-
-  ~EventFilter()
-  {
-    delete mNext;
-    PL_strfree(mFilter);
-    MOZ_COUNT_DTOR(EventFilter);
-  }
-
-private:
-  EventFilter(const char* aEventName, EventFilter* aNext)
-    : mFilter(PL_strdup(aEventName))
-    , mNext(aNext)
-  {
-    MOZ_COUNT_CTOR(EventFilter);
-  }
-
-  char* mFilter;
-  EventFilter* mNext;
-};
-
-// static
-EventFilter*
-EventFilter::Build(const char* aFilterVar)
-{
-  if (!aFilterVar || !*aFilterVar) {
-    return nullptr;
-  }
-
-  // Reads a comma serpatated list of events.
-
-  // Copied from nspr logging code (read of NSPR_LOG_MODULES)
-  char eventName[64];
-  int pos = 0, count, delta = 0;
-
-  // Read up to a comma or EOF -> get name of an event first in the list
-  count = sscanf(aFilterVar, "%63[^,]%n", eventName, &delta);
-  if (count == 0) {
-    return nullptr;
-  }
-
-  pos = delta;
-
-  // Skip a comma, if present, accept spaces around it
-  count = sscanf(aFilterVar + pos, " , %n", &delta);
-  if (count != EOF) {
-    pos += delta;
-  }
-
-  // eventName contains name of the first event in the list
-  // second argument recursively parses the rest of the list string and
-  // fills mNext of the just created EventFilter object chaining the objects
-  return new EventFilter(eventName, Build(aFilterVar + pos));
-}
-
-bool
-EventFilter::EventPasses(const char* aEventName)
-{
-  if (!strcmp(aEventName, mFilter)) {
-    return true;
-  }
-
-  if (mNext) {
-    return mNext->EventPasses(aEventName);
-  }
-
-  return false;
-}
-
-// State and control variables, initialized in Init() method, after it
-// immutable and read concurently.
-EventFilter* gEventFilter = nullptr;
-unsigned gThreadPrivateIndex;
-
-// static
-bool
-CheckEventFilters(uint32_t aType, void* aItem, const char* aText)
-{
-  if (!gEventFilter) {
-    return true;
-  }
-
-  if (aType == eName) {
-    return true;
-  }
-
-  return gEventFilter->EventPasses(aText);
-}
-
-} // anon namespace
-
-#endif //MOZ_VISUAL_EVENT_TRACER
-
-// static
-void
-Init()
-{
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  const char* logEvents = PR_GetEnv("MOZ_PROFILING_EVENTS");
-  if (logEvents && *logEvents) {
-    gEventFilter = EventFilter::Build(logEvents);
-  }
-
-  PRStatus status = PR_NewThreadPrivateIndex(&gThreadPrivateIndex,
-                                             &RecordBatch::Close);
-  if (status != PR_SUCCESS) {
-    return;
-  }
-
-  gMonitor = new mozilla::Monitor("Profiler");
-  if (!gMonitor) {
-    return;
-  }
-
-  gProfilerStart = new mozilla::TimeStamp();
-  gMaxBacklogTime = new mozilla::TimeDuration();
-
-  gInitialized = true;
-#endif
-}
-
-// static
-void
-Shutdown()
-{
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  gCapture = false;
-  gInitialized = false;
-
-  RecordBatch::DeleteLog();
-
-  delete gMonitor;
-  gMonitor = nullptr;
-
-  delete gEventFilter;
-  gEventFilter = nullptr;
-
-  delete gProfilerStart;
-  gProfilerStart = nullptr;
-
-  delete gMaxBacklogTime;
-  gMaxBacklogTime = nullptr;
-#endif
-}
-
-// static
-void
-Mark(uint32_t aType, void* aItem, const char* aText, const char* aText2)
-{
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  if (!gInitialized || !gCapture) {
-    return;
-  }
-
-  if (aType == eNone) {
-    return;
-  }
-
-  if (!CheckEventFilters(aType, aItem, aText)) { // Events use just aText
-    return;
-  }
-
-  RecordBatch* threadLogPrivate =
-    static_cast<RecordBatch*>(PR_GetThreadPrivate(gThreadPrivateIndex));
-  if (!threadLogPrivate) {
-    threadLogPrivate = RecordBatch::Register();
-    if (!threadLogPrivate) {
-      return;
-    }
-
-    PR_SetThreadPrivate(gThreadPrivateIndex, threadLogPrivate);
-  }
-
-  Record* record = threadLogPrivate->mNextRecord;
-  record->mType = aType;
-  record->mTime = mozilla::TimeStamp::Now();
-  record->mItem = aItem;
-  record->mText = PL_strdup(aText);
-  record->mText2 = aText2 ? PL_strdup(aText2) : nullptr;
-
-  ++threadLogPrivate->mNextRecord;
-  if (threadLogPrivate->mNextRecord == threadLogPrivate->mRecordsTail) {
-    // Calls RecordBatch::Close(threadLogPrivate) that marks
-    // the batch as OK to be deleted from memory when no longer needed.
-    PR_SetThreadPrivate(gThreadPrivateIndex, nullptr);
-  }
-#endif
-}
-
-
-#ifdef MOZ_VISUAL_EVENT_TRACER
-
-// The scriptable classes
-
-class VisualEventTracerLog final: public nsIVisualEventTracerLog
-{
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIVISUALEVENTTRACERLOG
-
-  VisualEventTracerLog(RecordBatch* aBatch)
-    : mBatch(aBatch)
-    , mProfilerStart(*gProfilerStart)
-  {
-  }
-private:
-  ~VisualEventTracerLog();
-
-protected:
-  RecordBatch* mBatch;
-  TimeStamp mProfilerStart;
-};
-
-NS_IMPL_ISUPPORTS(VisualEventTracerLog, nsIVisualEventTracerLog)
-
-VisualEventTracerLog::~VisualEventTracerLog()
-{
-  RecordBatch::Delete(mBatch);
-}
-
-NS_IMETHODIMP
-VisualEventTracerLog::GetJSONString(nsACString& aResult)
-{
-  nsCString buffer;
-  buffer.AssignLiteral("{\n\"version\": 1,\n\"records\":[\n");
-
-  RecordBatch* batch = mBatch;
-  while (batch) {
-    if (batch != mBatch) {
-      // This is not the first batch we are writting, add comma
-      buffer.AppendLiteral(",\n");
-    }
-
-    buffer.AppendLiteral("{\"thread\":\"");
-    buffer.Append(batch->mThreadNameCopy);
-    buffer.AppendLiteral("\",\"log\":[\n");
-
-    static const int kBufferSize = 2048;
-    char buf[kBufferSize];
-
-    for (Record* record = batch->mRecordsHead;
-         record < batch->mNextRecord;
-         ++record) {
-
-      // mType carries both type and flags, separate type
-      // as lower 16 bits and flags as higher 16 bits.
-      // The json format expects this separated.
-      uint32_t type = record->mType & 0xffffUL;
-      uint32_t flags = record->mType >> 16;
-      PR_snprintf(buf, kBufferSize,
-        "{\"e\":\"%c\",\"t\":%llu,\"f\":%d,\"i\":\"%p\",\"n\":\"%s%s\"}%s\n",
-        kTypeChars[type],
-        static_cast<uint64_t>((record->mTime - mProfilerStart).ToMilliseconds()),
-        flags,
-        record->mItem,
-        record->mText,
-        record->mText2 ? record->mText2 : "",
-        (record == batch->mNextRecord - 1) ? "" : ",");
-
-      buffer.Append(buf);
-    }
-
-    buffer.AppendLiteral("]}\n");
-
-    RecordBatch* next = batch->mNextBatch;
-    batch = next;
-  }
-
-  buffer.AppendLiteral("]}\n");
-  aResult.Assign(buffer);
-
-  return NS_OK;
-}
-
-nsresult
-VisualEventTracerLog::WriteToProfilingFile()
-{
-  const char* filename = PR_GetEnv("MOZ_TRACE_FILE");
-  if (!filename) {
-    return NS_OK;
-  }
-
-  PRFileDesc* fd = PR_Open(filename, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
-                           0644);
-  if (!fd) {
-    return NS_ERROR_FILE_ACCESS_DENIED;
-  }
-
-  nsCString json;
-  GetJSONString(json);
-
-  int32_t bytesWritten = PR_Write(fd, json.get(), json.Length());
-  PR_Close(fd);
-
-  if (bytesWritten < json.Length()) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS(VisualEventTracer, nsIVisualEventTracer)
-
-NS_IMETHODIMP
-VisualEventTracer::Start(const uint32_t aMaxBacklogSeconds)
-{
-  if (!gInitialized) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  if (gCapture) {
-    NS_WARNING("VisualEventTracer has already been started");
-    return NS_ERROR_ALREADY_INITIALIZED;
-  }
-
-  *gMaxBacklogTime = TimeDuration::FromMilliseconds(aMaxBacklogSeconds * 1000);
-
-  *gProfilerStart = mozilla::TimeStamp::Now();
-  {
-    MonitorAutoLock mon(*gMonitor);
-    RecordBatch::GCLog(*gProfilerStart);
-  }
-  gCapture = true;
-
-  MOZ_EVENT_TRACER_MARK(this, "trace::start");
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-VisualEventTracer::Stop()
-{
-  if (!gInitialized) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  if (!gCapture) {
-    NS_WARNING("VisualEventTracer is not runing");
-    return NS_ERROR_NOT_INITIALIZED;
-  }
-
-  MOZ_EVENT_TRACER_MARK(this, "trace::stop");
-
-  gCapture = false;
-
-  nsresult rv = NS_OK;
-  if (PR_GetEnv("MOZ_TRACE_FILE")) {
-    nsCOMPtr<nsIVisualEventTracerLog> tracelog;
-    rv = Snapshot(getter_AddRefs(tracelog));
-    if (NS_SUCCEEDED(rv)) {
-      rv = tracelog->WriteToProfilingFile();
-    }
-  }
-
-  return rv;
-}
-
-NS_IMETHODIMP
-VisualEventTracer::Snapshot(nsIVisualEventTracerLog** aResult)
-{
-  if (!gInitialized) {
-    return NS_ERROR_UNEXPECTED;
-  }
-
-  RecordBatch* batch = RecordBatch::CloneLog();
-
-  nsRefPtr<VisualEventTracerLog> log = new VisualEventTracerLog(batch);
-  log.forget(aResult);
-
-  return NS_OK;
-}
-
-#endif
-
-} // eventtracer
-} // mozilla
deleted file mode 100644
--- a/xpcom/base/VisualEventTracer.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-/* Visual event tracer, creates a log of events on each thread for visualization */
-
-/**
- * The event tracer code is by default disabled in both build and run time.
- *
- * To enable this code at build time, add --enable-visual-profiling to your
- * configure options.
- *
- * To enable this code at run time, export MOZ_TRACE_FILE env var with a
- * path to the file to write the log to. This is all you need to * produce
- * the log of all events instrumentation in the mozilla code. Check
- * MOZ_EVENT_TRACER_* macros below to add your own.
- *
- * To let the event tracer log only some events to save disk space, export
- * MOZ_PROFILING_EVENTS with comma separated list of event names you want
- * to record in the log.
- */
-
-#ifndef VisualEventTracer_h___
-#define VisualEventTracer_h___
-
-#include <stdint.h>
-#include "mozilla/Attributes.h"
-#include "mozilla/GuardObjects.h"
-
-#ifdef MOZ_VISUAL_EVENT_TRACER
-#include "nsIVisualEventTracer.h"
-
-// Bind an object instance, usually |this|, to a name, usually URL or
-// host name, the instance deals with for its lifetime.  The name string
-// is duplicated.
-// IMPORTANT: it is up to the caller to pass the correct static_cast
-// of the |instance| pointer to all these macros ; otherwise the linking
-// of events and objects will not work!
-// The name will show in details of the events on the timeline and also
-// will allow events filtering by host names, URLs etc.
-#define MOZ_EVENT_TRACER_NAME_OBJECT(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eName, instance, name)
-
-// The same as MOZ_EVENT_TRACER_NAME_OBJECT, just simplifies building
-// names when it consists of two parts
-#define MOZ_EVENT_TRACER_COMPOUND_NAME(instance, name, name2) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eName, instance, name, name2)
-
-
-// Call the followings with the same |instance| reference as you have
-// previously called MOZ_EVENT_TRACER_NAME_OBJECT.
-// Let |name| be the name of the event happening, like "resolving",
-// "connecting", "loading" etc.
-
-// This will crate a single-point-in-time event marked with an arrow
-// on the timeline, this is a way to indicate an event without a duration.
-#define MOZ_EVENT_TRACER_MARK(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eShot, instance, name)
-
-// Following macros are used to log events with duration.
-// There always has to be complete WAIT,EXEC,DONE or EXEC,DONE
-// uninterrupted and non-interferring tuple(s) for an event to be correctly
-// shown on the timeline.  Each can be called on any thread, the event tape is
-// finally displayed on the thread where it has been EXECuted.
-
-// Example of 3 phases usage for "HTTP request channel":
-// WAIT: we've just created the channel and called AsyncOpen on it
-// EXEC: we've just got first call to OnDataAvailable, so we are actually
-//       receiving the content after some time like connection establising,
-//       opening a cache entry, sending the GET request...
-// DONE: we've just got OnStopRequest call that indicates the content
-//       has been completely delivered and the request is now finished
-
-// Indicate an event pending start, on the timeline this will
-// start the event's interval tape with a pale color, the time will
-// show in details.  Usually used when an event is being posted or
-// we wait for a lock acquisition.
-// WAITING is not mandatory, some events don't have a pending phase.
-#define MOZ_EVENT_TRACER_WAIT(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eWait, instance, name)
-
-// Indicate start of an event actual execution, on the timeline this will
-// change the event's tape to a deeper color, the time will show in details.
-#define MOZ_EVENT_TRACER_EXEC(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eExec, instance, name)
-
-// Indicate the end of an event execution (the event has been done),
-// on the timeline this will end the event's tape and show the time in
-// event details.
-// NOTE: when the event duration is extremely short, like 1ms, it will convert
-// to an event w/o a duration - the same as MOZ_EVENT_TRACER_MARK would be used.
-#define MOZ_EVENT_TRACER_DONE(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eDone, instance, name)
-
-// The same meaning as the above macros, just for concurent events.
-// Concurent event means it can happen for the same instance on more
-// then just a single thread, e.g. a service method call, a global lock
-// acquisition, enter and release.
-#define MOZ_EVENT_TRACER_WAIT_THREADSAFE(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eWait | mozilla::eventtracer::eThreadConcurrent, instance, name)
-#define MOZ_EVENT_TRACER_EXEC_THREADSAFE(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eExec | mozilla::eventtracer::eThreadConcurrent, instance, name)
-#define MOZ_EVENT_TRACER_DONE_THREASAFE(instance, name) \
-  mozilla::eventtracer::Mark(mozilla::eventtracer::eDone | mozilla::eventtracer::eThreadConcurrent, instance, name)
-
-#else
-
-// MOZ_VISUAL_EVENT_TRACER disabled
-
-#define MOZ_EVENT_TRACER_NAME_OBJECT(instance, name) (void)0
-#define MOZ_EVENT_TRACER_COMPOUND_NAME(instance, name, name2) (void)0
-#define MOZ_EVENT_TRACER_MARK(instance, name) (void)0
-#define MOZ_EVENT_TRACER_WAIT(instance, name) (void)0
-#define MOZ_EVENT_TRACER_EXEC(instance, name) (void)0
-#define MOZ_EVENT_TRACER_DONE(instance, name) (void)0
-#define MOZ_EVENT_TRACER_WAIT_THREADSAFE(instance, name) (void)0
-#define MOZ_EVENT_TRACER_EXEC_THREADSAFE(instance, name) (void)0
-#define MOZ_EVENT_TRACER_DONE_THREASAFE(instance, name) (void)0
-
-#endif
-
-
-namespace mozilla {
-namespace eventtracer {
-
-// Initialize the event tracer engine, called automatically on XPCOM startup.
-void Init();
-
-// Shuts the event tracer engine down and closes the log file, called
-// automatically during XPCOM shutdown.
-void Shutdown();
-
-enum MarkType {
-  eNone, // No operation, ignored
-  eName, // This is used to bind an object instance with a name
-
-  eShot, // An event with no duration
-  eWait, // Start of waiting for execution (lock acquire, post...)
-  eExec, // Start of the execution it self
-  eDone, // End of the execution
-  eLast, // Sentinel
-
-  // Flags
-
-  // The same object can execute the same event on several threads concurently
-  eThreadConcurrent = 0x10000
-};
-
-// Records an event on the calling thread.
-// @param aType
-//    One of MarkType fields, can be bitwise or'ed with the flags.
-// @param aItem
-//    Reference to the object we want to bind a name to or the event is
-//    happening on.  Can be actually anything, but valid poitners should
-//    be used.
-// @param aText
-//    Text of the name (for eName) or event's name for others.  The string
-//    is duplicated.
-// @param aText2
-//    Optional second part of the instnace name, or event name.
-//    Event filtering does apply only to the first part (aText).
-void Mark(uint32_t aType, void* aItem,
-          const char* aText, const char* aText2 = 0);
-
-
-// Helper guard object.  Use to mark an event in the constructor and a different
-// event in the destructor.
-//
-// Example:
-// int class::func()
-// {
-//    AutoEventTracer tracer(this, eventtracer::eExec, eventtracer::eDone, "func");
-//
-//    do_something_taking_a_long_time();
-// }
-class MOZ_STACK_CLASS AutoEventTracer
-{
-public:
-  AutoEventTracer(void* aInstance,
-                  uint32_t aTypeOn, // MarkType marked in constructor
-                  uint32_t aTypeOff, // MarkType marked in destructor
-                  const char* aName,
-                  const char* aName2 = 0
-                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-    : mInstance(aInstance)
-    , mName(aName)
-    , mName2(aName2)
-    , mTypeOn(aTypeOn)
-    , mTypeOff(aTypeOff)
-  {
-    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-
-    ::mozilla::eventtracer::Mark(mTypeOn, mInstance, mName, mName2);
-  }
-
-  ~AutoEventTracer()
-  {
-    ::mozilla::eventtracer::Mark(mTypeOff, mInstance, mName, mName2);
-  }
-
-private:
-  void* mInstance;
-  const char* mName;
-  const char* mName2;
-  uint32_t mTypeOn;
-  uint32_t mTypeOff;
-
-  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-};
-
-#ifdef MOZ_VISUAL_EVENT_TRACER
-
-// The scriptable class that drives the event tracer
-
-class VisualEventTracer final: public nsIVisualEventTracer
-{
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIVISUALEVENTTRACER
-private:
-  ~VisualEventTracer() {}
-};
-
-#define NS_VISUALEVENTTRACER_CID \
-  { 0xb9e5e102, 0xc2f4, 0x497a,  \
-    { 0xa6, 0xe4, 0x54, 0xde, 0xf3, 0x71, 0xf3, 0x9d } }
-#define NS_VISUALEVENTTRACER_CONTRACTID "@mozilla.org/base/visual-event-tracer;1"
-#define NS_VISUALEVENTTRACER_CLASSNAME "Visual Event Tracer"
-
-#endif
-
-} // eventtracer
-} // mozilla
-
-#endif /* VisualEventTracer_h___ */
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -20,17 +20,16 @@ XPIDL_SOURCES += [
     'nsIMessageLoop.idl',
     'nsIMutable.idl',
     'nsIProgrammingLanguage.idl',
     'nsISecurityConsoleMessage.idl',
     'nsIStatusReporter.idl',
     'nsISupports.idl',
     'nsIUUIDGenerator.idl',
     'nsIVersionComparator.idl',
-    'nsIVisualEventTracer.idl',
     'nsIWeakReference.idl',
     'nsrootidl.idl',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     XPIDL_SOURCES += [
         'nsIMacUtils.idl',
     ]
@@ -81,17 +80,16 @@ EXPORTS.mozilla += [
     'ErrorNames.h',
     'HoldDropJSObjects.h',
     'LinuxUtils.h',
     'nsMemoryInfoDumper.h',
     'StackWalk.h',
     'StaticMutex.h',
     'StaticPtr.h',
     'SystemMemoryReporter.h',
-    'VisualEventTracer.h',
 ]
 
 # nsDebugImpl isn't unified because we disable PGO so that NS_ABORT_OOM isn't
 # optimized away oddly.
 SOURCES += [
     'nsDebugImpl.cpp',
 ]
 SOURCES['nsDebugImpl.cpp'].no_pgo = True
@@ -117,17 +115,16 @@ UNIFIED_SOURCES += [
     'nsMemoryReporterManager.cpp',
     'nsMessageLoop.cpp',
     'nsSecurityConsoleMessage.cpp',
     'nsStatusReporterManager.cpp',
     'nsSystemInfo.cpp',
     'nsTraceRefcnt.cpp',
     'nsUUIDGenerator.cpp',
     'nsVersionComparatorImpl.cpp',
-    'VisualEventTracer.cpp',
 ]
 
 # MOZ_STACKWALKING is defined in configure.in when the build configuration meets
 # the conditions for NS_StackWalk to work correctly.
 # We exclude this file from other build configurations so that if somebody adds a
 # new usage of NS_StackWalk it will cause a link error, which is better than having
 # NS_StackWalk silently return garbage at runtime.
 if CONFIG['MOZ_STACKWALKING']:
deleted file mode 100644
--- a/xpcom/base/nsIVisualEventTracer.idl
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* 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/. */
-
-#include "nsISupports.idl"
-
-interface nsIVisualEventTracerLog;
-
-/**
- * Interface to control the visual event tracer feature.  The result
- * is a log of various events that are monitored by a custom code
- * instrumentation around the mozilla code base.
- */
-
-[builtinclass, scriptable, uuid(713ee3ca-95e0-4085-8616-f6d64a9508ad)]
-interface nsIVisualEventTracer : nsISupports
-{
-  /**
-   * Start the logging now.  No affect if already started.
-   * Current backlog is deleted by this call otherwise.
-   *
-   * @param minBacklogSeconds
-   *    Manimum time to keep the backlog.  Entries of the log are discarded
-   *    when their age is more then value of this argument.
-   */
-  void start(in unsigned long minBacklogSeconds);
-
-  /**
-   * Stop the logging now.  Backlog is kept in memory.
-   */
-  void stop();
-
-  /**
-   * Obtain the log.  This can be called whenever you want.
-   *
-   * @return
-   *    Result is an object that keeps snaphot of the log from
-   *    time this method has been called.  You can then access
-   *    the log using the object.  Calling stop() on the tracer
-   *    doesn't delete this log.
-   */
-  nsIVisualEventTracerLog snapshot();
-};
-
-[builtinclass, scriptable, uuid(8ec6e36d-6cba-400b-bcd6-454679f5f75a)]
-interface nsIVisualEventTracerLog : nsISupports
-{
-  /**
-   * JSON string of the log.  Use JSON.parse to get it as an object.
-   */
-  readonly attribute ACString JSONString;
-
-  /**
-   * Write the JSON string returned by JSONString to the log defined by
-   * the environment variable MOZ_PROFILING_FILE.
-   */
-  void writeToProfilingFile();
-};
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -130,20 +130,16 @@ extern nsresult nsStringInputStreamConst
 #include "mozilla/AvailableMemoryTracker.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/CountingAllocatorBase.h"
 #include "mozilla/SystemMemoryReporter.h"
 #include "mozilla/UniquePtr.h"
 
 #include "mozilla/ipc/GeckoChildProcessHost.h"
 
-#ifdef MOZ_VISUAL_EVENT_TRACER
-#include "mozilla/VisualEventTracer.h"
-#endif
-
 #include "ogg/ogg.h"
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
 #if defined(HAVE_STDINT_H)
 // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in
 // vpx_config.h (which we include via vpx_mem.h, below). This redefinition
 // triggers a build warning on MSVC, so we have to #undef it first.
 #undef HAVE_STDINT_H
 #endif
@@ -157,19 +153,16 @@ extern nsresult nsStringInputStreamConst
 
 #include "jsapi.h"
 
 #include "gfxPlatform.h"
 
 using namespace mozilla;
 using base::AtExitManager;
 using mozilla::ipc::BrowserProcessSubThread;
-#ifdef MOZ_VISUAL_EVENT_TRACER
-using mozilla::eventtracer::VisualEventTracer;
-#endif
 
 namespace {
 
 static AtExitManager* sExitManager;
 static MessageLoop* sMessageLoop;
 static bool sCommandLineWasInitialized;
 static BrowserProcessSubThread* sIOThread;
 static BackgroundHangMonitor* sMainHangMonitor;
@@ -211,19 +204,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSupport
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsConsoleService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAtomService)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsTimerImpl)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinaryOutputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsBinaryInputStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsStorageStream)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsVersionComparatorImpl)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableBase64Encoder)
-#ifdef MOZ_VISUAL_EVENT_TRACER
-NS_GENERIC_FACTORY_CONSTRUCTOR(VisualEventTracer)
-#endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsVariant)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHashPropertyBagCC)
 
 NS_GENERIC_AGGREGATED_CONSTRUCTOR(nsProperties)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUUIDGenerator, Init)
@@ -753,20 +743,16 @@ NS_InitXPCOM2(nsIServiceManager** aResul
   mozilla::BackgroundHangMonitor::Startup();
 
   const MessageLoop* const loop = MessageLoop::current();
   sMainHangMonitor = new mozilla::BackgroundHangMonitor(
     loop->thread_name().c_str(),
     loop->transient_hang_timeout(),
     loop->permanent_hang_timeout());
 
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  mozilla::eventtracer::Init();
-#endif
-
   return NS_OK;
 }
 
 
 //
 // NS_ShutdownXPCOM()
 //
 // The shutdown sequence for xpcom would be
@@ -1038,20 +1024,16 @@ ShutdownXPCOM(nsIServiceManager* aServMg
 
   HangMonitor::Shutdown();
 
   delete sMainHangMonitor;
   sMainHangMonitor = nullptr;
 
   BackgroundHangMonitor::Shutdown();
 
-#ifdef MOZ_VISUAL_EVENT_TRACER
-  eventtracer::Shutdown();
-#endif
-
   profiler_shutdown();
 
   NS_LogTerm();
 
 #if defined(MOZ_WIDGET_GONK)
   // This exit(0) call is intended to be temporary, to get shutdown leak
   // checking working on Linux.
   // On debug B2G, the child process crashes very late.  Instead, just
--- a/xpcom/build/XPCOMModule.inc
+++ b/xpcom/build/XPCOMModule.inc
@@ -16,19 +16,16 @@
 
     COMPONENT(PERSISTENTPROPERTIES, nsPersistentProperties::Create)
 
     COMPONENT(SUPPORTSARRAY, nsSupportsArray::Create)
     COMPONENT(ARRAY, nsArrayBase::XPCOMConstructor)
     COMPONENT(CONSOLESERVICE, nsConsoleServiceConstructor)
     COMPONENT(ATOMSERVICE, nsAtomServiceConstructor)
     COMPONENT(OBSERVERSERVICE, nsObserverService::Create)
-#ifdef MOZ_VISUAL_EVENT_TRACER
-    COMPONENT(VISUALEVENTTRACER, VisualEventTracerConstructor)
-#endif
 
     COMPONENT(TIMER, nsTimerImplConstructor)
 
 #define COMPONENT_SUPPORTS(TYPE, Type)                                         \
   COMPONENT(SUPPORTS_##TYPE, nsSupports##Type##ImplConstructor)
 
     COMPONENT_SUPPORTS(ID, ID)
     COMPONENT_SUPPORTS(STRING, String)