Bug 1671536 - Remove BaseProfilerMarkerPayload.h and dependents - r=gregtatum
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 16 Oct 2020 22:10:36 +0000
changeset 553325 c14038de028d8d4970e7bd512dca86ac59c4cbf6
parent 553324 24bc2812bca90e5d08f06926aaa226c2e3e3b833
child 553326 e9136664b05f8ee5856254ef08d70dcf5fa4677b
push id37869
push userrmaries@mozilla.com
push dateSat, 17 Oct 2020 09:14:56 +0000
treeherdermozilla-central@f9a6da3ea564 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregtatum
bugs1671536
milestone83.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 1671536 - Remove BaseProfilerMarkerPayload.h and dependents - r=gregtatum Everything related to Base Profiler legacy markers can now be removed, only the new API from BaseProfilerMarkers.h should now be used. Depends on D93737 Differential Revision: https://phabricator.services.mozilla.com/D93738
mozglue/baseprofiler/core/ProfileBuffer.cpp
mozglue/baseprofiler/core/ProfileBufferEntry.cpp
mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
mozglue/baseprofiler/core/RegisteredThread.cpp
mozglue/baseprofiler/core/VTuneProfiler.h
mozglue/baseprofiler/core/platform.cpp
mozglue/baseprofiler/moz.build
mozglue/baseprofiler/public/BaseProfiler.h
mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
mozglue/tests/TestBaseProfiler.cpp
--- a/mozglue/baseprofiler/core/ProfileBuffer.cpp
+++ b/mozglue/baseprofiler/core/ProfileBuffer.cpp
@@ -141,17 +141,17 @@ void ProfileBuffer::CollectOverheadStats
     // we need both ends of an interval to know its duration). The final
     // difference should be insignificant over the expected many thousands
     // of iterations.
     mIntervalsNs.Count(timeNs - mLastSamplingTimeNs);
   }
   mLastSamplingTimeNs = timeNs;
   // Time to take the lock before sampling.
   double lockingNs = aLocking.ToMilliseconds() * 1000.0;
-  // Time to discard expired markers.
+  // Time to discard expired data.
   double cleaningNs = aCleaning.ToMilliseconds() * 1000.0;
   // Time to gather all counters.
   double countersNs = aCounters.ToMilliseconds() * 1000.0;
   // Time to sample all threads.
   double threadsNs = aThreads.ToMilliseconds() * 1000.0;
 
   // Add to our gathered stats.
   mOverheadsNs.Count(lockingNs + cleaningNs + countersNs + threadsNs);
--- a/mozglue/baseprofiler/core/ProfileBufferEntry.cpp
+++ b/mozglue/baseprofiler/core/ProfileBufferEntry.cpp
@@ -9,17 +9,16 @@
 #include <ostream>
 #include <type_traits>
 
 #include "mozilla/Logging.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/StackWalk.h"
 
 #include "BaseProfiler.h"
