Bug 1406296 (part 3) - Remove the profiler's "gpu" feature. r=mstange,jrmuizel.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 06 Oct 2017 17:35:44 +1100
changeset 386040 fc53699b7d1fbb7dbb26d15adb9ef52d1eb24fa4
parent 386039 6cccd545109faa8e70703d9fc68de03976d5f142
child 386041 6a58f8ab311d961a12584fd91b05b8c5c6aa2bf0
push id32673
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:13:17 +0000
treeherdermozilla-central@196dadb2fe50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, jrmuizel
bugs1406296
milestone58.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 1406296 (part 3) - Remove the profiler's "gpu" feature. r=mstange,jrmuizel. This allows a bunch of additional stuff to be removed: ContextStateTracker, ContextStateTrackerOGL, and GPUMarkerPayload.
browser/components/extensions/schemas/geckoProfiler.json
gfx/layers/opengl/CompositorOGL.cpp
gfx/layers/opengl/CompositorOGL.h
gfx/thebes/ContextStateTracker.cpp
gfx/thebes/ContextStateTracker.h
gfx/thebes/moz.build
tools/profiler/core/ProfilerMarkerPayload.cpp
tools/profiler/public/GeckoProfiler.h
tools/profiler/public/ProfilerMarkerPayload.h
tools/profiler/tests/gtest/GeckoProfiler.cpp
--- a/browser/components/extensions/schemas/geckoProfiler.json
+++ b/browser/components/extensions/schemas/geckoProfiler.json
@@ -18,17 +18,16 @@
     "description": "Exposes the browser's profiler.",
 
     "permissions": ["geckoProfiler"],
     "types": [
       {
         "id": "ProfilerFeature",
         "type": "string",
         "enum": [
-          "gpu",
           "java",
           "js",
           "leaf",
           "mainthreadio",
           "memory",
           "privacy",
           "restyle",
           "stackwalk",
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -205,18 +205,16 @@ CompositorOGL::CleanupResources()
     ctx->fDeleteBuffers(1, &mTriangleVBO);
     mTriangleVBO = 0;
   }
 
   mGLContext->MakeCurrent();
 
   mBlitTextureImageHelper = nullptr;
 
-  mContextStateTracker.DestroyOGL(mGLContext);
-
   // On the main thread the Widget will be destroyed soon and calling MakeCurrent
   // after that could cause a crash (at least with GLX, see bug 1059793), unless
   // context is marked as destroyed.
   // There may be some textures still alive that will try to call MakeCurrent on
   // the context so let's make sure it is marked destroyed now.
   mGLContext->MarkDestroyed();
 
   mGLContext = nullptr;
@@ -583,20 +581,16 @@ CompositorOGL::CreateRenderTargetFromSou
 void
 CompositorOGL::SetRenderTarget(CompositingRenderTarget *aSurface)
 {
   MOZ_ASSERT(aSurface);
   CompositingRenderTargetOGL* surface
     = static_cast<CompositingRenderTargetOGL*>(aSurface);
   if (mCurrentRenderTarget != surface) {
     mCurrentRenderTarget = surface;
-    if (mCurrentRenderTarget) {
-      mContextStateTracker.PopOGLSection(gl(), "Frame");
-    }
-    mContextStateTracker.PushOGLSection(gl(), "Frame");
     surface->BindRenderTarget();
   }
 
   PrepareViewport(mCurrentRenderTarget);
 }
 
 CompositingRenderTarget*
 CompositorOGL::GetCurrentRenderTarget() const
@@ -1602,18 +1596,16 @@ CompositorOGL::EndFrame()
     RefPtr<DrawTarget> target = gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(IntSize(size.width, size.height), SurfaceFormat::B8G8R8A8);
     if (target) {
       CopyToTarget(target, nsIntPoint(), Matrix());
       WriteSnapshotToDumpFile(this, target);
     }
   }
 #endif
 
-  mContextStateTracker.PopOGLSection(gl(), "Frame");
-
   mFrameInProgress = false;
 
   if (mTarget) {
     CopyToTarget(mTarget, mTargetBounds.TopLeft(), Matrix());
     mGLContext->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0);
     mCurrentRenderTarget = nullptr;
     Compositor::EndFrame();
     return;
--- a/gfx/layers/opengl/CompositorOGL.h
+++ b/gfx/layers/opengl/CompositorOGL.h
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * 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/. */
 
 #ifndef MOZILLA_GFX_COMPOSITOROGL_H
 #define MOZILLA_GFX_COMPOSITOROGL_H
 
-#include "ContextStateTracker.h"
 #include "gfx2DGlue.h"
 #include "GLContextTypes.h"             // for GLContext, etc
 #include "GLDefs.h"                     // for GLuint, LOCAL_GL_TEXTURE_2D, etc
 #include "OGLShaderProgram.h"           // for ShaderProgramOGL, etc
 #include "Units.h"                      // for ScreenPoint
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/Attributes.h"         // for override, final
 #include "mozilla/RefPtr.h"             // for already_AddRefed, RefPtr
@@ -425,18 +424,16 @@ private:
    * pointing upwards, but the layers/compositor coordinate system has the
    * y-axis pointing downwards, for good reason as Web pages are typically
    * scrolled downwards. So, some flipping has to take place; FlippedY does it.
    */
   GLint FlipY(GLint y) const { return mViewportSize.height - y; }
 
   RefPtr<CompositorTexturePoolOGL> mTexturePool;
 
-  ContextStateTrackerOGL mContextStateTracker;
-
   bool mDestroyed;
 
   /**
    * Size of the OpenGL context's primary framebuffer in pixels. Used by
    * FlipY for the y-flipping calculation and by the DEAA shader.
    */
   gfx::IntSize mViewportSize;
 
deleted file mode 100644
--- a/gfx/thebes/ContextStateTracker.cpp
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; 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 "ContextStateTracker.h"
-#include "GLContext.h"
-#include "GeckoProfiler.h"
-
-#ifdef MOZ_GECKO_PROFILER
-#include "ProfilerMarkerPayload.h"
-#endif
-
-namespace mozilla {
-
-void
-ContextStateTrackerOGL::PushOGLSection(GLContext* aGL, const char* aSectionName)
-{
-#ifdef MOZ_GECKO_PROFILER
-  if (!profiler_feature_active(ProfilerFeature::GPU)) {
-    return;
-  }
-
-  if (!aGL->IsSupported(gl::GLFeature::query_objects)) {
-    return;
-  }
-
-  if (mSectionStack.Length() > 0) {
-    // We need to end the query since we're starting a new section and restore
-    // it when this section is finished.
-    aGL->fEndQuery(LOCAL_GL_TIME_ELAPSED);
-    Top().mCpuTimeEnd = TimeStamp::Now();
-  }
-
-  ContextState newSection(aSectionName);
-
-  GLuint queryObject;
-  aGL->fGenQueries(1, &queryObject);
-  newSection.mStartQueryHandle = queryObject;
-  newSection.mCpuTimeStart = TimeStamp::Now();
-
-  aGL->fBeginQuery(LOCAL_GL_TIME_ELAPSED_EXT, queryObject);
-
-  mSectionStack.AppendElement(newSection);
-#endif
-}
-
-void
-ContextStateTrackerOGL::PopOGLSection(GLContext* aGL, const char* aSectionName)
-{
-  // We might have ignored a section start if we started profiling
-  // in the middle section. If so we will ignore this unmatched end.
-  if (mSectionStack.Length() == 0) {
-    return;
-  }
-
-  int i = mSectionStack.Length() - 1;
-  MOZ_ASSERT(strcmp(mSectionStack[i].mSectionName, aSectionName) == 0);
-  aGL->fEndQuery(LOCAL_GL_TIME_ELAPSED);
-  mSectionStack[i].mCpuTimeEnd = TimeStamp::Now();
-  mCompletedSections.AppendElement(mSectionStack[i]);
-  mSectionStack.RemoveElementAt(i);
-
-  if (i - 1 >= 0) {
-    const char* sectionToRestore = Top().mSectionName;
-
-    // We need to restore the outer section
-    // Well do this by completing this section and adding a new
-    // one with the same name
-    mCompletedSections.AppendElement(Top());
-    mSectionStack.RemoveElementAt(i - 1);
-
-    ContextState newSection(sectionToRestore);
-
-    GLuint queryObject;
-    aGL->fGenQueries(1, &queryObject);
-    newSection.mStartQueryHandle = queryObject;
-    newSection.mCpuTimeStart = TimeStamp::Now();
-
-    aGL->fBeginQuery(LOCAL_GL_TIME_ELAPSED_EXT, queryObject);
-
-    mSectionStack.AppendElement(newSection);
-  }
-
-  Flush(aGL);
-}
-
-void
-ContextStateTrackerOGL::Flush(GLContext* aGL)
-{
-  TimeStamp now = TimeStamp::Now();
-
-  while (mCompletedSections.Length() != 0) {
-    // On mac we see QUERY_RESULT_AVAILABLE cause a GL flush if we query it
-    // too early. For profiling we rather have the last 200ms of data missing
-    // while causing let's measurement distortions.
-    if (mCompletedSections[0].mCpuTimeEnd + TimeDuration::FromMilliseconds(200) > now) {
-      break;
-    }
-
-    GLuint handle = mCompletedSections[0].mStartQueryHandle;
-
-    // We've waiting 200ms, content rendering at > 20 FPS will be ready. We
-    // shouldn't see any flushes now.
-    GLuint returned = 0;
-    aGL->fGetQueryObjectuiv(handle, LOCAL_GL_QUERY_RESULT_AVAILABLE, &returned);
-
-    if (!returned) {
-      break;
-    }
-
-    GLuint gpuTime = 0;
-    aGL->fGetQueryObjectuiv(handle, LOCAL_GL_QUERY_RESULT, &gpuTime);
-
-    aGL->fDeleteQueries(1, &handle);
-
-#ifdef MOZ_GECKO_PROFILER
-    if (profiler_is_active()) {
-      profiler_add_marker(
-        "gpu_timer_query",
-        MakeUnique<GPUMarkerPayload>(mCompletedSections[0].mCpuTimeStart,
-                                     mCompletedSections[0].mCpuTimeEnd,
-                                     0, gpuTime));
-    }
-#endif
-
-    mCompletedSections.RemoveElementAt(0);
-  }
-}
-
-void
-ContextStateTrackerOGL::DestroyOGL(GLContext* aGL)
-{
-  while (mCompletedSections.Length() != 0) {
-    GLuint handle = (GLuint)mCompletedSections[0].mStartQueryHandle;
-    aGL->fDeleteQueries(1, &handle);
-    mCompletedSections.RemoveElementAt(0);
-  }
-}
-
-} // namespace mozilla
-
deleted file mode 100644
--- a/gfx/thebes/ContextStateTracker.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; 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/. */
-
-#ifndef GFX_CONTEXTSTATETRACKER_H
-#define GFX_CONTEXTSTATETRACKER_H
-
-#include "GLTypes.h"
-#include "mozilla/TimeStamp.h"
-#include "nsTArray.h"
-#include <string.h>
-
-namespace mozilla {
-namespace gl {
-class GLContext;
-} // namespace gl
-
-/**
- * This class tracks the state of the context for debugging and profiling.
- * Each section pushes a new stack entry and must be matched by an end section.
- * All nested section must be ended before ending a parent section.
- */
-class ContextStateTracker {
-public:
-  ContextStateTracker() {}
-
-private:
-
-  bool IsProfiling() { return true; }
-
-protected:
-  typedef GLuint TimerQueryHandle;
-
-  class ContextState {
-  public:
-    explicit ContextState(const char* aSectionName)
-      : mSectionName(aSectionName)
-    {}
-
-    const char* mSectionName;
-    mozilla::TimeStamp mCpuTimeStart;
-    mozilla::TimeStamp mCpuTimeEnd;
-    TimerQueryHandle mStartQueryHandle;
-  };
-
-  ContextState& Top() {
-    MOZ_ASSERT(mSectionStack.Length());
-    return mSectionStack[mSectionStack.Length() - 1];
-  }
-
-  nsTArray<ContextState> mCompletedSections;
-  nsTArray<ContextState> mSectionStack;
-};
-
-/*
-class ID3D11DeviceContext;
-
-class ContextStateTrackerD3D11 final : public ContextStateTracker {
-public:
-  // TODO Implement me
-  void PushD3D11Section(ID3D11DeviceContext* aCtxt, const char* aSectionName) {}
-  void PopD3D11Section(ID3D11DeviceContext* aCtxt, const char* aSectionName) {}
-  void DestroyD3D11(ID3D11DeviceContext* aCtxt) {}
-
-private:
-  void Flush();
-};
-*/
-
-class ContextStateTrackerOGL final : public ContextStateTracker {
-  typedef mozilla::gl::GLContext GLContext;
-public:
-  void PushOGLSection(GLContext* aGL, const char* aSectionName);
-  void PopOGLSection(GLContext* aGL, const char* aSectionName);
-  void DestroyOGL(GLContext* aGL);
-private:
-  void Flush(GLContext* aGL);
-};
-
-} // namespace mozilla
-
-#endif
-
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -6,17 +6,16 @@
 
 with Files('*Text*'):
     BUG_COMPONENT = ('Core', 'Graphics: Text')
 
 with Files('*DWrite*'):
     BUG_COMPONENT = ('Core', 'Graphics: Text')
 
 EXPORTS += [
-    'ContextStateTracker.h',
     'DrawMode.h',
     'gfx2DGlue.h',
     'gfxAlphaRecovery.h',
     'gfxASurface.h',
     'gfxBaseSharedMemorySurface.h',
     'gfxBlur.h',
     'gfxColor.h',
     'gfxContext.h',
@@ -162,17 +161,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wi
 # Are we targeting x86 or x64?  If so, build gfxAlphaRecoverySSE2.cpp.
 if CONFIG['INTEL_ARCHITECTURE']:
     SOURCES += ['gfxAlphaRecoverySSE2.cpp']
     # The file uses SSE2 intrinsics, so it needs special compile flags on some
     # compilers.
     SOURCES['gfxAlphaRecoverySSE2.cpp'].flags += CONFIG['SSE2_FLAGS']
 
 SOURCES += [
-    'ContextStateTracker.cpp',
     # Includes mac system header conflicting with point/size,
     # and includes glxXlibSurface.h which drags in Xrender.h
     'gfxASurface.cpp',
     # on X11, gfxDrawable.cpp includes X headers for an old workaround which
     # we could consider removing soon (affects Ubuntus older than 10.04 LTS)
     # which currently prevent it from joining UNIFIED_SOURCES.
     'gfxDrawable.cpp',
     # gfxFontUtils.cpp and gfxPlatform.cpp include mac system header conflicting with point/size
--- a/tools/profiler/core/ProfilerMarkerPayload.cpp
+++ b/tools/profiler/core/ProfilerMarkerPayload.cpp
@@ -51,32 +51,16 @@ TracingMarkerPayload::StreamPayload(Spli
   if (mKind == TRACING_INTERVAL_START) {
     aWriter.StringProperty("interval", "start");
   } else if (mKind == TRACING_INTERVAL_END) {
     aWriter.StringProperty("interval", "end");
   }
 }
 
 void
-GPUMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                const TimeStamp& aProcessStartTime,
-                                UniqueStacks& aUniqueStacks)
-{
-  StreamCommonProps("gpu_timer_query", aWriter, aProcessStartTime,
-                    aUniqueStacks);
-
-  aWriter.DoubleProperty("cpustart",
-                         (mCpuTimeStart - aProcessStartTime).ToMilliseconds());
-  aWriter.DoubleProperty("cpuend",
-                         (mCpuTimeEnd - aProcessStartTime).ToMilliseconds());
-  aWriter.IntProperty("gpustart", (int)mGpuTimeStart);
-  aWriter.IntProperty("gpuend", (int)mGpuTimeEnd);
-}
-
-void
 IOMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
                                const TimeStamp& aProcessStartTime,
                                UniqueStacks& aUniqueStacks)
 {
   StreamCommonProps("io", aWriter, aProcessStartTime, aUniqueStacks);
   aWriter.StringProperty("source", mSource);
   if (mFilename) {
     aWriter.StringProperty("filename", mFilename.get());
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -90,49 +90,46 @@ class TimeStamp;
 //---------------------------------------------------------------------------
 
 // Higher-order macro containing all the feature info in one place. Define
 // |macro| appropriately to extract the relevant parts. Note that the number
 // values are used internally only and so can be changed without consequence.
 // Any changes to this list should also be applied to the feature list in
 // browser/components/extensions/schemas/geckoProfiler.json.
 #define PROFILER_FOR_EACH_FEATURE(macro) \
-  /* GPU Profiling (may not be supported by the GL). */ \
-  macro(0, "gpu", GPU) \
-  \
   /* Profile Java code (Android only). */ \
-  macro(1, "java", Java) \
+  macro(0, "java", Java) \
   \
   /* Get the JS engine to emit pseudostack entries in prologues/epilogues */ \
-  macro(2, "js", JS) \
+  macro(1, "js", JS) \
   \
   /* Include the C++ leaf node if not stackwalking. */ \
   /* The DevTools profiler doesn't want the native addresses. */ \
-  macro(3, "leaf", Leaf) \
+  macro(2, "leaf", Leaf) \
   \
   /* Add main thread I/O to the profile. */ \
-  macro(4, "mainthreadio", MainThreadIO) \
+  macro(3, "mainthreadio", MainThreadIO) \
   \
   /* Add memory measurements (e.g. RSS). */ \
-  macro(5, "memory", Memory) \
+  macro(4, "memory", Memory) \
   \
   /* Do not include user-identifiable information. */ \
-  macro(6, "privacy", Privacy) \
+  macro(5, "privacy", Privacy) \
   \
   /* Restyle profiling. */ \
-  macro(7, "restyle", Restyle) \
+  macro(6, "restyle", Restyle) \
   \
   /* Walk the C++ stack. Not available on all platforms. */ \
-  macro(8, "stackwalk", StackWalk) \
+  macro(7, "stackwalk", StackWalk) \
   \
   /* Start profiling with feature TaskTracer. */ \
-  macro(9, "tasktracer", TaskTracer) \
+  macro(8, "tasktracer", TaskTracer) \
   \
   /* Profile the registered secondary threads. */ \
-  macro(10, "threads", Threads)
+  macro(9, "threads", Threads)
 
 struct ProfilerFeature
 {
   #define DECLARE(n_, str_, Name_) \
     static const uint32_t Name_ = (1u << n_); \
     static bool Has##Name_(uint32_t aFeatures) { return aFeatures & Name_; } \
     static void Set##Name_(uint32_t& aFeatures) { aFeatures |= Name_; } \
     static void Clear##Name_(uint32_t& aFeatures) { aFeatures &= ~Name_; }
--- a/tools/profiler/public/ProfilerMarkerPayload.h
+++ b/tools/profiler/public/ProfilerMarkerPayload.h
@@ -197,39 +197,16 @@ public:
   {}
 
   DECL_STREAM_PAYLOAD
 
 private:
   mozilla::TimeStamp mVsyncTimestamp;
 };
 
-class GPUMarkerPayload : public ProfilerMarkerPayload
-{
-public:
-  GPUMarkerPayload(const mozilla::TimeStamp& aCpuTimeStart,
-                   const mozilla::TimeStamp& aCpuTimeEnd,
-                   uint64_t aGpuTimeStart,
-                   uint64_t aGpuTimeEnd)
-    : ProfilerMarkerPayload(aCpuTimeStart, aCpuTimeEnd)
-    , mCpuTimeStart(aCpuTimeStart)
-    , mCpuTimeEnd(aCpuTimeEnd)
-    , mGpuTimeStart(aGpuTimeStart)
-    , mGpuTimeEnd(aGpuTimeEnd)
-  {}
-
-  DECL_STREAM_PAYLOAD
-
-private:
-  mozilla::TimeStamp mCpuTimeStart;
-  mozilla::TimeStamp mCpuTimeEnd;
-  uint64_t mGpuTimeStart;
-  uint64_t mGpuTimeEnd;
-};
-
 class GCSliceMarkerPayload : public ProfilerMarkerPayload
 {
 public:
   GCSliceMarkerPayload(const mozilla::TimeStamp& aStartTime,
                        const mozilla::TimeStamp& aEndTime,
                        JS::UniqueChars&& aTimingJSON)
    : ProfilerMarkerPayload(aStartTime, aEndTime),
      mTimingJSON(mozilla::Move(aTimingJSON))
--- a/tools/profiler/tests/gtest/GeckoProfiler.cpp
+++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp
@@ -35,17 +35,17 @@ static void
 InactiveFeaturesAndParamsCheck()
 {
   int entries;
   double interval;
   uint32_t features;
   StrVec filters;
 
   ASSERT_TRUE(!profiler_is_active());
-  ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::GPU));
+  ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::MainThreadIO));
   ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Privacy));
   ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
   profiler_get_start_params(&entries, &interval, &features, &filters);
 
   ASSERT_TRUE(entries == 0);
   ASSERT_TRUE(interval == 0);
   ASSERT_TRUE(features == 0);