-#include "BaseProfilerMarkerPayload.h"
 #include "mozilla/BaseProfilerMarkers.h"
 #include "platform.h"
 #include "ProfileBuffer.h"
 #include "ProfilerBacktrace.h"
 
 namespace mozilla {
 namespace baseprofiler {
 
@@ -448,35 +447,35 @@ class EntryGetter {
 // (
 //   ( /* Samples */
 //     ThreadId
 //     Time
 //     ( NativeLeafAddr
 //     | Label FrameFlags? DynamicStringFragment* LineNumber? CategoryPair?
 //     | JitReturnAddr
 //     )+
-//     Marker*
 //     Responsiveness?
 //   )
+//   | MarkerData
 //   | ( /* Counters */
 //       CounterId
 //       Time
 //       (
 //         CounterKey
 //         Count
 //         Number?
 //       )*
 //     )
 //   | CollectionStart
 //   | CollectionEnd
 //   | Pause
 //   | Resume
 //   | ( ProfilerOverheadTime /* Sampling start timestamp */
 //       ProfilerOverheadDuration /* Lock acquisition */
-//       ProfilerOverheadDuration /* Expired markers cleaning */
+//       ProfilerOverheadDuration /* Expired data cleaning */
 //       ProfilerOverheadDuration /* Counters */
 //       ProfilerOverheadDuration /* Threads */
 //     )
 // )*
 //
 // The most complicated part is the stack entry sequence that begins with
 // Label. Here are some examples.
 //
@@ -589,18 +588,18 @@ void ProfileBuffer::StreamSamplesToJSON(
       // This is useful in three situations.
       //
       // - The circular buffer overwrites old entries, so when we start parsing
       //   we might be in the middle of a sample, and we must skip forward to
       //   the start of the next sample.
       //
       // - We skip samples that don't have an appropriate ThreadId or Time.
       //
-      // - We skip range Pause, Resume, CollectionStart, Marker, Counter
-      //   and CollectionEnd entries between samples.
+      // - We skip range Pause, Resume, CollectionStart, Counter and
+      //   CollectionEnd entries between samples.
       while (e.Has()) {
         if (e.Get().IsThreadId()) {
           break;
         }
         e.Next();
       }
 
       if (!e.Has()) {
@@ -805,71 +804,32 @@ void ProfileBuffer::StreamMarkersToJSON(
                                         double aSinceTime,
                                         UniqueStacks& aUniqueStacks) const {
   mEntries.ReadEach([&](ProfileBufferEntryReader& aER) {
     auto type = static_cast<ProfileBufferEntry::Kind>(
         aER.ReadObject<ProfileBufferEntry::KindUnderlyingType>());
     MOZ_ASSERT(static_cast<ProfileBufferEntry::KindUnderlyingType>(type) <
                static_cast<ProfileBufferEntry::KindUnderlyingType>(
                    ProfileBufferEntry::Kind::MODERN_LIMIT));
-    // Code should *break* from the switch if the entry was not fully read.
-    // Code should *return* from the switch if the entry was fully read.
-    switch (type) {
-      case ProfileBufferEntry::Kind::MarkerData:
-        if (aER.ReadObject<int>() != aThreadId) {
-          break;
-        }
-        // Schema:
-        //   [name, time, category, data]
-        aWriter.StartArrayElement();
-        {
-          std::string name = aER.ReadObject<std::string>();
-          const ProfilingCategoryPairInfo& info = GetProfilingCategoryPairInfo(
-              static_cast<ProfilingCategoryPair>(aER.ReadObject<uint32_t>()));
-          auto payload = aER.ReadObject<UniquePtr<ProfilerMarkerPayload>>();
-          double time = aER.ReadObject<double>();
-          MOZ_ASSERT(aER.RemainingBytes() == 0);
-
-          aUniqueStacks.mUniqueStrings->WriteElement(aWriter, name.c_str());
-          aWriter.DoubleElement(time);
-          aWriter.IntElement(unsigned(info.mCategory));
-          if (payload) {
-            aWriter.StartObjectElement(SpliceableJSONWriter::SingleLineStyle);
-            {
-              payload->StreamPayload(aWriter, aProcessStartTime, aUniqueStacks);
-            }
-            aWriter.EndObject();
-          }
-        }
-        aWriter.EndArray();
-        return;
-
-      case ProfileBufferEntry::Kind::Marker:
-        if (::mozilla::base_profiler_markers_detail::
-                DeserializeAfterKindAndStream(
-                    aER, aWriter, aThreadId,
-                    [&](const mozilla::ProfilerString8View& aName) {
-                      aUniqueStacks.mUniqueStrings->WriteElement(
-                          aWriter, aName.String().c_str());
-                    },
-                    [&](ProfileChunkedBuffer& aChunkedBuffer) {
-                      ProfilerBacktrace backtrace("", aThreadId,
-                                                  &aChunkedBuffer);
-                      backtrace.StreamJSON(
-                          aWriter, TimeStamp::ProcessCreation(), aUniqueStacks);
-                    })) {
-          return;
-        }
-        break;
-
-      default:
-        break;
+    if (type != ProfileBufferEntry::Kind::Marker ||
+        !::mozilla::base_profiler_markers_detail::DeserializeAfterKindAndStream(
+            aER, aWriter, aThreadId,
+            [&](const mozilla::ProfilerString8View& aName) {
+              aUniqueStacks.mUniqueStrings->WriteElement(
+                  aWriter, aName.String().c_str());
+            },
+            [&](ProfileChunkedBuffer& aChunkedBuffer) {
+              ProfilerBacktrace backtrace("", aThreadId, &aChunkedBuffer);
+              backtrace.StreamJSON(aWriter, TimeStamp::ProcessCreation(),
+                                   aUniqueStacks);
+            })) {
+      // Not a marker, or marker for another thread.
+      // We probably didn't read the whole entry, so we need to skip to the end.
+      aER.SetRemainingBytes(0);
     }
-
-    aER.SetRemainingBytes(0);
   });
 }
 
 void ProfileBuffer::StreamProfilerOverheadToJSON(
     SpliceableJSONWriter& aWriter, const TimeStamp& aProcessStartTime,
     double aSinceTime) const {
   mEntries.Read([&](ProfileChunkedBuffer::Reader* aReader) {
     MOZ_ASSERT(aReader,
deleted file mode 100644
--- a/mozglue/baseprofiler/core/ProfilerMarkerPayload.cpp
+++ /dev/null
@@ -1,588 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; 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/. */
-
-#include "BaseProfilerMarkerPayload.h"
-
-#include "BaseProfiler.h"
-#include "ProfileBufferEntry.h"
-#include "ProfilerBacktrace.h"
-
-#include "mozilla/BaseProfileJSONWriter.h"
-#include "mozilla/Maybe.h"
-#include "mozilla/Sprintf.h"
-
-#include <inttypes.h>
-
-namespace mozilla {
-namespace baseprofiler {
-
-static UniquePtr<ProfilerMarkerPayload> DeserializeNothing(
-    mozilla::ProfileBufferEntryReader&) {
-  return nullptr;
-}
-
-// Number of currently-registered deserializers.
-// Starting at 1 for the initial `DeserializeNothing`.
-// static
-Atomic<ProfilerMarkerPayload::DeserializerTagAtomic, ReleaseAcquire>
-    ProfilerMarkerPayload::sDeserializerCount{1};
-
-// Initialize `sDeserializers` with `DeserializeNothing` at index 0, all others
-// are nullptrs.
-// static
-ProfilerMarkerPayload::Deserializer
-    ProfilerMarkerPayload::sDeserializers[DeserializerMax] = {
-        DeserializeNothing};
-
-// static
-ProfilerMarkerPayload::DeserializerTag
-ProfilerMarkerPayload::TagForDeserializer(
-    ProfilerMarkerPayload::Deserializer aDeserializer) {
-  if (!aDeserializer) {
-    return 0;
-  }
-  // Start first search at index 0.
-  DeserializerTagAtomic start = 0;
-  for (;;) {
-    // Read the current count of deserializers.
-    const DeserializerTagAtomic tagCount = sDeserializerCount;
-    if (tagCount == 0) {
-      // Someone else is currently writing into the array, loop around until we
-      // get a valid count.
-      continue;
-    }
-    for (DeserializerTagAtomic i = start; i < tagCount; ++i) {
-      if (sDeserializers[i] == aDeserializer) {
-        // Deserializer already registered, return its tag.
-        return static_cast<ProfilerMarkerPayload::DeserializerTag>(i);
-      }
-    }
-    // Not found yet, let's register this new deserializer.
-    // Make sure we haven't reached the limit yet.
-    MOZ_RELEASE_ASSERT(tagCount < DeserializerMax);
-    // Reserve `tagCount` as an index, if not already claimed:
-    // If `sDeserializerCount` is still at our previously-read `tagCount`,
-    // replace it with a special 0 value to indicate a write.
-    if (sDeserializerCount.compareExchange(tagCount, 0)) {
-      // Here we own the `tagCount` index, write the deserializer there.
-      sDeserializers[tagCount] = aDeserializer;
-      // And publish by writing the real new count (1 past our index).
-      sDeserializerCount = tagCount + 1;
-      return static_cast<ProfilerMarkerPayload::DeserializerTag>(tagCount);
-    }
-    // Someone else beat us to grab an index, and it could be for the same
-    // deserializer! So let's just try searching starting from our recorded
-    // `tagCount` (and maybe attempting again to register). It should be rare
-    // enough and quick enough that it won't impact performances.
-    start = tagCount;
-  }
-}
-
-// static
-ProfilerMarkerPayload::Deserializer ProfilerMarkerPayload::DeserializerForTag(
-    ProfilerMarkerPayload::DeserializerTag aTag) {
-  MOZ_RELEASE_ASSERT(aTag < DeserializerMax);
-  MOZ_RELEASE_ASSERT(aTag < sDeserializerCount);
-  return sDeserializers[aTag];
-}
-
-static void MOZ_ALWAYS_INLINE WriteTime(SpliceableJSONWriter& aWriter,
-                                        const TimeStamp& aProcessStartTime,
-                                        const TimeStamp& aTime,
-                                        const char* aName) {
-  if (!aTime.IsNull()) {
-    aWriter.DoubleProperty(MakeStringSpan(aName),
-                           (aTime - aProcessStartTime).ToMilliseconds());
-  }
-}
-
-void ProfilerMarkerPayload::StreamType(const char* aMarkerType,
-                                       SpliceableJSONWriter& aWriter) const {
-  MOZ_ASSERT(aMarkerType);
-  aWriter.StringProperty("type", MakeStringSpan(aMarkerType));
-}
-
-ProfileBufferEntryWriter::Length
-ProfilerMarkerPayload::CommonPropsTagAndSerializationBytes() const {
-  return sizeof(DeserializerTag) +
-         ProfileBufferEntryWriter::SumBytes(
-             mCommonProps.mStartTime, mCommonProps.mEndTime,
-             mCommonProps.mStack, mCommonProps.mInnerWindowID);
-}
-
-void ProfilerMarkerPayload::SerializeTagAndCommonProps(
-    DeserializerTag aDeserializerTag,
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  aEntryWriter.WriteObject(aDeserializerTag);
-  aEntryWriter.WriteObject(mCommonProps.mStartTime);
-  aEntryWriter.WriteObject(mCommonProps.mEndTime);
-  aEntryWriter.WriteObject(mCommonProps.mStack);
-  aEntryWriter.WriteObject(mCommonProps.mInnerWindowID);
-}
-
-// static
-ProfilerMarkerPayload::CommonProps
-ProfilerMarkerPayload::DeserializeCommonProps(
-    ProfileBufferEntryReader& aEntryReader) {
-  CommonProps props;
-  aEntryReader.ReadIntoObject(props.mStartTime);
-  aEntryReader.ReadIntoObject(props.mEndTime);
-  aEntryReader.ReadIntoObject(props.mStack);
-  aEntryReader.ReadIntoObject(props.mInnerWindowID);
-  return props;
-}
-
-void ProfilerMarkerPayload::StreamCommonProps(
-    const char* aMarkerType, SpliceableJSONWriter& aWriter,
-    const TimeStamp& aProcessStartTime, UniqueStacks& aUniqueStacks) const {
-  StreamType(aMarkerType, aWriter);
-  WriteTime(aWriter, aProcessStartTime, mCommonProps.mStartTime, "startTime");
-  WriteTime(aWriter, aProcessStartTime, mCommonProps.mEndTime, "endTime");
-  if (mCommonProps.mInnerWindowID) {
-    // Here, we are converting uint64_t to double. Both Browsing Context and
-    // Inner Window IDs are creating using
-    // `nsContentUtils::GenerateProcessSpecificId`, which is specifically
-    // designed to only use 53 of the 64 bits to be lossless when passed into
-    // and out of JS as a double.
-    aWriter.DoubleProperty("innerWindowID", mCommonProps.mInnerWindowID.ref());
-  }
-  if (mCommonProps.mStack) {
-    aWriter.StartObjectProperty("stack");
-    {
-      mCommonProps.mStack->StreamJSON(aWriter, aProcessStartTime,
-                                      aUniqueStacks);
-    }
-    aWriter.EndObject();
-  }
-}
-
-TracingMarkerPayload::TracingMarkerPayload(
-    const char* aCategory, TracingKind aKind,
-    const Maybe<uint64_t>& aInnerWindowID, UniqueProfilerBacktrace aCause)
-    : ProfilerMarkerPayload(aInnerWindowID, std::move(aCause)),
-      mCategory(aCategory),
-      mKind(aKind) {}
-
-TracingMarkerPayload::TracingMarkerPayload(CommonProps&& aCommonProps,
-                                           const char* aCategory,
-                                           TracingKind aKind)
-    : ProfilerMarkerPayload(std::move(aCommonProps)),
-      mCategory(aCategory),
-      mKind(aKind) {}
-
-TracingMarkerPayload::~TracingMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length
-TracingMarkerPayload::TagAndSerializationBytes() const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(
-             WrapProfileBufferRawPointer(mCategory), mKind);
-}
-
-void TracingMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(WrapProfileBufferRawPointer(mCategory));
-  aEntryWriter.WriteObject(mKind);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> TracingMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  const char* category = aEntryReader.ReadObject<const char*>();
-  TracingKind kind = aEntryReader.ReadObject<TracingKind>();
-  return UniquePtr<ProfilerMarkerPayload>(
-      new TracingMarkerPayload(std::move(props), category, kind));
-}
-
-void TracingMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                         const TimeStamp& aProcessStartTime,
-                                         UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("tracing", aWriter, aProcessStartTime, aUniqueStacks);
-
-  if (mCategory) {
-    aWriter.StringProperty("category", MakeStringSpan(mCategory));
-  }
-
-  if (mKind == TRACING_INTERVAL_START) {
-    aWriter.StringProperty("interval", "start");
-  } else if (mKind == TRACING_INTERVAL_END) {
-    aWriter.StringProperty("interval", "end");
-  }
-}
-
-FileIOMarkerPayload::FileIOMarkerPayload(const char* aOperation,
-                                         const char* aSource,
-                                         const char* aFilename,
-                                         const TimeStamp& aStartTime,
-                                         const TimeStamp& aEndTime,
-                                         UniqueProfilerBacktrace aStack)
-    : ProfilerMarkerPayload(aStartTime, aEndTime, Nothing(), std::move(aStack)),
-      mSource(aSource),
-      mOperation(aOperation ? strdup(aOperation) : nullptr),
-      mFilename(aFilename ? strdup(aFilename) : nullptr) {
-  MOZ_ASSERT(aSource);
-}
-
-FileIOMarkerPayload::FileIOMarkerPayload(CommonProps&& aCommonProps,
-                                         const char* aSource,
-                                         UniqueFreePtr<char>&& aOperation,
-                                         UniqueFreePtr<char>&& aFilename)
-    : ProfilerMarkerPayload(std::move(aCommonProps)),
-      mSource(aSource),
-      mOperation(std::move(aOperation)),
-      mFilename(std::move(aFilename)) {}
-
-FileIOMarkerPayload::~FileIOMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length FileIOMarkerPayload::TagAndSerializationBytes()
-    const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(
-             WrapProfileBufferRawPointer(mSource), mOperation, mFilename);
-}
-
-void FileIOMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(WrapProfileBufferRawPointer(mSource));
-  aEntryWriter.WriteObject(mOperation);
-  aEntryWriter.WriteObject(mFilename);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> FileIOMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  auto source = aEntryReader.ReadObject<const char*>();
-  auto operation = aEntryReader.ReadObject<UniqueFreePtr<char>>();
-  auto filename = aEntryReader.ReadObject<UniqueFreePtr<char>>();
-  return UniquePtr<ProfilerMarkerPayload>(new FileIOMarkerPayload(
-      std::move(props), source, std::move(operation), std::move(filename)));
-}
-
-void FileIOMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                        const TimeStamp& aProcessStartTime,
-                                        UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("FileIO", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.StringProperty("operation", MakeStringSpan(mOperation.get()));
-  aWriter.StringProperty("source", MakeStringSpan(mSource));
-  if (mFilename && *mFilename) {
-    aWriter.StringProperty("filename", MakeStringSpan(mFilename.get()));
-  }
-}
-
-UserTimingMarkerPayload::UserTimingMarkerPayload(
-    const std::string& aName, const TimeStamp& aStartTime,
-    const Maybe<uint64_t>& aInnerWindowID)
-    : ProfilerMarkerPayload(aStartTime, aStartTime, aInnerWindowID),
-      mEntryType("mark"),
-      mName(aName) {}
-
-UserTimingMarkerPayload::UserTimingMarkerPayload(
-    const std::string& aName, const Maybe<std::string>& aStartMark,
-    const Maybe<std::string>& aEndMark, const TimeStamp& aStartTime,
-    const TimeStamp& aEndTime, const Maybe<uint64_t>& aInnerWindowID)
-    : ProfilerMarkerPayload(aStartTime, aEndTime, aInnerWindowID),
-      mEntryType("measure"),
-      mName(aName),
-      mStartMark(aStartMark),
-      mEndMark(aEndMark) {}
-
-UserTimingMarkerPayload::UserTimingMarkerPayload(
-    CommonProps&& aCommonProps, const char* aEntryType, std::string&& aName,
-    Maybe<std::string>&& aStartMark, Maybe<std::string>&& aEndMark)
-    : ProfilerMarkerPayload(std::move(aCommonProps)),
-      mEntryType(aEntryType),
-      mName(std::move(aName)),
-      mStartMark(std::move(aStartMark)),
-      mEndMark(std::move(aEndMark)) {}
-
-UserTimingMarkerPayload::~UserTimingMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length
-UserTimingMarkerPayload::TagAndSerializationBytes() const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(
-             WrapProfileBufferRawPointer(mEntryType), mName, mStartMark,
-             mEndMark);
-}
-
-void UserTimingMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(WrapProfileBufferRawPointer(mEntryType));
-  aEntryWriter.WriteObject(mName);
-  aEntryWriter.WriteObject(mStartMark);
-  aEntryWriter.WriteObject(mEndMark);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> UserTimingMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  auto entryType = aEntryReader.ReadObject<const char*>();
-  auto name = aEntryReader.ReadObject<std::string>();
-  auto startMark = aEntryReader.ReadObject<Maybe<std::string>>();
-  auto endMark = aEntryReader.ReadObject<Maybe<std::string>>();
-  return UniquePtr<ProfilerMarkerPayload>(
-      new UserTimingMarkerPayload(std::move(props), entryType, std::move(name),
-                                  std::move(startMark), std::move(endMark)));
-}
-
-void UserTimingMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                            const TimeStamp& aProcessStartTime,
-                                            UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("UserTiming", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.StringProperty("name", mName);
-  aWriter.StringProperty("entryType", MakeStringSpan(mEntryType));
-
-  if (mStartMark.isSome()) {
-    aWriter.StringProperty("startMark", mStartMark.ref());
-  } else {
-    aWriter.NullProperty("startMark");
-  }
-  if (mEndMark.isSome()) {
-    aWriter.StringProperty("endMark", mEndMark.ref());
-  } else {
-    aWriter.NullProperty("endMark");
-  }
-}
-
-TextMarkerPayload::TextMarkerPayload(const std::string& aText,
-                                     const TimeStamp& aStartTime)
-    : ProfilerMarkerPayload(aStartTime, aStartTime), mText(aText) {}
-
-TextMarkerPayload::TextMarkerPayload(const std::string& aText,
-                                     const TimeStamp& aStartTime,
-                                     const TimeStamp& aEndTime)
-    : ProfilerMarkerPayload(aStartTime, aEndTime), mText(aText) {}
-
-TextMarkerPayload::TextMarkerPayload(const std::string& aText,
-                                     const TimeStamp& aStartTime,
-                                     const Maybe<uint64_t>& aInnerWindowID)
-    : ProfilerMarkerPayload(aStartTime, aStartTime, aInnerWindowID),
-      mText(aText) {}
-
-TextMarkerPayload::TextMarkerPayload(const std::string& aText,
-                                     const TimeStamp& aStartTime,
-                                     const TimeStamp& aEndTime,
-                                     const Maybe<uint64_t>& aInnerWindowID,
-                                     UniqueProfilerBacktrace aCause)
-    : ProfilerMarkerPayload(aStartTime, aEndTime, aInnerWindowID,
-                            std::move(aCause)),
-      mText(aText) {}
-
-TextMarkerPayload::TextMarkerPayload(CommonProps&& aCommonProps,
-                                     std::string&& aText)
-    : ProfilerMarkerPayload(std::move(aCommonProps)), mText(std::move(aText)) {}
-
-TextMarkerPayload::~TextMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length TextMarkerPayload::TagAndSerializationBytes()
-    const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(mText);
-}
-
-void TextMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(mText);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> TextMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  auto text = aEntryReader.ReadObject<std::string>();
-  return UniquePtr<ProfilerMarkerPayload>(
-      new TextMarkerPayload(std::move(props), std::move(text)));
-}
-
-void TextMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                      const TimeStamp& aProcessStartTime,
-                                      UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("Text", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.StringProperty("name", mText);
-}
-
-LogMarkerPayload::LogMarkerPayload(const char* aModule, const char* aText,
-                                   const TimeStamp& aStartTime)
-    : ProfilerMarkerPayload(aStartTime, aStartTime),
-      mModule(aModule),
-      mText(aText) {}
-
-LogMarkerPayload::LogMarkerPayload(CommonProps&& aCommonProps,
-                                   std::string&& aModule, std::string&& aText)
-    : ProfilerMarkerPayload(std::move(aCommonProps)),
-      mModule(std::move(aModule)),
-      mText(std::move(aText)) {}
-
-LogMarkerPayload::~LogMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length LogMarkerPayload::TagAndSerializationBytes()
-    const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(mModule, mText);
-}
-
-void LogMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(mModule);
-  aEntryWriter.WriteObject(mText);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> LogMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  auto module = aEntryReader.ReadObject<std::string>();
-  auto text = aEntryReader.ReadObject<std::string>();
-  return UniquePtr<ProfilerMarkerPayload>(new LogMarkerPayload(
-      std::move(props), std::move(module), std::move(text)));
-}
-
-void LogMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                     const TimeStamp& aProcessStartTime,
-                                     UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("Log", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.StringProperty("name", mText);
-  aWriter.StringProperty("module", mModule);
-}
-
-MediaSampleMarkerPayload::MediaSampleMarkerPayload(
-    const int64_t aSampleStartTimeUs, const int64_t aSampleEndTimeUs)
-    : mSampleStartTimeUs(aSampleStartTimeUs),
-      mSampleEndTimeUs(aSampleEndTimeUs) {}
-
-MediaSampleMarkerPayload::MediaSampleMarkerPayload(
-    CommonProps&& aCommonProps, const int64_t aSampleStartTimeUs,
-    const int64_t aSampleEndTimeUs)
-    : ProfilerMarkerPayload(std::move(aCommonProps)),
-      mSampleStartTimeUs(aSampleStartTimeUs),
-      mSampleEndTimeUs(aSampleEndTimeUs) {}
-
-ProfileBufferEntryWriter::Length
-MediaSampleMarkerPayload::TagAndSerializationBytes() const {
-  return CommonPropsTagAndSerializationBytes() +
-         ProfileBufferEntryWriter::SumBytes(mSampleStartTimeUs,
-                                            mSampleEndTimeUs);
-}
-
-void MediaSampleMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(mSampleStartTimeUs);
-  aEntryWriter.WriteObject(mSampleEndTimeUs);
-}
-
-/* static */
-UniquePtr<ProfilerMarkerPayload> MediaSampleMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  auto sampleStartTimeUs = aEntryReader.ReadObject<int64_t>();
-  auto sampleEndTimeUs = aEntryReader.ReadObject<int64_t>();
-  return UniquePtr<ProfilerMarkerPayload>(new MediaSampleMarkerPayload(
-      std::move(props), sampleStartTimeUs, sampleEndTimeUs));
-}
-
-void MediaSampleMarkerPayload::StreamPayload(
-    SpliceableJSONWriter& aWriter, const TimeStamp& aProcessStartTime,
-    UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("MediaSample", aWriter, aProcessStartTime, aUniqueStacks);
-  aWriter.IntProperty("sampleStartTimeUs", mSampleStartTimeUs);
-  aWriter.IntProperty("sampleEndTimeUs", mSampleEndTimeUs);
-}
-
-HangMarkerPayload::HangMarkerPayload(const TimeStamp& aStartTime,
-                                     const TimeStamp& aEndTime)
-    : ProfilerMarkerPayload(aStartTime, aEndTime) {}
-
-HangMarkerPayload::HangMarkerPayload(CommonProps&& aCommonProps)
-    : ProfilerMarkerPayload(std::move(aCommonProps)) {}
-
-HangMarkerPayload::~HangMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length HangMarkerPayload::TagAndSerializationBytes()
-    const {
-  return CommonPropsTagAndSerializationBytes();
-}
-
-void HangMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> HangMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  return UniquePtr<ProfilerMarkerPayload>(
-      new HangMarkerPayload(std::move(props)));
-}
-
-void HangMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                      const TimeStamp& aProcessStartTime,
-                                      UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("BHR-detected hang", aWriter, aProcessStartTime,
-                    aUniqueStacks);
-}
-
-LongTaskMarkerPayload::LongTaskMarkerPayload(const TimeStamp& aStartTime,
-                                             const TimeStamp& aEndTime)
-    : ProfilerMarkerPayload(aStartTime, aEndTime) {}
-
-LongTaskMarkerPayload::LongTaskMarkerPayload(CommonProps&& aCommonProps)
-    : ProfilerMarkerPayload(std::move(aCommonProps)) {}
-
-LongTaskMarkerPayload::~LongTaskMarkerPayload() = default;
-
-ProfileBufferEntryWriter::Length
-LongTaskMarkerPayload::TagAndSerializationBytes() const {
-  return CommonPropsTagAndSerializationBytes();
-}
-
-void LongTaskMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-}
-
-// static
-UniquePtr<ProfilerMarkerPayload> LongTaskMarkerPayload::Deserialize(
-    ProfileBufferEntryReader& aEntryReader) {
-  ProfilerMarkerPayload::CommonProps props =
-      DeserializeCommonProps(aEntryReader);
-  return UniquePtr<ProfilerMarkerPayload>(
-      new LongTaskMarkerPayload(std::move(props)));
-}
-
-void LongTaskMarkerPayload::StreamPayload(SpliceableJSONWriter& aWriter,
-                                          const TimeStamp& aProcessStartTime,
-                                          UniqueStacks& aUniqueStacks) const {
-  StreamCommonProps("MainThreadLongTask", aWriter, aProcessStartTime,
-                    aUniqueStacks);
-  aWriter.StringProperty("category", "LongTask");
-}
-
-}  // namespace baseprofiler
-}  // namespace mozilla
--- a/mozglue/baseprofiler/core/RegisteredThread.cpp
+++ b/mozglue/baseprofiler/core/RegisteredThread.cpp
@@ -26,17 +26,16 @@ RegisteredThread::RegisteredThread(Threa
 RegisteredThread::~RegisteredThread() {}
 
 size_t RegisteredThread::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
   size_t n = aMallocSizeOf(this);
 
   // Measurement of the following members may be added later if DMD finds it
   // is worthwhile:
   // - mPlatformData
-  // - mRacyRegisteredThread.mPendingMarkers
   //
   // The following members are not measured:
   // - mThreadInfo: because it is non-owning
 
   return n;
 }
 
 }  // namespace baseprofiler
--- a/mozglue/baseprofiler/core/VTuneProfiler.h
+++ b/mozglue/baseprofiler/core/VTuneProfiler.h
@@ -38,16 +38,22 @@
 namespace mozilla {
 namespace baseprofiler {
 
 class VTuneProfiler {
  public:
   static void Initialize();
   static void Shutdown();
 
+  enum TracingKind {
+    TRACING_EVENT,
+    TRACING_INTERVAL_START,
+    TRACING_INTERVAL_END,
+  };
+
   static void Trace(const char* aName, TracingKind aKind) {
     if (mInstance) {
       mInstance->TraceInternal(aName, aKind);
     }
   }
   static void RegisterThread(const char* aName) {
     if (mInstance) {
       mInstance->RegisterThreadInternal(aName);
--- a/mozglue/baseprofiler/core/platform.cpp
+++ b/mozglue/baseprofiler/core/platform.cpp
@@ -4,19 +4,19 @@
  * 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/. */
 
 // There are three kinds of samples done by the profiler.
 //
 // - A "periodic" sample is the most complex kind. It is done in response to a
 //   timer while the profiler is active. It involves writing a stack trace plus
 //   a variety of other values (memory measurements, responsiveness
-//   measurements, markers, etc.) into the main ProfileBuffer. The sampling is
-//   done from off-thread, and so SuspendAndSampleAndResumeThread() is used to
-//   get the register values.
+//   measurements, etc.) into the main ProfileBuffer. The sampling is done from
+//   off-thread, and so SuspendAndSampleAndResumeThread() is used to get the
+//   register values.
 //
 // - A "synchronous" sample is a simpler kind. It is done in response to an API
 //   call (profiler_get_backtrace()). It involves writing a stack trace and
 //   little else into a temporary ProfileBuffer, and wrapping that up in a
 //   ProfilerBacktrace that can be subsequently used in a marker. The sampling
 //   is done on-thread, and so Registers::SyncPopulate() is used to get the
 //   register values.
 //
@@ -58,17 +58,16 @@
 #include "prtime.h"
 
 #include "BaseProfiler.h"
 #include "BaseProfilingCategory.h"
 #include "PageInformation.h"
 #include "ProfiledThreadData.h"
 #include "ProfilerBacktrace.h"
 #include "ProfileBuffer.h"
-#include "BaseProfilerMarkerPayload.h"
 #include "RegisteredThread.h"
 #include "BaseProfilerSharedLibraries.h"
 #include "ThreadInfo.h"
 #include "VTuneProfiler.h"
 
 // Win32 builds always have frame pointers, so FramePointerStackWalk() always
 // works.
 #if defined(GP_PLAT_x86_windows)
@@ -3340,20 +3339,16 @@ void profiler_add_sampled_counter(BasePr
 void profiler_remove_sampled_counter(BaseProfilerCount* aCounter) {
   DEBUG_LOG("profiler_remove_sampled_counter(%s)", aCounter->mLabel);
   PSAutoLock lock;
   // Note: we don't enforce a final sample, though we could do so if the
   // profiler was active
   CorePS::RemoveCounter(lock, aCounter);
 }
 
-static void maybelocked_profiler_add_marker_for_thread(
-    int aThreadId, ProfilingCategoryPair aCategoryPair, const char* aMarkerName,
-    const ProfilerMarkerPayload& aPayload, const PSAutoLock* aLockOrNull);
-
 ProfilingStack* profiler_register_thread(const char* aName,
                                          void* aGuessStackTop) {
   DEBUG_LOG("profiler_register_thread(%s)", aName);
 
   MOZ_RELEASE_ASSERT(CorePS::Exists());
 
   PSAutoLock lock;
 
@@ -3619,163 +3614,24 @@ bool profiler_is_locked_on_current_threa
   // So we must return `true` for any of:
   // - The main profiler mutex, used by most functions, and/or
   // - The buffer mutex, used directly in some functions without locking the
   //   main mutex, e.g., marker-related functions.
   return PSAutoLock::IsLockedOnCurrentThread() ||
          CorePS::CoreBuffer().IsThreadSafeAndLockedOnCurrentThread();
 }
 
-static void racy_profiler_add_marker(const char* aMarkerName,
-                                     ProfilingCategoryPair aCategoryPair,
-                                     const ProfilerMarkerPayload* aPayload) {
-  MOZ_RELEASE_ASSERT(CorePS::Exists());
-
-  // This function is hot enough that we use RacyFeatures, not ActivePS.
-  if (!profiler_can_accept_markers()) {
-    return;
-  }
-
-  // Note that it's possible that the above test would change again before we
-  // actually record the marker. Because of this imprecision it's possible to
-  // miss a marker or record one we shouldn't. Either way is not a big deal.
-
-  RacyRegisteredThread* racyRegisteredThread =
-      TLSRegisteredThread::RacyRegisteredThread();
-  if (!racyRegisteredThread || !racyRegisteredThread->IsBeingProfiled()) {
-    return;
-  }
-
-  TimeStamp origin = (aPayload && !aPayload->GetStartTime().IsNull())
-                         ? aPayload->GetStartTime()
-                         : TimeStamp::NowUnfuzzed();
-  TimeDuration delta = origin - CorePS::ProcessStartTime();
-  CorePS::CoreBuffer().PutObjects(
-      ProfileBufferEntry::Kind::MarkerData, racyRegisteredThread->ThreadId(),
-      WrapProfileBufferUnownedCString(aMarkerName),
-      static_cast<uint32_t>(aCategoryPair), aPayload, delta.ToMilliseconds());
-}
-
-void profiler_add_marker(const char* aMarkerName,
-                         ProfilingCategoryPair aCategoryPair,
-                         const ProfilerMarkerPayload& aPayload) {
-  racy_profiler_add_marker(aMarkerName, aCategoryPair, &aPayload);
-}
-
 // This is a simplified version of profiler_add_marker that can be easily passed
 // into the JS engine.
 void profiler_add_js_marker(const char* aMarkerName, const char* aMarkerText) {
   BASE_PROFILER_MARKER_TEXT(
       ProfilerString8View::WrapNullTerminatedString(aMarkerName), JS, {},
       ProfilerString8View::WrapNullTerminatedString(aMarkerText));
 }
 
-static void maybelocked_profiler_add_marker_for_thread(
-    int aThreadId, ProfilingCategoryPair aCategoryPair, const char* aMarkerName,
-    const ProfilerMarkerPayload& aPayload, const PSAutoLock* aLockOrNull) {
-  MOZ_RELEASE_ASSERT(CorePS::Exists());
-
-  if (!profiler_can_accept_markers()) {
-    return;
-  }
-
-#ifdef DEBUG
-  auto checkThreadId = [](int aThreadId, const PSAutoLock& aLock) {
-    if (!ActivePS::Exists(aLock)) {
-      return;
-    }
-
-    // Assert that our thread ID makes sense
-    bool realThread = false;
-    const Vector<UniquePtr<RegisteredThread>>& registeredThreads =
-        CorePS::RegisteredThreads(aLock);
-    for (auto& thread : registeredThreads) {
-      RefPtr<ThreadInfo> info = thread->Info();
-      if (info->ThreadId() == aThreadId) {
-        realThread = true;
-        break;
-      }
-    }
-    MOZ_ASSERT(realThread, "Invalid thread id");
-  };
-
-  if (aLockOrNull) {
-    checkThreadId(aThreadId, *aLockOrNull);
-  } else {
-    PSAutoLock lock;
-    checkThreadId(aThreadId, lock);
-  }
-#endif
-
-  // Insert the marker into the buffer
-  TimeStamp origin = (!aPayload.GetStartTime().IsNull())
-                         ? aPayload.GetStartTime()
-                         : TimeStamp::NowUnfuzzed();
-  TimeDuration delta = origin - CorePS::ProcessStartTime();
-  CorePS::CoreBuffer().PutObjects(
-      ProfileBufferEntry::Kind::MarkerData, aThreadId,
-      WrapProfileBufferUnownedCString(aMarkerName),
-      static_cast<uint32_t>(aCategoryPair), &aPayload, delta.ToMilliseconds());
-}
-
-void profiler_add_marker_for_thread(int aThreadId,
-                                    ProfilingCategoryPair aCategoryPair,
-                                    const char* aMarkerName,
-                                    const ProfilerMarkerPayload& aPayload) {
-  return maybelocked_profiler_add_marker_for_thread(
-      aThreadId, aCategoryPair, aMarkerName, aPayload, nullptr);
-}
-
-void profiler_add_marker_for_mainthread(ProfilingCategoryPair aCategoryPair,
-                                        const char* aMarkerName,
-                                        const ProfilerMarkerPayload& aPayload) {
-  profiler_add_marker_for_thread(profiler_main_thread_id(), aCategoryPair,
-                                 aMarkerName, aPayload);
-}
-
-void profiler_tracing_marker(const char* aCategoryString,
-                             const char* aMarkerName,
-                             ProfilingCategoryPair aCategoryPair,
-                             TracingKind aKind,
-                             const Maybe<uint64_t>& aInnerWindowID) {
-  MOZ_RELEASE_ASSERT(CorePS::Exists());
-
-  VTUNE_TRACING(aMarkerName, aKind);
-
-  // This function is hot enough that we use RacyFeatures, notActivePS.
-  if (!profiler_can_accept_markers()) {
-    return;
-  }
-
-  AUTO_PROFILER_STATS(base_add_marker_with_TracingMarkerPayload);
-  profiler_add_marker(
-      aMarkerName, aCategoryPair,
-      TracingMarkerPayload(aCategoryString, aKind, aInnerWindowID));
-}
-
-void profiler_tracing_marker(const char* aCategoryString,
-                             const char* aMarkerName,
-                             ProfilingCategoryPair aCategoryPair,
-                             TracingKind aKind, UniqueProfilerBacktrace aCause,
-                             const Maybe<uint64_t>& aInnerWindowID) {
-  MOZ_RELEASE_ASSERT(CorePS::Exists());
-
-  VTUNE_TRACING(aMarkerName, aKind);
-
-  // This function is hot enough that we use RacyFeatures, notActivePS.
-  if (!profiler_can_accept_markers()) {
-    return;
-  }
-
-  AUTO_PROFILER_STATS(base_add_marker_with_TracingMarkerPayload);
-  profiler_add_marker(aMarkerName, aCategoryPair,
-                      TracingMarkerPayload(aCategoryString, aKind,
-                                           aInnerWindowID, std::move(aCause)));
-}
-
 // NOTE: aCollector's methods will be called while the target thread is paused.
 // Doing things in those methods like allocating -- which may try to claim
 // locks -- is a surefire way to deadlock.
 void profiler_suspend_and_sample_thread(int aThreadId, uint32_t aFeatures,
                                         ProfilerStackCollector& aCollector,
                                         bool aSampleNative /* = true */) {
   // Lock the profiler mutex
   PSAutoLock lock;
--- a/mozglue/baseprofiler/moz.build
+++ b/mozglue/baseprofiler/moz.build
@@ -7,30 +7,28 @@
 # This is pretty much a copy from tools/profiler, cut down to exclude anything
 # that cannot work in mozglue (because they are totally dependent on libxul-
 # specific code).
 # All exported headers now prefixed with "Base" to avoid #include name clashes.
 
 if CONFIG['MOZ_GECKO_PROFILER']:
     DEFINES['IMPL_MFBT'] = True
     EXPORTS += [
-        'public/BaseProfilerMarkerPayload.h',
         'public/BaseProfilerSharedLibraries.h',
         'public/BaseProfilingCategory.h',
         'public/BaseProfilingStack.h',
         'public/ProfilingCategoryList.h',
     ]
     UNIFIED_SOURCES += [
         'core/PageInformation.cpp',
         'core/platform.cpp',
         'core/ProfileBuffer.cpp',
         'core/ProfileBufferEntry.cpp',
         'core/ProfiledThreadData.cpp',
         'core/ProfilerBacktrace.cpp',
-        'core/ProfilerMarkerPayload.cpp',
         'core/ProfilerMarkers.cpp',
         'core/ProfilingCategory.cpp',
         'core/ProfilingStack.cpp',
         'core/RegisteredThread.cpp',
     ]
 
     if CONFIG['OS_TARGET'] in ('Android', 'Linux', 'FreeBSD'):
         if CONFIG['CPU_ARCH'] in ('arm', 'aarch64', 'x86', 'x86_64', 'mips64'):
--- a/mozglue/baseprofiler/public/BaseProfiler.h
+++ b/mozglue/baseprofiler/public/BaseProfiler.h
@@ -48,24 +48,16 @@
 #  define AUTO_BASE_PROFILER_LABEL(label, categoryPair)
 #  define AUTO_BASE_PROFILER_LABEL_CATEGORY_PAIR(categoryPair)
 #  define AUTO_BASE_PROFILER_LABEL_DYNAMIC_CSTR(label, categoryPair, cStr)
 #  define AUTO_BASE_PROFILER_LABEL_DYNAMIC_STRING(label, categoryPair, str)
 #  define AUTO_BASE_PROFILER_LABEL_FAST(label, categoryPair, ctx)
 #  define AUTO_BASE_PROFILER_LABEL_DYNAMIC_FAST(label, dynamicString, \
                                                 categoryPair, ctx, flags)
 
-#  define BASE_PROFILER_ADD_MARKER_WITH_PAYLOAD( \
-      markerName, categoryPair, PayloadType, parenthesizedPayloadArgs)
-
-#  define BASE_PROFILER_TRACING_MARKER(categoryString, markerName, \
-                                       categoryPair, kind)
-#  define AUTO_BASE_PROFILER_TRACING_MARKER(categoryString, markerName, \
-                                            categoryPair)
-
 #  define AUTO_PROFILER_STATS(name)
 
 // Function stubs for when MOZ_GECKO_PROFILER is not defined.
 
 namespace mozilla {
 // This won't be used, it's just there to allow the empty definition of
 // `profiler_capture_backtrace`.
 class ProfileChunkedBuffer {};
@@ -117,17 +109,16 @@ namespace mozilla {
 class MallocAllocPolicy;
 class ProfileChunkedBuffer;
 template <class T, size_t MinInlineCapacity, class AllocPolicy>
 class Vector;
 
 namespace baseprofiler {
 
 class ProfilerBacktrace;
-class ProfilerMarkerPayload;
 class SpliceableJSONWriter;
 
 // Macros used by the AUTO_PROFILER_* macros below.
 #  define BASE_PROFILER_RAII_PASTE(id, line) id##line
 #  define BASE_PROFILER_RAII_EXPAND(id, line) BASE_PROFILER_RAII_PASTE(id, line)
 #  define BASE_PROFILER_RAII BASE_PROFILER_RAII_EXPAND(raiiObject, __LINE__)
 
 //---------------------------------------------------------------------------
@@ -453,18 +444,17 @@ inline bool profiler_is_active() {
   return baseprofiler::detail::RacyFeatures::IsActive();
 }
 
 // Same as profiler_is_active(), but with the same extra checks that determine
 // if the profiler would currently store markers. So this should be used before
 // doing some potentially-expensive work that's used in a marker. E.g.:
 //
 //   if (profiler_can_accept_markers()) {
-//     ExpensiveMarkerPayload expensivePayload = CreateExpensivePayload();
-//     BASE_PROFILER_ADD_MARKER_WITH_PAYLOAD(name, OTHER, expensivePayload);
+//     BASE_PROFILER_MARKER(name, OTHER, SomeMarkerType, expensivePayload);
 //   }
 inline bool profiler_can_accept_markers() {
   return baseprofiler::detail::RacyFeatures::IsActiveAndUnpaused();
 }
 
 // Is the profiler active, and is the current thread being profiled?
 // (Same caveats and recommented usage as profiler_is_active().)
 inline bool profiler_thread_is_being_profiled() {
@@ -808,86 +798,24 @@ namespace baseprofiler {
 // an additional set of flags. The flags parameter should carry values from the
 // ProfilingStackFrame::Flags enum.
 #  define AUTO_BASE_PROFILER_LABEL_DYNAMIC_FAST(label, dynamicString,     \
                                                 categoryPair, ctx, flags) \
     ::mozilla::baseprofiler::AutoProfilerLabel BASE_PROFILER_RAII(        \
         ctx, label, dynamicString,                                        \
         ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair, flags)
 
-// `PayloadType` is a sub-class of BaseMarkerPayload, `parenthesizedPayloadArgs`
-// is the argument list used to construct that `PayloadType`. E.g.:
-// `BASE_PROFILER_ADD_MARKER_WITH_PAYLOAD("Load", DOM, TextMarkerPayload,
-//                                        ("text", start, end, ds, dsh))`
-#  define BASE_PROFILER_ADD_MARKER_WITH_PAYLOAD(                        \
-      markerName, categoryPair, PayloadType, parenthesizedPayloadArgs)  \
-    do {                                                                \
-      AUTO_PROFILER_STATS(base_add_marker_with_##PayloadType);          \
-      ::mozilla::baseprofiler::profiler_add_marker(                     \
-          markerName,                                                   \
-          ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair, \
-          PayloadType parenthesizedPayloadArgs);                        \
-    } while (false)
-
-MFBT_API void profiler_add_marker(const char* aMarkerName,
-                                  ProfilingCategoryPair aCategoryPair,
-                                  const ProfilerMarkerPayload& aPayload);
-
 MFBT_API void profiler_add_js_marker(const char* aMarkerName,
                                      const char* aMarkerText);
 
 // Returns true if the profiler lock is currently held *on the current thread*.
 // This may be used by re-entrant code that may call profiler functions while
 // the profiler already has the lock (which would deadlock).
 bool profiler_is_locked_on_current_thread();
 
-// Insert a marker in the profile timeline for a specified thread.
-MFBT_API void profiler_add_marker_for_thread(
-    int aThreadId, ProfilingCategoryPair aCategoryPair, const char* aMarkerName,
-    const ProfilerMarkerPayload& aPayload);
-
-// Insert a marker in the profile timeline for the main thread.
-// This may be used to gather some markers from any thread, that should be
-// displayed in the main thread track.
-MFBT_API void profiler_add_marker_for_mainthread(
-    ProfilingCategoryPair aCategoryPair, const char* aMarkerName,
-    const ProfilerMarkerPayload& aPayload);
-
-enum TracingKind {
-  TRACING_EVENT,
-  TRACING_INTERVAL_START,
-  TRACING_INTERVAL_END,
-};
-
-// Adds a tracing marker to the profile. A no-op if the profiler is inactive.
-
-#  define BASE_PROFILER_TRACING_MARKER(categoryString, markerName, \
-                                       categoryPair, kind)         \
-    ::mozilla::baseprofiler::profiler_tracing_marker(              \
-        categoryString, markerName,                                \
-        ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair, kind)
-
-MFBT_API void profiler_tracing_marker(
-    const char* aCategoryString, const char* aMarkerName,
-    ProfilingCategoryPair aCategoryPair, TracingKind aKind,
-    const Maybe<uint64_t>& aInnerWindowID = Nothing());
-MFBT_API void profiler_tracing_marker(
-    const char* aCategoryString, const char* aMarkerName,
-    ProfilingCategoryPair aCategoryPair, TracingKind aKind,
-    UniqueProfilerBacktrace aCause,
-    const Maybe<uint64_t>& aInnerWindowID = Nothing());
-
-// Adds a START/END pair of tracing markers.
-#  define AUTO_BASE_PROFILER_TRACING_MARKER(categoryString, markerName, \
-                                            categoryPair)               \
-    ::mozilla::baseprofiler::AutoProfilerTracing BASE_PROFILER_RAII(    \
-        categoryString, markerName,                                     \
-        ::mozilla::baseprofiler::ProfilingCategoryPair::categoryPair,   \
-        Nothing())
-
 //---------------------------------------------------------------------------
 // Output profiles
 //---------------------------------------------------------------------------
 
 // Set a user-friendly process name, used in JSON stream.
 MFBT_API void profiler_set_process_name(const std::string& aProcessName,
                                         const std::string* aETLDplus1);
 
@@ -1010,54 +938,16 @@ class MOZ_RAII AutoProfilerLabel {
   // TLS lookup in the dtor.
   ProfilingStack* mProfilingStack;
 
  public:
   // See the comment on the definition in platform.cpp for details about this.
   static MOZ_THREAD_LOCAL(ProfilingStack*) sProfilingStack;
 };
 
-class MOZ_RAII AutoProfilerTracing {
- public:
-  AutoProfilerTracing(const char* aCategoryString, const char* aMarkerName,
-                      ProfilingCategoryPair aCategoryPair,
-                      const Maybe<uint64_t>& aInnerWindowID)
-      : mCategoryString(aCategoryString),
-        mMarkerName(aMarkerName),
-        mCategoryPair(aCategoryPair),
-        mInnerWindowID(aInnerWindowID) {
-    profiler_tracing_marker(mCategoryString, mMarkerName, aCategoryPair,
-                            TRACING_INTERVAL_START, mInnerWindowID);
-  }
-
-  AutoProfilerTracing(const char* aCategoryString, const char* aMarkerName,
-                      ProfilingCategoryPair aCategoryPair,
-                      UniqueProfilerBacktrace aBacktrace,
-                      const Maybe<uint64_t>& aInnerWindowID)
-      : mCategoryString(aCategoryString),
-        mMarkerName(aMarkerName),
-        mCategoryPair(aCategoryPair),
-        mInnerWindowID(aInnerWindowID) {
-    profiler_tracing_marker(mCategoryString, mMarkerName, aCategoryPair,
-                            TRACING_INTERVAL_START, std::move(aBacktrace),
-                            mInnerWindowID);
-  }
-
-  ~AutoProfilerTracing() {
-    profiler_tracing_marker(mCategoryString, mMarkerName, mCategoryPair,
-                            TRACING_INTERVAL_END, mInnerWindowID);
-  }
-
- protected:
-  const char* mCategoryString;
-  const char* mMarkerName;
-  const ProfilingCategoryPair mCategoryPair;
-  const Maybe<uint64_t> mInnerWindowID;
-};
-
 // Get the MOZ_PROFILER_STARTUP* environment variables that should be
 // supplied to a child process that is about to be launched, in order
 // to make that child process start with the same profiler settings as
 // in the current process.  The given function is invoked once for
 // each variable to be set.
 MFBT_API void GetProfilerEnvVarsForChildProcess(
     std::function<void(const char* key, const char* value)>&& aSetEnv);
 
deleted file mode 100644
--- a/mozglue/baseprofiler/public/BaseProfilerMarkerPayload.h
+++ /dev/null
@@ -1,390 +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/. */
-
-#ifndef BaseProfilerMarkerPayload_h
-#define BaseProfilerMarkerPayload_h
-
-#include "BaseProfiler.h"
-
-#ifndef MOZ_GECKO_PROFILER
-#  error Do not #include this header when MOZ_GECKO_PROFILER is not #defined.
-#endif
-
-#include "mozilla/Atomics.h"
-#include "mozilla/Maybe.h"
-#include "mozilla/ProfileBufferEntrySerialization.h"
-#include "mozilla/RefPtr.h"
-#include "mozilla/TimeStamp.h"
-#include "mozilla/UniquePtr.h"
-#include "mozilla/UniquePtrExtensions.h"
-
-namespace mozilla {
-namespace baseprofiler {
-
-class SpliceableJSONWriter;
-class UniqueStacks;
-
-// This is an abstract class that can be implemented to supply data to be
-// attached with a profiler marker.
-//
-// When subclassing this, note that the destructor can be called on any thread,
-// i.e. not necessarily on the thread that created the object.
-class ProfilerMarkerPayload {
- public:
-  explicit ProfilerMarkerPayload(
-      const Maybe<uint64_t>& aInnerWindowID = Nothing(),
-      UniqueProfilerBacktrace aStack = nullptr)
-      : mCommonProps{TimeStamp{}, TimeStamp{}, std::move(aStack),
-                     aInnerWindowID} {}
-
-  ProfilerMarkerPayload(const TimeStamp& aStartTime, const TimeStamp& aEndTime,
-                        const Maybe<uint64_t>& aInnerWindowID = Nothing(),
-                        UniqueProfilerBacktrace aStack = nullptr)
-      : mCommonProps{aStartTime, aEndTime, std::move(aStack), aInnerWindowID} {}
-
-  virtual ~ProfilerMarkerPayload() {}
-
-  // Compute the number of bytes needed to serialize the `DeserializerTag` and
-  // payload, including in the no-payload (nullptr) case.
-  static ProfileBufferEntryWriter::Length TagAndSerializationBytes(
-      const ProfilerMarkerPayload* aPayload) {
-    if (!aPayload) {
-      return sizeof(DeserializerTag);
-    }
-    return aPayload->TagAndSerializationBytes();
-  }
-
-  // Serialize the payload into an EntryWriter, including in the no-payload
-  // (nullptr) case. Must be of the exact size given by
-  // `TagAndSerializationBytes(aPayload)`.
-  static void TagAndSerialize(const ProfilerMarkerPayload* aPayload,
-                              ProfileBufferEntryWriter& aEntryWriter) {
-    if (!aPayload) {
-      aEntryWriter.WriteObject(DeserializerTag(0));
-      return;
-    }
-    aPayload->SerializeTagAndPayload(aEntryWriter);
-  }
-
-  // Deserialize a payload from an EntryReader, including in the no-payload
-  // (nullptr) case.
-  static UniquePtr<ProfilerMarkerPayload> DeserializeTagAndPayload(
-      mozilla::ProfileBufferEntryReader& aER) {
-    const auto tag = aER.ReadObject<DeserializerTag>();
-    Deserializer deserializer = DeserializerForTag(tag);
-    return deserializer(aER);
-  }
-
-  virtual void StreamPayload(SpliceableJSONWriter& aWriter,
-                             const TimeStamp& aProcessStartTime,
-                             UniqueStacks& aUniqueStacks) const = 0;
-
-  TimeStamp GetStartTime() const { return mCommonProps.mStartTime; }
-
- protected:
-  // A `Deserializer` is a free function that can read a serialized payload from
-  // an `EntryReader` and return a reconstructed `ProfilerMarkerPayload`
-  // sub-object (may be null if there was no payload).
-  typedef UniquePtr<ProfilerMarkerPayload> (*Deserializer)(
-      ProfileBufferEntryReader&);
-
-  // A `DeserializerTag` will be added before the payload, to help select the
-  // correct deserializer when reading back the payload.
-  using DeserializerTag = unsigned char;
-
-  // This needs to be big enough to handle all possible sub-types of
-  // ProfilerMarkerPayload.
-  static constexpr DeserializerTag DeserializerMax = 32;
-
-  // We need an atomic type that can hold a `DeserializerTag`. (Atomic doesn't
-  // work with too-small types.)
-  using DeserializerTagAtomic = int;
-
-  // Number of currently-registered deserializers.
-  static Atomic<DeserializerTagAtomic, ReleaseAcquire> sDeserializerCount;
-
-  // List of currently-registered deserializers.
-  // sDeserializers[0] is a no-payload deserializer.
-  static Deserializer sDeserializers[DeserializerMax];
-
-  // Get the `DeserializerTag` for a `Deserializer` (which gets registered on
-  // the first call.) Tag 0 means no payload; a null `aDeserializer` gives that
-  // 0 tag.
-  MFBT_API static DeserializerTag TagForDeserializer(
-      Deserializer aDeserializer);
-
-  // Get the `Deserializer` for a given `DeserializerTag`.
-  // Tag 0 is reserved as no-payload deserializer (which returns nullptr).
-  MFBT_API static Deserializer DeserializerForTag(DeserializerTag aTag);
-
-  struct CommonProps {
-    TimeStamp mStartTime;
-    TimeStamp mEndTime;
-    UniqueProfilerBacktrace mStack;
-    Maybe<uint64_t> mInnerWindowID;
-  };
-
-  // Deserializers can use this base constructor.
-  explicit ProfilerMarkerPayload(CommonProps&& aCommonProps)
-      : mCommonProps(std::move(aCommonProps)) {}
-
-  // Serialization/deserialization of common props in ProfilerMarkerPayload.
-  MFBT_API ProfileBufferEntryWriter::Length
-  CommonPropsTagAndSerializationBytes() const;
-  MFBT_API void SerializeTagAndCommonProps(
-      DeserializerTag aDeserializerTag,
-      ProfileBufferEntryWriter& aEntryWriter) const;
-  MFBT_API static CommonProps DeserializeCommonProps(
-      ProfileBufferEntryReader& aEntryReader);
-
-  MFBT_API void StreamType(const char* aMarkerType,
-                           SpliceableJSONWriter& aWriter) const;
-
-  MFBT_API void StreamCommonProps(const char* aMarkerType,
-                                  SpliceableJSONWriter& aWriter,
-                                  const TimeStamp& aProcessStartTime,
-                                  UniqueStacks& aUniqueStacks) const;
-
- private:
-  // Compute the number of bytes needed to serialize the `DeserializerTag` and
-  // payload in `SerializeTagAndPayload` below.
-  virtual ProfileBufferEntryWriter::Length TagAndSerializationBytes() const = 0;
-
-  // Serialize the `DeserializerTag` and payload into an EntryWriter.
-  // Must be of the exact size given by `TagAndSerializationBytes()`.
-  virtual void SerializeTagAndPayload(
-      ProfileBufferEntryWriter& aEntryWriter) const = 0;
-
-  CommonProps mCommonProps;
-};
-
-#define DECL_BASE_STREAM_PAYLOAD                                               \
-  MFBT_API void StreamPayload(                                                 \
-      ::mozilla::baseprofiler::SpliceableJSONWriter& aWriter,                  \
-      const ::mozilla::TimeStamp& aProcessStartTime,                           \
-      ::mozilla::baseprofiler::UniqueStacks& aUniqueStacks) const override;    \
-  static UniquePtr<ProfilerMarkerPayload> Deserialize(                         \
-      ProfileBufferEntryReader& aEntryReader);                                 \
-  MFBT_API ProfileBufferEntryWriter::Length TagAndSerializationBytes()         \
-      const override;                                                          \
-  MFBT_API void SerializeTagAndPayload(ProfileBufferEntryWriter& aEntryWriter) \
-      const override;
-
-// TODO: Increase the coverage of tracing markers that include InnerWindowID
-// information
-class TracingMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API TracingMarkerPayload(
-      const char* aCategory, TracingKind aKind,
-      const Maybe<uint64_t>& aInnerWindowID = Nothing(),
-      UniqueProfilerBacktrace aCause = nullptr);
-
-  MFBT_API ~TracingMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API TracingMarkerPayload(CommonProps&& aCommonProps,
-                                const char* aCategory, TracingKind aKind);
-
-  const char* mCategory;
-  TracingKind mKind;
-};
-
-class FileIOMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API FileIOMarkerPayload(const char* aOperation, const char* aSource,
-                               const char* aFilename,
-                               const TimeStamp& aStartTime,
-                               const TimeStamp& aEndTime,
-                               UniqueProfilerBacktrace aStack);
-
-  MFBT_API ~FileIOMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API FileIOMarkerPayload(CommonProps&& aCommonProps, const char* aSource,
-                               UniqueFreePtr<char>&& aOperation,
-                               UniqueFreePtr<char>&& aFilename);
-
-  const char* mSource;
-  UniqueFreePtr<char> mOperation;
-  UniqueFreePtr<char> mFilename;
-};
-
-class UserTimingMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API UserTimingMarkerPayload(const std::string& aName,
-                                   const TimeStamp& aStartTime,
-                                   const Maybe<uint64_t>& aInnerWindowID);
-
-  MFBT_API UserTimingMarkerPayload(const std::string& aName,
-                                   const Maybe<std::string>& aStartMark,
-                                   const Maybe<std::string>& aEndMark,
-                                   const TimeStamp& aStartTime,
-                                   const TimeStamp& aEndTime,
-                                   const Maybe<uint64_t>& aInnerWindowID);
-
-  MFBT_API ~UserTimingMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API UserTimingMarkerPayload(CommonProps&& aCommonProps,
-                                   const char* aEntryType, std::string&& aName,
-                                   Maybe<std::string>&& aStartMark,
-                                   Maybe<std::string>&& aEndMark);
-
-  // Either "mark" or "measure".
-  const char* mEntryType;
-  std::string mName;
-  Maybe<std::string> mStartMark;
-  Maybe<std::string> mEndMark;
-};
-
-class HangMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API HangMarkerPayload(const TimeStamp& aStartTime,
-                             const TimeStamp& aEndTime);
-
-  MFBT_API ~HangMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API explicit HangMarkerPayload(CommonProps&& aCommonProps);
-};
-
-class LongTaskMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API LongTaskMarkerPayload(const TimeStamp& aStartTime,
-                                 const TimeStamp& aEndTime);
-
-  MFBT_API ~LongTaskMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API explicit LongTaskMarkerPayload(CommonProps&& aCommonProps);
-};
-
-class TextMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API TextMarkerPayload(const std::string& aText,
-                             const TimeStamp& aStartTime);
-
-  MFBT_API TextMarkerPayload(const std::string& aText,
-                             const TimeStamp& aStartTime,
-                             const TimeStamp& aEndTime);
-
-  MFBT_API TextMarkerPayload(const std::string& aText,
-                             const TimeStamp& aStartTime,
-                             const Maybe<uint64_t>& aInnerWindowID);
-
-  MFBT_API TextMarkerPayload(const std::string& aText,
-                             const TimeStamp& aStartTime,
-                             const TimeStamp& aEndTime,
-                             const Maybe<uint64_t>& aInnerWindowID,
-                             UniqueProfilerBacktrace aCause = nullptr);
-
-  MFBT_API ~TextMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API TextMarkerPayload(CommonProps&& aCommonProps, std::string&& aText);
-
-  std::string mText;
-};
-
-class LogMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API LogMarkerPayload(const char* aModule, const char* aText,
-                            const TimeStamp& aStartTime);
-
-  MFBT_API ~LogMarkerPayload() override;
-
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API LogMarkerPayload(CommonProps&& aCommonProps, std::string&& aModule,
-                            std::string&& aText);
-
-  std::string mModule;  // longest known LazyLogModule name is ~24
-  std::string mText;
-};
-
-class MediaSampleMarkerPayload : public ProfilerMarkerPayload {
- public:
-  MFBT_API MediaSampleMarkerPayload(const int64_t aSampleStartTimeUs,
-                                    const int64_t aSampleEndTimeUs);
-  DECL_BASE_STREAM_PAYLOAD
-
- private:
-  MFBT_API MediaSampleMarkerPayload(CommonProps&& aCommonProps,
-                                    const int64_t aSampleStartTimeUs,
-                                    const int64_t aSampleEndTimeUs);
-
-  int64_t mSampleStartTimeUs;
-  int64_t mSampleEndTimeUs;
-};
-
-}  // namespace baseprofiler
-
-// Serialize a pointed-at ProfilerMarkerPayload, may be null when there are no
-// payloads.
-template <>
-struct ProfileBufferEntryWriter::Serializer<
-    const baseprofiler::ProfilerMarkerPayload*> {
-  static Length Bytes(const baseprofiler::ProfilerMarkerPayload* aPayload) {
-    return baseprofiler::ProfilerMarkerPayload::TagAndSerializationBytes(
-        aPayload);
-  }
-
-  static void Write(ProfileBufferEntryWriter& aEW,
-                    const baseprofiler::ProfilerMarkerPayload* aPayload) {
-    baseprofiler::ProfilerMarkerPayload::TagAndSerialize(aPayload, aEW);
-  }
-};
-
-// Serialize a pointed-at ProfilerMarkerPayload, may be null for no payloads.
-template <>
-struct ProfileBufferEntryWriter::Serializer<
-    UniquePtr<baseprofiler::ProfilerMarkerPayload>> {
-  static Length Bytes(
-      const UniquePtr<baseprofiler::ProfilerMarkerPayload>& aPayload) {
-    return baseprofiler::ProfilerMarkerPayload::TagAndSerializationBytes(
-        aPayload.get());
-  }
-
-  static void Write(
-      ProfileBufferEntryWriter& aEW,
-      const UniquePtr<baseprofiler::ProfilerMarkerPayload>& aPayload) {
-    baseprofiler::ProfilerMarkerPayload::TagAndSerialize(aPayload.get(), aEW);
-  }
-};
-
-// Deserialize a ProfilerMarkerPayload into a UniquePtr, may be null if there
-// are no payloads.
-template <>
-struct ProfileBufferEntryReader::Deserializer<
-    UniquePtr<baseprofiler::ProfilerMarkerPayload>> {
-  static void ReadInto(
-      ProfileBufferEntryReader& aER,
-      UniquePtr<baseprofiler::ProfilerMarkerPayload>& aPayload) {
-    aPayload = Read(aER);
-  }
-
-  static UniquePtr<baseprofiler::ProfilerMarkerPayload> Read(
-      ProfileBufferEntryReader& aER) {
-    return baseprofiler::ProfilerMarkerPayload::DeserializeTagAndPayload(aER);
-  }
-};
-
-}  // namespace mozilla
-
-#endif  // BaseProfilerMarkerPayload_h
--- a/mozglue/tests/TestBaseProfiler.cpp
+++ b/mozglue/tests/TestBaseProfiler.cpp
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "BaseProfiler.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/BaseProfileJSONWriter.h"
 
 #ifdef MOZ_GECKO_PROFILER