@@ -80,38 +80,39 @@ TEST(GeckoProfiler, FeaturesAndParams)
   {
     uint32_t features = ProfilerFeature::JS | ProfilerFeature::Threads;
     const char* filters[] = { "GeckoMain", "Compositor" };
 
     profiler_start(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                    features, filters, MOZ_ARRAY_LENGTH(filters));
 
     ASSERT_TRUE(profiler_is_active());
-    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::GPU));
+    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::MainThreadIO));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Privacy));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
     ActiveParamsCheck(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                       features, filters, MOZ_ARRAY_LENGTH(filters));
 
     profiler_stop();
 
     InactiveFeaturesAndParamsCheck();
   }
 
   // Try some different features and filters.
   {
-    uint32_t features = ProfilerFeature::GPU | ProfilerFeature::Privacy;
+    uint32_t features = ProfilerFeature::MainThreadIO |
+                        ProfilerFeature::Privacy;
     const char* filters[] = { "GeckoMain", "Foo", "Bar" };
 
     profiler_start(999999, 3,
                    features, filters, MOZ_ARRAY_LENGTH(filters));
 
     ASSERT_TRUE(profiler_is_active());
-    ASSERT_TRUE(profiler_feature_active(ProfilerFeature::GPU));
+    ASSERT_TRUE(profiler_feature_active(ProfilerFeature::MainThreadIO));
     ASSERT_TRUE(profiler_feature_active(ProfilerFeature::Privacy));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
     // Profiler::Threads is added because filters has multiple entries.
     ActiveParamsCheck(999999, 3,
                       features | ProfilerFeature::Threads,
                       filters, MOZ_ARRAY_LENGTH(filters));
 
@@ -124,17 +125,17 @@ TEST(GeckoProfiler, FeaturesAndParams)
   {
     uint32_t availableFeatures = profiler_get_available_features();
     const char* filters[] = { "" };
 
     profiler_start(88888, 10,
                    availableFeatures, filters, MOZ_ARRAY_LENGTH(filters));
 
     ASSERT_TRUE(profiler_is_active());
-    ASSERT_TRUE(profiler_feature_active(ProfilerFeature::GPU));
+    ASSERT_TRUE(profiler_feature_active(ProfilerFeature::MainThreadIO));
     ASSERT_TRUE(profiler_feature_active(ProfilerFeature::Privacy));
     ASSERT_TRUE(profiler_feature_active(ProfilerFeature::Restyle));
 
     ActiveParamsCheck(88888, 10,
                       availableFeatures, filters, MOZ_ARRAY_LENGTH(filters));
 
     // Don't call profiler_stop() here.
   }
@@ -145,17 +146,17 @@ TEST(GeckoProfiler, FeaturesAndParams)
     const char* filters[] = { "NoThreadWillMatchThis" };
 
     // Second profiler_start() call in a row without an intervening
     // profiler_stop(); this will do an implicit profiler_stop() and restart.
     profiler_start(0, 0,
                    features, filters, MOZ_ARRAY_LENGTH(filters));
 
     ASSERT_TRUE(profiler_is_active());
-    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::GPU));
+    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::MainThreadIO));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Privacy));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
     // Entries and intervals go to defaults if 0 is specified.
     ActiveParamsCheck(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                       features | ProfilerFeature::Threads,
                       filters, MOZ_ARRAY_LENGTH(filters));
 