-#  include "BaseProfilerMarkerPayload.h"
 #  include "mozilla/BaseProfilerMarkerTypes.h"
 #  include "mozilla/BlocksRingBuffer.h"
 #  include "mozilla/leb128iterator.h"
 #  include "mozilla/ModuloBuffer.h"
 #  include "mozilla/PowerOfTwo.h"
 #  include "mozilla/ProfileBufferChunk.h"
 #  include "mozilla/ProfileBufferChunkManagerSingle.h"
 #  include "mozilla/ProfileBufferChunkManagerWithLocalLimit.h"
@@ -3249,110 +3248,16 @@ void TestProfilerDependencies() {
   TestBlocksRingBufferAPI();
   TestBlocksRingBufferUnderlyingBufferChanges();
   TestBlocksRingBufferThreading();
   TestBlocksRingBufferSerialization();
   TestLiteralEmptyStringView();
   TestProfilerStringView();
 }
 
-class BaseTestMarkerPayload : public baseprofiler::ProfilerMarkerPayload {
- public:
-  explicit BaseTestMarkerPayload(int aData) : mData(aData) {}
-
-  int GetData() const { return mData; }
-
-  // Exploded DECL_BASE_STREAM_PAYLOAD, but without `MFBT_API`s.
-  static UniquePtr<ProfilerMarkerPayload> Deserialize(
-      ProfileBufferEntryReader& aEntryReader);
-  ProfileBufferEntryWriter::Length TagAndSerializationBytes() const override;
-  void SerializeTagAndPayload(
-      ProfileBufferEntryWriter& aEntryWriter) const override;
-  void StreamPayload(
-      ::mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
-      const ::mozilla::TimeStamp& aProcessStartTime,
-      ::mozilla::baseprofiler::UniqueStacks& aUniqueStacks) const override;
-
- private:
-  BaseTestMarkerPayload(CommonProps&& aProps, int aData)
-      : baseprofiler::ProfilerMarkerPayload(std::move(aProps)), mData(aData) {}
-
-  int mData;
-};
-
-// static
-UniquePtr<baseprofiler::ProfilerMarkerPayload>
-BaseTestMarkerPayload::Deserialize(ProfileBufferEntryReader& aEntryReader) {
-  CommonProps props = DeserializeCommonProps(aEntryReader);
-  int data = aEntryReader.ReadObject<int>();
-  return UniquePtr<baseprofiler::ProfilerMarkerPayload>(
-      new BaseTestMarkerPayload(std::move(props), data));
-}
-
-ProfileBufferEntryWriter::Length
-BaseTestMarkerPayload::TagAndSerializationBytes() const {
-  return CommonPropsTagAndSerializationBytes() + sizeof(int);
-}
-
-void BaseTestMarkerPayload::SerializeTagAndPayload(
-    ProfileBufferEntryWriter& aEntryWriter) const {
-  static const DeserializerTag tag = TagForDeserializer(Deserialize);
-  SerializeTagAndCommonProps(tag, aEntryWriter);
-  aEntryWriter.WriteObject(mData);
-}
-
-void BaseTestMarkerPayload::StreamPayload(
-    baseprofiler::SpliceableJSONWriter& aWriter,
-    const TimeStamp& aProcessStartTime,
-    baseprofiler::UniqueStacks& aUniqueStacks) const {
-  aWriter.IntProperty("data", mData);
-}
-
-void TestProfilerMarkerSerialization() {
-  printf("TestProfilerMarkerSerialization...\n");
-
-  constexpr uint32_t MBSize = 256;
-  uint8_t buffer[MBSize * 3];
-  for (size_t i = 0; i < MBSize * 3; ++i) {
-    buffer[i] = uint8_t('A' + i);
-  }
-  BlocksRingBuffer rb(BlocksRingBuffer::ThreadSafety::WithMutex,
-                      &buffer[MBSize], MakePowerOfTwo32<MBSize>());
-
-  constexpr int data = 42;
-  {
-    BaseTestMarkerPayload payload(data);
-    rb.PutObject(
-        static_cast<const baseprofiler::ProfilerMarkerPayload*>(&payload));
-  }
-
-  int read = 0;
-  rb.ReadEach([&](ProfileBufferEntryReader& aER) {
-    UniquePtr<baseprofiler::ProfilerMarkerPayload> payload =
-        aER.ReadObject<UniquePtr<baseprofiler::ProfilerMarkerPayload>>();
-    MOZ_RELEASE_ASSERT(!!payload);
-    ++read;
-    BaseTestMarkerPayload* testPayload =
-        static_cast<BaseTestMarkerPayload*>(payload.get());
-    MOZ_RELEASE_ASSERT(testPayload);
-    MOZ_RELEASE_ASSERT(testPayload->GetData() == data);
-  });
-  MOZ_RELEASE_ASSERT(read == 1);
-
-  // Everything around the sub-buffer should be unchanged.
-  for (size_t i = 0; i < MBSize; ++i) {
-    MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i));
-  }
-  for (size_t i = MBSize * 2; i < MBSize * 3; ++i) {
-    MOZ_RELEASE_ASSERT(buffer[i] == uint8_t('A' + i));
-  }
-
-  printf("TestProfilerMarkerSerialization done\n");
-}
-
 // Increase the depth, to a maximum (to avoid too-deep recursion).
 static constexpr size_t NextDepth(size_t aDepth) {
   constexpr size_t MAX_DEPTH = 128;
   return (aDepth < MAX_DEPTH) ? (aDepth + 1) : aDepth;
 }
 
 Atomic<bool, Relaxed> sStopFibonacci;
 
@@ -3390,18 +3295,16 @@ MOZ_NEVER_INLINE unsigned long long Fibo
 void TestProfiler() {
   printf("TestProfiler starting -- pid: %d, tid: %d\n",
          baseprofiler::profiler_current_process_id(),
          baseprofiler::profiler_current_thread_id());
   // ::SleepMilli(10000);
 
   TestProfilerDependencies();
 
-  TestProfilerMarkerSerialization();
-
   {
     printf("profiler_init()...\n");
     AUTO_BASE_PROFILER_INIT;
 
     MOZ_RELEASE_ASSERT(!baseprofiler::profiler_is_active());
     MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_being_profiled());
     MOZ_RELEASE_ASSERT(!baseprofiler::profiler_thread_is_sleeping());
 
@@ -3467,74 +3370,30 @@ void TestProfiler() {
       AUTO_BASE_PROFILER_MARKER_TEXT("main thread", OTHER, {},
                                      "joining fibonacci-canceller thread");
       sStopFibonacci = true;
       AUTO_BASE_PROFILER_THREAD_SLEEP;
       threadCancelFib.join();
     }
 
     // Just making sure all payloads know how to (de)serialize and stream.
-    baseprofiler::profiler_add_marker(
-        "TracingMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::TracingMarkerPayload("category",
-                                           baseprofiler::TRACING_EVENT));
-
-    auto cause =
-#  if defined(__linux__) || defined(__ANDROID__)
-        // Currently disabled on these platforms, so just return a null.
-        decltype(baseprofiler::profiler_get_backtrace()){};
-#  else
-        baseprofiler::profiler_get_backtrace();
-#  endif
-    baseprofiler::profiler_add_marker(
-        "FileIOMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::FileIOMarkerPayload(
-            "operation", "source", "filename", TimeStamp::NowUnfuzzed(),
-            TimeStamp::NowUnfuzzed(), std::move(cause)));
+
     baseprofiler::AddMarker("m2fileio", mozilla::baseprofiler::category::OTHER,
                             {}, mozilla::baseprofiler::markers::FileIO{}, "op2",
                             "src2", "f2", MarkerThreadId{});
     baseprofiler::AddMarker(
         "m2fileio-capture", mozilla::baseprofiler::category::OTHER,
         MarkerStack::Capture(), mozilla::baseprofiler::markers::FileIO{}, "op2",
         "src2", "f2", MarkerThreadId{});
     baseprofiler::AddMarker(
         "m2fileio-take-backtrace", mozilla::baseprofiler::category::OTHER,
         MarkerStack::TakeBacktrace(baseprofiler::profiler_capture_backtrace()),
         mozilla::baseprofiler::markers::FileIO{}, "op2", "src2", "f2",
         MarkerThreadId{});
 