@@ -265,17 +266,17 @@ TEST(GeckoProfiler, DifferentThreads)
                                               PROFILER_DEFAULT_INTERVAL,
                                               features,
                                               filters,
                                               MOZ_ARRAY_LENGTH(filters));
                              }),
       NS_DISPATCH_SYNC);
 
     ASSERT_TRUE(profiler_is_active());
-    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::GPU));
+    ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::MainThreadIO));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Privacy));
     ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
     ActiveParamsCheck(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                       features, filters, MOZ_ARRAY_LENGTH(filters));
 
     thread->Dispatch(
       NS_NewRunnableFunction("GeckoProfiler_DifferentThreads_Test::TestBody",
@@ -294,17 +295,17 @@ TEST(GeckoProfiler, DifferentThreads)
     profiler_start(PROFILER_DEFAULT_ENTRIES, PROFILER_DEFAULT_INTERVAL,
                   features, filters, MOZ_ARRAY_LENGTH(filters));
 
     thread->Dispatch(
       NS_NewRunnableFunction(
         "GeckoProfiler_DifferentThreads_Test::TestBody",
         [&]() {
           ASSERT_TRUE(profiler_is_active());
-          ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::GPU));
+          ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::MainThreadIO));
           ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Privacy));
           ASSERT_TRUE(!profiler_feature_active(ProfilerFeature::Restyle));
 
           ActiveParamsCheck(PROFILER_DEFAULT_ENTRIES,
                             PROFILER_DEFAULT_INTERVAL,
                             features,
                             filters,
                             MOZ_ARRAY_LENGTH(filters));