-    baseprofiler::profiler_add_marker(
-        "UserTimingMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::UserTimingMarkerPayload("name", TimeStamp::NowUnfuzzed(),
-                                              Nothing{}));
-
-    baseprofiler::profiler_add_marker(
-        "HangMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::HangMarkerPayload(TimeStamp::NowUnfuzzed(),
-                                        TimeStamp::NowUnfuzzed()));
-
-    baseprofiler::profiler_add_marker(
-        "LongTaskMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::LongTaskMarkerPayload(TimeStamp::NowUnfuzzed(),
-                                            TimeStamp::NowUnfuzzed()));
-
-    {
-      std::string s = "text payload";
-      baseprofiler::profiler_add_marker(
-          "TextMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-          baseprofiler::TextMarkerPayload(s, TimeStamp::NowUnfuzzed(),
-                                          TimeStamp::NowUnfuzzed()));
-    }
-
-    baseprofiler::profiler_add_marker(
-        "LogMarkerPayload", baseprofiler::ProfilingCategoryPair::OTHER,
-        baseprofiler::LogMarkerPayload("module", "text",
-                                       TimeStamp::NowUnfuzzed()));
-
     MOZ_RELEASE_ASSERT(
         baseprofiler::AddMarker("markers 2.0 without options (omitted)",
                                 mozilla::baseprofiler::category::OTHER));
 
     MOZ_RELEASE_ASSERT(baseprofiler::AddMarker(
         "markers 2.0 without options (implicit brace-init)",
         mozilla::baseprofiler::category::OTHER, {}));