Bug 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald.
authorFlorian Quèze <florian@queze.net>
Fri, 25 Jun 2021 13:28:01 +0000
changeset 584423 cd335ae78d20fc4cca8f5379a4f1fc351eedb783
parent 584422 8f7fc2f3bb310375bb8a3c4237060e748b0be1f1
child 584424 e301f30010f4b7ce612235f52921df5ed1d408f1
push id38565
push usermlaza@mozilla.com
push dateFri, 25 Jun 2021 21:51:52 +0000
treeherdermozilla-central@b9a82200b994 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1717991
milestone91.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 1717991 - Remove ifdefs around code that adds profiler markers with custom marker schemas, r=gerald. Differential Revision: https://phabricator.services.mozilla.com/D118680
dom/events/EventDispatcher.cpp
dom/ipc/ContentChild.cpp
dom/ipc/ProcessPriorityManager.cpp
dom/media/AsyncLogger.h
dom/media/platforms/wmf/WMFDecoderModule.cpp
dom/performance/Performance.cpp
dom/script/ScriptLoadRequest.h
dom/script/ScriptLoader.cpp
gfx/layers/ProfilerScreenshots.cpp
gfx/layers/composite/ContainerLayerComposite.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/ContentCompositorBridgeParent.cpp
ipc/glue/MessageChannel.h
layout/base/PresShell.cpp
layout/base/nsRefreshDriver.cpp
layout/base/nsRefreshDriver.h
modules/libpref/Preferences.cpp
mozglue/misc/PreXULSkeletonUI.cpp
xpcom/base/CycleCollectedJSRuntime.cpp
xpcom/base/Logging.cpp
xpcom/threads/nsThread.cpp
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -1001,17 +1001,16 @@ nsresult EventDispatcher::Dispatch(nsISu
 
         clearTargets = ShouldClearTargets(aEvent);
 
         // Handle the chain.
         EventChainPostVisitor postVisitor(preVisitor);
         MOZ_RELEASE_ASSERT(!aEvent->mPath);
         aEvent->mPath = &chain;
 
-#ifdef MOZ_GECKO_PROFILER
         if (profiler_is_active()) {
           // Add a profiler label and a profiler marker for the actual
           // dispatch of the event.
           // This is a very hot code path, so we need to make sure not to
           // do this extra work when we're not profiling.
           if (!postVisitor.mDOMEvent) {
             // This is tiny bit slow, but happens only once per event.
             // Similar code also in EventListenerManager.
@@ -1074,19 +1073,17 @@ nsresult EventDispatcher::Dispatch(nsISu
 
           EventTargetChainItem::HandleEventTargetChain(chain, postVisitor,
                                                        aCallback, cd);
 
           profiler_add_marker(
               "DOMEvent", geckoprofiler::category::DOM,
               {MarkerTiming::IntervalEnd(), std::move(innerWindowId)},
               DOMEventMarker{}, typeStr, startTime, aEvent->mTimeStamp);
-        } else
-#endif
-        {
+        } else {
           EventTargetChainItem::HandleEventTargetChain(chain, postVisitor,
                                                        aCallback, cd);
         }
         aEvent->mPath = nullptr;
 
         if (aPresContext && aPresContext->GetRootPresContext() &&
             aEvent->IsTrusted()) {
           nsRefreshDriver* driver =
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -306,17 +306,16 @@ using namespace mozilla::hal_sandbox;
 using namespace mozilla::ipc;
 using namespace mozilla::intl;
 using namespace mozilla::layers;
 using namespace mozilla::layout;
 using namespace mozilla::net;
 using namespace mozilla::widget;
 using mozilla::loader::PScriptCacheChild;
 
-#ifdef MOZ_GECKO_PROFILER
 namespace geckoprofiler::markers {
 struct ProcessPriorityChange {
   static constexpr Span<const char> MarkerTypeName() {
     return MakeStringSpan("ProcessPriorityChange");
   }
   static void StreamJSONMarkerData(baseprofiler::SpliceableJSONWriter& aWriter,
                                    const ProfilerString8View& aPreviousPriority,
                                    const ProfilerString8View& aNewPriority) {
@@ -354,17 +353,16 @@ struct ProcessPriority {
     MS schema{MS::Location::markerChart, MS::Location::markerTable};
     schema.AddKeyFormat("Priority", MS::Format::string);
     schema.AddKeyFormat("Marker cause", MS::Format::string);
     schema.SetAllLabels("priority: {marker.data.Priority}");
     return schema;
   }
 };
 }  // namespace geckoprofiler::markers
-#endif  // MOZ_GECKO_PROFILER
 
 namespace mozilla {
 
 namespace dom {
 
 // IPC sender for remote GC/CC logging.
 class CycleCollectWithLogsChild final : public PCycleCollectWithLogsChild {
  public:
@@ -619,34 +617,32 @@ ContentChild::ContentChild()
       ,
       mIsForBrowser(false),
       mIsAlive(true),
       mShuttingDown(false) {
   // This process is a content process, so it's clearly running in
   // multiprocess mode!
   nsDebugImpl::SetMultiprocessMode("Child");
 
-#ifdef MOZ_GECKO_PROFILER
   // Our static analysis doesn't allow capturing ref-counted pointers in
   // lambdas, so we need to hide it in a uintptr_t. This is safe because this
   // lambda will be destroyed in ~ContentChild().
   uintptr_t self = reinterpret_cast<uintptr_t>(this);
   profiler_add_state_change_callback(
       AllProfilingStates(),
       [self](ProfilingState aProfilingState) {
         const ContentChild* selfPtr =
             reinterpret_cast<const ContentChild*>(self);
         PROFILER_MARKER("Process Priority", OTHER,
                         mozilla::MarkerThreadId::MainThread(), ProcessPriority,
                         ProfilerString8View::WrapNullTerminatedString(
                             ProcessPriorityToString(selfPtr->mProcessPriority)),
                         aProfilingState);
       },
       self);
-#endif  // MOZ_GECKO_PROFILER
 
   // When ContentChild is created, the observer service does not even exist.
   // When ContentChild::RecvSetXPCOMProcessAttributes is called (the first
   // IPDL call made on this object), shutdown may have already happened. Thus
   // we create a canary here that relies upon getting cleared if shutdown
   // happens without requiring the observer service at this time.
   if (!sShutdownCanary) {
     sShutdownCanary = new ShutdownCanary();
@@ -657,19 +653,17 @@ ContentChild::ContentChild()
 #ifdef _MSC_VER
 #  pragma warning(push)
 #  pragma warning(                                                  \
       disable : 4722) /* Silence "destructor never returns" warning \
                        */
 #endif
 
 ContentChild::~ContentChild() {
-#ifdef MOZ_GECKO_PROFILER
   profiler_remove_state_change_callback(reinterpret_cast<uintptr_t>(this));
-#endif  // MOZ_GECKO_PROFILER
 
 #ifndef NS_FREE_PERMANENT_DATA
   MOZ_CRASH("Content Child shouldn't be destroyed.");
 #endif
 }
 
 #ifdef _MSC_VER
 #  pragma warning(pop)
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -558,17 +558,16 @@ ParticularProcessPriorityManager::Partic
       mPriority(PROCESS_PRIORITY_UNKNOWN),
       mHoldsCPUWakeLock(false),
       mHoldsHighPriorityWakeLock(false),
       mHoldsPlayingAudioWakeLock(false),
       mHoldsPlayingVideoWakeLock(false) {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_RELEASE_ASSERT(!aContentParent->IsDead());
   LOGP("Creating ParticularProcessPriorityManager.");
-#ifdef MOZ_GECKO_PROFILER
   // Our static analysis doesn't allow capturing ref-counted pointers in
   // lambdas, so we need to hide it in a uintptr_t. This is safe because this
   // lambda will be destroyed in ~ParticularProcessPriorityManager().
   uintptr_t self = reinterpret_cast<uintptr_t>(this);
   profiler_add_state_change_callback(
       AllProfilingStates(),
       [self](ProfilingState aProfilingState) {
         const ParticularProcessPriorityManager* selfPtr =
@@ -576,17 +575,16 @@ ParticularProcessPriorityManager::Partic
         PROFILER_MARKER("Subprocess Priority", OTHER,
                         MarkerThreadId::MainThread(), SubProcessPriority,
                         selfPtr->Pid(),
                         ProfilerString8View::WrapNullTerminatedString(
                             ProcessPriorityToString(selfPtr->mPriority)),
                         aProfilingState);
       },
       self);
-#endif  // MOZ_GECKO_PROFILER
 }
 
 void ParticularProcessPriorityManager::Init() {
   RegisterWakeLockObserver(this);
 
   // This process may already hold the CPU lock; for example, our parent may
   // have acquired it on our behalf.
   mHoldsCPUWakeLock = IsHoldingWakeLock(u"cpu"_ns);
@@ -607,19 +605,17 @@ bool ParticularProcessPriorityManager::I
   WakeLockInformation info;
   GetWakeLockInfo(aTopic, &info);
   return info.lockingProcesses().Contains(ChildID());
 }
 
 ParticularProcessPriorityManager::~ParticularProcessPriorityManager() {
   LOGP("Destroying ParticularProcessPriorityManager.");
 
-#ifdef MOZ_GECKO_PROFILER
   profiler_remove_state_change_callback(reinterpret_cast<uintptr_t>(this));
-#endif  // MOZ_GECKO_PROFILER
 
   ShutDown();
 }
 
 /* virtual */
 void ParticularProcessPriorityManager::Notify(
     const WakeLockInformation& aInfo) {
   if (!mContentParent) {
--- a/dom/media/AsyncLogger.h
+++ b/dom/media/AsyncLogger.h
@@ -115,27 +115,25 @@ class AsyncLogger {
             "{\"name\": \"%s\", \"cat\": \"%s\", \"ph\": \"%c\","
             "\"ts\": %" PRIu64
             ", \"pid\": %d, \"tid\":"
             " %zu, \"args\": { \"comment\": \"%s\"}},",
             aName, aCategory, TRACING_PHASE_STRINGS[static_cast<int>(aPhase)],
             NowInUs(), getpid(),
             std::hash<std::thread::id>{}(std::this_thread::get_id()), aComment);
       } else {
-#ifdef MOZ_GECKO_PROFILER
         auto* msg = new MPSCQueue<TracePayload>::Message();
         msg->data.mTID = profiler_current_thread_id();
         msg->data.mPhase = aPhase;
         msg->data.mTimestamp = TimeStamp::NowUnfuzzed();
         msg->data.mDurationUs = 0;  // unused, duration is end - begin
         size_t len = std::min(strlen(aName), ArrayLength(msg->data.mName));
         memcpy(msg->data.mName, aName, len);
         msg->data.mName[len] = 0;
         mMessageQueueProfiler.Push(msg);
-#endif
       }
     }
   }
 
   // Log something that has a beginning and a duration
   void LogDuration(const char* aName, const char* aCategory, uint64_t aDuration,
                    uint64_t aFrames, uint64_t aSampleRate) {
     if (Enabled()) {
@@ -145,62 +143,56 @@ class AsyncLogger {
             "\"ts\": %" PRIu64 ", \"dur\": %" PRIu64
             ", \"pid\": %d,"
             "\"tid\": %zu, \"args\": { \"comment\": \"%" PRIu64 "/%" PRIu64
             "\"}},",
             aName, aCategory, NowInUs(), aDuration, getpid(),
             std::hash<std::thread::id>{}(std::this_thread::get_id()), aFrames,
             aSampleRate);
       } else {
-#ifdef MOZ_GECKO_PROFILER
         auto* msg = new MPSCQueue<TracePayload>::Message();
         msg->data.mTID = profiler_current_thread_id();
         msg->data.mPhase = TracingPhase::COMPLETE;
         msg->data.mTimestamp = TimeStamp::NowUnfuzzed();
         msg->data.mDurationUs =
             (static_cast<double>(aFrames) / aSampleRate) * 1e6;
         size_t len = std::min(strlen(aName), ArrayLength(msg->data.mName));
         memcpy(msg->data.mName, aName, len);
         msg->data.mName[len] = 0;
         mMessageQueueProfiler.Push(msg);
-#endif
       }
     }
   }
   void LogMozLog(const char* format, ...) MOZ_FORMAT_PRINTF(2, 3) {
     auto* msg = new MPSCQueue<TextPayload>::Message();
     va_list args;
     va_start(args, format);
     VsprintfLiteral(msg->data.mPayload, format, args);
     va_end(args);
     mMessageQueueLog.Push(msg);
   }
 
   bool Enabled() {
     return (mMode == AsyncLoggerOutputMode::MOZLOG &&
-            MOZ_LOG_TEST(mLogModule, mozilla::LogLevel::Verbose))
-#ifdef MOZ_GECKO_PROFILER
-           || (mMode == AsyncLoggerOutputMode::PROFILER && profiler_is_active())
-#endif
-        ;
+            MOZ_LOG_TEST(mLogModule, mozilla::LogLevel::Verbose)) ||
+           (mMode == AsyncLoggerOutputMode::PROFILER && profiler_is_active());
   }
 
  private:
   void Run() {
     mThread.reset(new std::thread([this]() {
       PROFILER_REGISTER_THREAD("AsyncLogger");
       while (mRunning) {
         {
           TextPayload message;
           while (mMessageQueueLog.Pop(&message) && mRunning) {
             MOZ_LOG(mLogModule, mozilla::LogLevel::Verbose,
                     ("%s", message.mPayload));
           }
         }
-#ifdef MOZ_GECKO_PROFILER
         {
           struct BudgetMarker {
             static constexpr Span<const char> MarkerTypeName() {
               return MakeStringSpan("Budget");
             }
             static void StreamJSONMarkerData(
                 baseprofiler::SpliceableJSONWriter& aWriter) {}
             static MarkerSchema MarkerTypeDisplay() {
@@ -230,17 +222,16 @@ class AsyncLogger {
                    MarkerTiming::Interval(
                        message.mTimestamp,
                        message.mTimestamp + TimeDuration::FromMicroseconds(
                                                 message.mDurationUs))},
                   BudgetMarker{});
             }
           }
         }
-#endif
         Sleep();
       }
       PROFILER_UNREGISTER_THREAD();
     }));
     // cleanup is done via mRunning
     mThread->detach();
   }
 
@@ -249,19 +240,17 @@ class AsyncLogger {
     return (TimeStamp::NowUnfuzzed() - base).ToMicroseconds();
   }
 
   void Sleep() { std::this_thread::sleep_for(std::chrono::milliseconds(10)); }
 
   std::unique_ptr<std::thread> mThread;
   mozilla::LazyLogModule mLogModule;
   MPSCQueue<TextPayload> mMessageQueueLog;
-#ifdef MOZ_GECKO_PROFILER
   MPSCQueue<TracePayload> mMessageQueueProfiler;
-#endif
   std::atomic<bool> mRunning;
   std::atomic<AsyncLoggerOutputMode> mMode;
 };
 
 }  // end namespace mozilla
 
 #if defined(_WIN32)
 #  undef getpid
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -37,26 +37,19 @@
 
 #define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
 
 extern const GUID CLSID_WebmMfVpxDec;
 
 namespace mozilla {
 
 // Helper function to add a profile marker and log at the same time.
-static void MOZ_FORMAT_PRINTF(2, 3) WmfDecoderModuleMarkerAndLog(
-#ifdef MOZ_GECKO_PROFILER
-    const ProfilerString8View&
-#else
-    // ProfilerString8View is not defined in non-MOZ_GECKO_PROFILER builds, but
-    // we still need to accept the given marker tag, though it won't be used.
-    const char*
-#endif
-        aMarkerTag,
-    const char* aFormat, ...) {
+static void MOZ_FORMAT_PRINTF(2, 3)
+    WmfDecoderModuleMarkerAndLog(const ProfilerString8View& aMarkerTag,
+                                 const char* aFormat, ...) {
   va_list ap;
   va_start(ap, aFormat);
   const nsVprintfCString markerString(aFormat, ap);
   va_end(ap);
   PROFILER_MARKER_TEXT(aMarkerTag, MEDIA_PLAYBACK, {}, markerString);
   LOG("%s", markerString.get());
 }
 
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -219,17 +219,16 @@ void Performance::ClearUserEntries(const
   mUserEntries.RemoveElementsBy([name, entryType](const auto& entry) {
     return (!name || entry->GetName() == name) &&
            (entry->GetEntryType() == entryType);
   });
 }
 
 void Performance::ClearResourceTimings() { mResourceEntries.Clear(); }
 
-#ifdef MOZ_GECKO_PROFILER
 struct UserTimingMarker {
   static constexpr Span<const char> MarkerTypeName() {
     return MakeStringSpan("UserTiming");
   }
   static void StreamJSONMarkerData(
       baseprofiler::SpliceableJSONWriter& aWriter,
       const ProfilerString16View& aName, bool aIsMeasure,
       const Maybe<ProfilerString16View>& aStartMark,
@@ -264,44 +263,41 @@ struct UserTimingMarker {
     schema.AddKeyLabelFormat("startMark", "Start Mark", MS::Format::string);
     schema.AddKeyLabelFormat("endMark", "End Mark", MS::Format::string);
     schema.AddStaticLabelValue("Description",
                                "UserTimingMeasure is created using the DOM API "
                                "performance.measure().");
     return schema;
   }
 };
-#endif
 
 void Performance::Mark(const nsAString& aName, ErrorResult& aRv) {
   // We add nothing when 'privacy.resistFingerprinting' is on.
   if (nsContentUtils::ShouldResistFingerprinting()) {
     return;
   }
 
   if (IsPerformanceTimingAttribute(aName)) {
     aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
     return;
   }
 
   RefPtr<PerformanceMark> performanceMark =
       new PerformanceMark(GetParentObject(), aName, Now());
   InsertUserEntry(performanceMark);
 
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_can_accept_markers()) {
     Maybe<uint64_t> innerWindowId;
     if (GetOwner()) {
       innerWindowId = Some(GetOwner()->WindowID());
     }
     profiler_add_marker("UserTiming", geckoprofiler::category::DOM,
                         MarkerInnerWindowId(innerWindowId), UserTimingMarker{},
                         aName, /* aIsMeasure */ false, Nothing{}, Nothing{});
   }
-#endif
 }
 
 void Performance::ClearMarks(const Optional<nsAString>& aName) {
   ClearUserEntries(aName, u"mark"_ns);
 }
 
 DOMHighResTimeStamp Performance::ResolveTimestampFromName(
     const nsAString& aName, ErrorResult& aRv) {
@@ -361,17 +357,16 @@ void Performance::Measure(const nsAStrin
   } else {
     endTime = Now();
   }
 
   RefPtr<PerformanceMeasure> performanceMeasure =
       new PerformanceMeasure(GetParentObject(), aName, startTime, endTime);
   InsertUserEntry(performanceMeasure);
 
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_can_accept_markers()) {
     TimeStamp startTimeStamp =
         CreationTimeStamp() + TimeDuration::FromMilliseconds(startTime);
     TimeStamp endTimeStamp =
         CreationTimeStamp() + TimeDuration::FromMilliseconds(endTime);
 
     // Convert to Maybe values so that Optional types do not need to be used in
     // the profiler.
@@ -389,17 +384,16 @@ void Performance::Measure(const nsAStrin
       innerWindowId = Some(GetOwner()->WindowID());
     }
     profiler_add_marker("UserTiming", geckoprofiler::category::DOM,
                         {MarkerTiming::Interval(startTimeStamp, endTimeStamp),
                          MarkerInnerWindowId(innerWindowId)},
                         UserTimingMarker{}, aName, /* aIsMeasure */ true,
                         startMark, endMark);
   }
-#endif
 }
 
 void Performance::ClearMeasures(const Optional<nsAString>& aName) {
   ClearUserEntries(aName, u"measure"_ns);
 }
 
 void Performance::LogEntry(PerformanceEntry* aEntry,
                            const nsACString& aOwner) const {
--- a/dom/script/ScriptLoadRequest.h
+++ b/dom/script/ScriptLoadRequest.h
@@ -96,20 +96,18 @@ class ScriptLoadRequest
   // PreloaderBase
   static void PrioritizeAsPreload(nsIChannel* aChannel);
   virtual void PrioritizeAsPreload() override;
 
   bool IsModuleRequest() const { return mKind == ScriptKind::eModule; }
 
   ModuleLoadRequest* AsModuleRequest();
 
-#ifdef MOZ_GECKO_PROFILER
   TimeStamp mOffThreadParseStartTime;
   TimeStamp mOffThreadParseStopTime;
-#endif
 
   void FireScriptAvailable(nsresult aResult) {
     bool isInlineClassicScript = mIsInline && !IsModuleRequest();
     GetScriptElement()->ScriptAvailable(aResult, GetScriptElement(),
                                         isInlineClassicScript, mURI, mLineNo);
   }
   void FireScriptEvaluated(nsresult aResult) {
     GetScriptElement()->ScriptEvaluated(aResult, GetScriptElement(), mIsInline);
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -2411,17 +2411,16 @@ NotifyOffThreadScriptLoadCompletedRunnab
     NS_ReleaseOnMainThread(
         "NotifyOffThreadScriptLoadCompletedRunnable::mLoader",
         mLoader.forget());
   }
 }
 
 static void GetProfilerLabelForRequest(ScriptLoadRequest* aRequest,
                                        nsACString& aOutString) {
-#ifdef MOZ_GECKO_PROFILER
   if (!profiler_is_active()) {
     aOutString.Append("<script> element");
     return;
   }
   aOutString.Append("<script");
   if (aRequest->IsAsyncScript()) {
     aOutString.Append(" async");
   } else if (aRequest->IsDeferredScript()) {
@@ -2447,33 +2446,29 @@ static void GetProfilerLabelForRequest(S
       aOutString.Append("> inline (dynamically created) in ");
     }
     aOutString.Append(url);
   } else {
     aOutString.Append(" src=\"");
     aOutString.Append(url);
     aOutString.Append("\">");
   }
-#else
-  aOutString.Append("<script> element");
-#endif
 }
 
 NS_IMETHODIMP
 NotifyOffThreadScriptLoadCompletedRunnable::Run() {
   MOZ_ASSERT(NS_IsMainThread());
 
   // We want these to be dropped on the main thread, once we return from this
   // function.
   RefPtr<ScriptLoadRequest> request = std::move(mRequest);
 
   // Runnable pointer should have been cleared in the offthread callback.
   MOZ_ASSERT(!request->mRunnable);
 
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_is_active()) {
     ProfilerString8View scriptSourceString;
     if (request->IsTextSource()) {
       scriptSourceString = "ScriptCompileOffThread";
     } else {
       MOZ_ASSERT(request->IsBytecode());
       scriptSourceString = "BytecodeDecodeOffThread";
     }
@@ -2481,17 +2476,16 @@ NotifyOffThreadScriptLoadCompletedRunnab
     nsAutoCString profilerLabelString;
     GetProfilerLabelForRequest(request, profilerLabelString);
     PROFILER_MARKER_TEXT(
         scriptSourceString, JS,
         MarkerTiming::Interval(request->mOffThreadParseStartTime,
                                request->mOffThreadParseStopTime),
         profilerLabelString);
   }
-#endif
 
   RefPtr<ScriptLoader> loader = std::move(mLoader);
 
   // Request was already cancelled at some earlier point.
   if (!request->mOffThreadToken) {
     return NS_OK;
   }
 
@@ -2499,20 +2493,18 @@ NotifyOffThreadScriptLoadCompletedRunnab
 }
 
 static void OffThreadScriptLoaderCallback(JS::OffThreadToken* aToken,
                                           void* aCallbackData) {
   RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> aRunnable = dont_AddRef(
       static_cast<NotifyOffThreadScriptLoadCompletedRunnable*>(aCallbackData));
   MOZ_ASSERT(aRunnable.get() == aRunnable->GetScriptLoadRequest()->mRunnable);
 
-#ifdef MOZ_GECKO_PROFILER
   aRunnable->GetScriptLoadRequest()->mOffThreadParseStopTime =
       TimeStamp::NowUnfuzzed();
-#endif
 
   LogRunnable::Run run(aRunnable);
 
   aRunnable->SetToken(aToken);
 
   // If mRunnable was cleared then request was canceled so do nothing.
   if (!aRunnable->GetScriptLoadRequest()->mRunnable.exchange(nullptr)) {
     return;
@@ -2578,19 +2570,17 @@ nsresult ScriptLoader::AttemptAsyncScrip
 
   RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> runnable =
       new NotifyOffThreadScriptLoadCompletedRunnable(aRequest, this);
 
   // Emulate dispatch.  CompileOffThreadModule will call
   // OffThreadScriptLoaderCallback were we will emulate run.
   LogRunnable::LogDispatch(runnable);
 
-#ifdef MOZ_GECKO_PROFILER
   aRequest->mOffThreadParseStartTime = TimeStamp::NowUnfuzzed();
-#endif
 
   // Save the runnable so it can be properly cleared during cancellation.
   aRequest->mRunnable = runnable.get();
   auto signalOOM =
       mozilla::MakeScopeExit([&aRequest]() { aRequest->mRunnable = nullptr; });
 
   if (aRequest->IsModuleRequest()) {
     MOZ_ASSERT(aRequest->IsTextSource());
@@ -3130,20 +3120,18 @@ nsresult ScriptLoader::EvaluateScript(Sc
     context = scriptGlobal->GetScriptContext();
     if (!context) {
       return NS_ERROR_FAILURE;
     }
 
     globalObject = scriptGlobal;
   }
 
-#ifdef MOZ_GECKO_PROFILER
   nsCOMPtr<nsPIDOMWindowOuter> window = mDocument->GetWindow();
   nsIDocShell* docShell = window ? window->GetDocShell() : nullptr;
-#endif
   nsAutoCString profilerLabelString;
   GetProfilerLabelForRequest(aRequest, profilerLabelString);
 
   // Update our current script
   // This must be destroyed after destroying nsAutoMicroTask, see:
   // https://bugzilla.mozilla.org/show_bug.cgi?id=1620505#c4
   nsIScriptElement* currentScript =
       aRequest->IsModuleRequest() ? nullptr : aRequest->GetScriptElement();
--- a/gfx/layers/ProfilerScreenshots.cpp
+++ b/gfx/layers/ProfilerScreenshots.cpp
@@ -25,17 +25,16 @@ ProfilerScreenshots::~ProfilerScreenshot
 bool ProfilerScreenshots::IsEnabled() {
   return profiler_feature_active(ProfilerFeature::Screenshots);
 }
 
 void ProfilerScreenshots::SubmitScreenshot(
     uintptr_t aWindowIdentifier, const gfx::IntSize& aOriginalSize,
     const IntSize& aScaledSize, const TimeStamp& aTimeStamp,
     const std::function<bool(DataSourceSurface*)>& aPopulateSurface) {
-#ifdef MOZ_GECKO_PROFILER
   RefPtr<DataSourceSurface> backingSurface = TakeNextSurface();
   if (!backingSurface) {
     return;
   }
 
   MOZ_RELEASE_ASSERT(aScaledSize <= backingSurface->GetSize());
 
   bool succeeded = aPopulateSurface(backingSurface);
@@ -104,17 +103,16 @@ void ProfilerScreenshots::SubmitScreensh
                  MarkerTiming::InstantAt(timeStamp)},
                 ScreenshotMarker{}, dataURL, originalSize, windowIdentifier);
           }
         }
 
         // Return backingSurface back to the surface pool.
         self->ReturnSurface(backingSurface);
       }));
-#endif
 }
 
 already_AddRefed<DataSourceSurface> ProfilerScreenshots::TakeNextSurface() {
   MutexAutoLock mon(mMutex);
   if (!mAvailableSurfaces.IsEmpty()) {
     RefPtr<DataSourceSurface> surf = mAvailableSurfaces[0];
     mAvailableSurfaces.RemoveElementAt(0);
     return surf.forget();
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -79,17 +79,16 @@ static void DrawLayerInfo(const RenderTa
 
   IntPoint topLeft = visibleRegion.GetBounds().ToUnknownRect().TopLeft();
   aManager->GetTextRenderer()->RenderText(
       aManager->GetCompositor(), ss.str().c_str(), topLeft,
       aLayer->GetEffectiveTransform(), 16, maxWidth);
 }
 
 static void PrintUniformityInfo(Layer* aLayer) {
-#if defined(MOZ_GECKO_PROFILER)
   if (!profiler_thread_is_being_profiled()) {
     return;
   }
 
   // Don't want to print a log for smaller layers
   if (aLayer->GetLocalVisibleRegion().GetBounds().Width() < 300 ||
       aLayer->GetLocalVisibleRegion().GetBounds().Height() < 300) {
     return;
@@ -127,17 +126,16 @@ static void PrintUniformityInfo(Layer* a
       schema.AddKeyLabelFormat("y", "Y", MS::Format::integer);
       return schema;
     }
   };
 
   profiler_add_marker("LayerTranslation", geckoprofiler::category::GRAPHICS, {},
                       LayerTranslationMarker{},
                       WrapProfileBufferRawPointer(aLayer), translation);
-#endif
 }
 
 static Maybe<gfx::Polygon> SelectLayerGeometry(
     const Maybe<gfx::Polygon>& aParentGeometry,
     const Maybe<gfx::Polygon>& aChildGeometry) {
   // Both the parent and the child layer were split.
   if (aParentGeometry && aChildGeometry) {
     return Some(aParentGeometry->ClipPolygon(*aChildGeometry));
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -2094,17 +2094,16 @@ already_AddRefed<IAPZCTreeManager> Compo
   }
   LayerTreeState* lts = &cit->second;
 
   RefPtr<IAPZCTreeManager> apzctm =
       lts->mParent ? lts->mParent->mApzcTreeManager.get() : nullptr;
   return apzctm.forget();
 }
 
-#if defined(MOZ_GECKO_PROFILER)
 static void InsertVsyncProfilerMarker(TimeStamp aVsyncTimestamp) {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
   if (profiler_thread_is_being_profiled()) {
     // Tracks when a vsync occurs according to the HardwareComposer.
     struct VsyncMarker {
       static constexpr mozilla::Span<const char> MarkerTypeName() {
         return mozilla::MakeStringSpan("VsyncTimestamp");
       }
@@ -2117,29 +2116,26 @@ static void InsertVsyncProfilerMarker(Ti
         return schema;
       }
     };
     profiler_add_marker("VsyncTimestamp", geckoprofiler::category::GRAPHICS,
                         MarkerTiming::InstantAt(aVsyncTimestamp),
                         VsyncMarker{});
   }
 }
-#endif
 
 /*static */
 void CompositorBridgeParent::PostInsertVsyncProfilerMarker(
     TimeStamp aVsyncTimestamp) {
-#if defined(MOZ_GECKO_PROFILER)
   // Called in the vsync thread
   if (profiler_is_active() && CompositorThreadHolder::IsActive()) {
     CompositorThread()->Dispatch(
         NewRunnableFunction("InsertVsyncProfilerMarkerRunnable",
                             InsertVsyncProfilerMarker, aVsyncTimestamp));
   }
-#endif
 }
 
 widget::PCompositorWidgetParent*
 CompositorBridgeParent::AllocPCompositorWidgetParent(
     const CompositorWidgetInitData& aInitData) {
 #if defined(MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING)
   if (mWidget) {
     // Should not create two widgets on the same compositor.
@@ -2528,17 +2524,16 @@ int32_t RecordContentFrameTime(
     const TimeStamp& aTxnStart, const VsyncId& aCompositeId,
     const TimeStamp& aCompositeEnd, const TimeDuration& aFullPaintTime,
     const TimeDuration& aVsyncRate, bool aContainsSVGGroup,
     bool aRecordUploadStats, wr::RendererStats* aStats /* = nullptr */) {
   double latencyMs = (aCompositeEnd - aTxnStart).ToMilliseconds();
   double latencyNorm = latencyMs / aVsyncRate.ToMilliseconds();
   int32_t fracLatencyNorm = lround(latencyNorm * 100.0);
 
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_can_accept_markers()) {
     struct ContentFrameMarker {
       static constexpr Span<const char> MarkerTypeName() {
         return MakeStringSpan("CONTENT_FRAME_TIME");
       }
       static void StreamJSONMarkerData(
           baseprofiler::SpliceableJSONWriter& aWriter) {}
       static MarkerSchema MarkerTypeDisplay() {
@@ -2548,17 +2543,16 @@ int32_t RecordContentFrameTime(
         return schema;
       }
     };
 
     profiler_add_marker("CONTENT_FRAME_TIME", geckoprofiler::category::GRAPHICS,
                         MarkerTiming::Interval(aTxnStart, aCompositeEnd),
                         ContentFrameMarker{});
   }
-#endif
 
   Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME, fracLatencyNorm);
 
   if (!(aTxnId == VsyncId()) && aVsyncStart) {
     latencyMs = (aCompositeEnd - aVsyncStart).ToMilliseconds();
     latencyNorm = latencyMs / aVsyncRate.ToMilliseconds();
     fracLatencyNorm = lround(latencyNorm * 100.0);
     int32_t result = fracLatencyNorm;
--- a/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/ContentCompositorBridgeParent.cpp
@@ -33,20 +33,18 @@
 #include "mozilla/mozalloc.h"  // for operator new, etc
 #include "nsDebug.h"           // for NS_ASSERTION, etc
 #include "nsTArray.h"          // for nsTArray
 #include "nsXULAppAPI.h"       // for XRE_GetIOMessageLoop
 #include "mozilla/Unused.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Telemetry.h"
-#ifdef MOZ_GECKO_PROFILER
-#  include "mozilla/BaseProfilerMarkerTypes.h"
-#  include "GeckoProfiler.h"
-#endif
+#include "mozilla/BaseProfilerMarkerTypes.h"
+#include "GeckoProfiler.h"
 
 namespace mozilla {
 
 namespace layers {
 
 // defined in CompositorBridgeParent.cpp
 typedef std::map<LayersId, CompositorBridgeParent::LayerTreeState> LayerTreeMap;
 extern LayerTreeMap sIndirectLayerTrees;
@@ -364,24 +362,22 @@ void ContentCompositorBridgeParent::Shad
   if (aLayerTree->ShouldParentObserveEpoch()) {
     // Note that we send this through the window compositor, since this needs
     // to reach the widget owning the tab.
     Unused << state->mParent->SendObserveLayersUpdate(
         id, aLayerTree->GetChildEpoch(), true);
   }
 
   auto endTime = TimeStamp::Now();
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_can_accept_markers()) {
     profiler_add_marker(
         "CONTENT_FULL_PAINT_TIME", geckoprofiler::category::GRAPHICS,
         MarkerTiming::Interval(aInfo.transactionStart(), endTime),
         baseprofiler::markers::ContentBuildMarker{});
   }
-#endif
   Telemetry::Accumulate(
       Telemetry::CONTENT_FULL_PAINT_TIME,
       static_cast<uint32_t>(
           (endTime - aInfo.transactionStart()).ToMilliseconds()));
 
   RegisterPayloads(aLayerTree, aInfo.payload());
 
   aLayerTree->SetPendingTransactionId(
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -5,36 +5,33 @@
  * 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 ipc_glue_MessageChannel_h
 #define ipc_glue_MessageChannel_h 1
 
 #include "ipc/EnumSerializer.h"
 #include "mozilla/Atomics.h"
+#include "mozilla/BaseProfilerMarkers.h"
 #include "mozilla/LinkedList.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/Vector.h"
 #if defined(OS_WIN)
 #  include "mozilla/ipc/Neutering.h"
 #endif  // defined(OS_WIN)
 
 #include <functional>
 #include <map>
 #include <stack>
 #include <vector>
 
 #include "MessageLink.h"  // for HasResultCodes
 #include "mozilla/ipc/Transport.h"
 #include "mozilla/ipc/ScopedPort.h"
 
-#ifdef MOZ_GECKO_PROFILER
-#  include "mozilla/BaseProfilerMarkers.h"
-#endif
-
 class MessageLoop;
 
 namespace IPC {
 template <typename T>
 struct ParamTraits;
 }
 
 namespace mozilla {
@@ -865,17 +862,16 @@ namespace IPC {
 template <>
 struct ParamTraits<mozilla::ipc::ResponseRejectReason>
     : public ContiguousEnumSerializer<
           mozilla::ipc::ResponseRejectReason,
           mozilla::ipc::ResponseRejectReason::SendError,
           mozilla::ipc::ResponseRejectReason::EndGuard_> {};
 }  // namespace IPC
 
-#ifdef MOZ_GECKO_PROFILER
 namespace geckoprofiler::markers {
 
 struct IPCMarker {
   static constexpr mozilla::Span<const char> MarkerTypeName() {
     return mozilla::MakeStringSpan("IPC");
   }
   static void StreamJSONMarkerData(
       mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
@@ -933,11 +929,10 @@ struct IPCMarker {
       default:
         MOZ_ASSERT_UNREACHABLE("Invalid IPC phase");
         return mozilla::MakeStringSpan("<invalid IPC phase>");
     }
   }
 };
 
 }  // namespace geckoprofiler::markers
-#endif
 
 #endif  // ifndef ipc_glue_MessageChannel_h
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -102,19 +102,17 @@
 #include "nsLayoutUtils.h"
 #include "nsViewportInfo.h"
 #include "nsCSSRendering.h"
 // for |#ifdef DEBUG| code
 #include "prenv.h"
 #include "nsDisplayList.h"
 #include "nsRegion.h"
 #include "nsAutoLayoutPhase.h"
-#ifdef MOZ_GECKO_PROFILER
-#  include "AutoProfilerStyleMarker.h"
-#endif
+#include "AutoProfilerStyleMarker.h"
 #ifdef MOZ_REFLOW_PERF
 #  include "nsFontMetrics.h"
 #endif
 #include "MobileViewportManager.h"
 #include "OverflowChangedTracker.h"
 #include "PositionedEventTargeting.h"
 
 #include "nsIReflowCallback.h"
@@ -4168,47 +4166,43 @@ void PresShell::DoFlushPendingNotificati
       if (aFlush.mFlushAnimations && mPresContext->EffectCompositor()) {
         mPresContext->EffectCompositor()->PostRestyleForThrottledAnimations();
       }
     }
 
     // The FlushResampleRequests() above flushed style changes.
     if (MOZ_LIKELY(!mIsDestroying)) {
       nsAutoScriptBlocker scriptBlocker;
-#ifdef MOZ_GECKO_PROFILER
       Maybe<uint64_t> innerWindowID;
       if (auto* window = mDocument->GetInnerWindow()) {
         innerWindowID = Some(window->WindowID());
       }
       AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
                                                 innerWindowID);
-#endif
       PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> autoRecording;
       LAYOUT_TELEMETRY_RECORD_BASE(Restyle);
 
       mPresContext->RestyleManager()->ProcessPendingRestyles();
     }
 
     // Now those constructors or events might have posted restyle
     // events.  At the same time, we still need up-to-date style data.
     // In particular, reflow depends on style being completely up to
     // date.  If it's not, then style reparenting, which can
     // happen during reflow, might suddenly pick up the new rules and
     // we'll end up with frames whose style doesn't match the frame
     // type.
     if (MOZ_LIKELY(!mIsDestroying)) {
       nsAutoScriptBlocker scriptBlocker;
-#ifdef MOZ_GECKO_PROFILER
       Maybe<uint64_t> innerWindowID;
       if (auto* window = mDocument->GetInnerWindow()) {
         innerWindowID = Some(window->WindowID());
       }
       AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
                                                 innerWindowID);
-#endif
       PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> autoRecording;
       LAYOUT_TELEMETRY_RECORD_BASE(Restyle);
 
       mPresContext->RestyleManager()->ProcessPendingRestyles();
       // Clear mNeedStyleFlush here agagin to make this flag work properly for
       // optimization since the flag might have set in ProcessPendingRestyles().
       mNeedStyleFlush = false;
     }
@@ -9461,26 +9455,24 @@ bool PresShell::DoReflow(nsIFrame* targe
   RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
   bool isTimelineRecording = timelines && timelines->HasConsumer(docShell);
 
   if (isTimelineRecording) {
     timelines->AddMarkerForDocShell(docShell, "Reflow",
                                     MarkerTracingType::START);
   }
 
-#ifdef MOZ_GECKO_PROFILER
   Maybe<uint64_t> innerWindowID;
   if (auto* window = mDocument->GetInnerWindow()) {
     innerWindowID = Some(window->WindowID());
   }
   AutoProfilerTracing tracingLayoutFlush(
       "Paint", "Reflow", geckoprofiler::category::LAYOUT,
       std::move(mReflowCause), innerWindowID);
   mReflowCause = nullptr;
-#endif
 
   FlushPendingScrollAnchorSelections();
 
   if (mReflowContinueTimer) {
     mReflowContinueTimer->Cancel();
     mReflowContinueTimer = nullptr;
   }
 
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -1209,21 +1209,19 @@ TimeStamp nsRefreshDriver::MostRecentRef
 }
 
 void nsRefreshDriver::AddRefreshObserver(nsARefreshObserver* aObserver,
                                          FlushType aFlushType,
                                          const char* aObserverDescription) {
   ObserverArray& array = ArrayFor(aFlushType);
   array.AppendElement(ObserverData{
       aObserver, aObserverDescription, TimeStamp::Now(),
-#ifdef MOZ_GECKO_PROFILER
       mPresContext
           ? MarkerInnerWindowIdFromDocShell(mPresContext->GetDocShell())
           : MarkerInnerWindowId::NoId(),
-#endif
       profiler_capture_backtrace(), aFlushType});
   EnsureTimerStarted();
 }
 
 bool nsRefreshDriver::RemoveRefreshObserver(nsARefreshObserver* aObserver,
                                             FlushType aFlushType) {
   ObserverArray& array = ArrayFor(aFlushType);
   auto index = array.IndexOf(aObserver);
--- a/layout/base/nsRefreshDriver.h
+++ b/layout/base/nsRefreshDriver.h
@@ -434,19 +434,17 @@ class nsRefreshDriver final : public moz
     RequestTable mEntries;
   };
   typedef nsClassHashtable<nsUint32HashKey, ImageStartData> ImageStartTable;
 
   struct ObserverData {
     nsARefreshObserver* mObserver;
     const char* mDescription;
     mozilla::TimeStamp mRegisterTime;
-#ifdef MOZ_GECKO_PROFILER
     mozilla::MarkerInnerWindowId mInnerWindowId;
-#endif
     mozilla::UniquePtr<mozilla::ProfileChunkedBuffer> mCause;
     mozilla::FlushType mFlushType;
 
     bool operator==(nsARefreshObserver* aObserver) const {
       return mObserver == aObserver;
     }
     operator RefPtr<nsARefreshObserver>() { return mObserver; }
   };
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -4355,39 +4355,36 @@ static nsresult pref_ReadDefaultPrefs(co
     if (NS_FAILED(rv)) {
       NS_WARNING("Error parsing preferences.");
     }
   }
 
   return NS_OK;
 }
 
-#ifdef MOZ_GECKO_PROFILER
 static nsCString PrefValueToString(const bool* b) {
   return nsCString(*b ? "true" : "false");
 }
 static nsCString PrefValueToString(const int* i) {
   return nsPrintfCString("%d", *i);
 }
 static nsCString PrefValueToString(const uint32_t* u) {
   return nsPrintfCString("%d", *u);
 }
 static nsCString PrefValueToString(const float* f) {
   return nsPrintfCString("%f", *f);
 }
 static nsCString PrefValueToString(const nsACString& s) { return nsCString(s); }
-#endif
 
 // These preference getter wrappers allow us to look up the value for static
 // preferences based on their native types, rather than manually mapping them to
 // the appropriate Preferences::Get* functions.
 // We define these methods in a struct which is made friend of Preferences in
 // order to access private members.
 struct Internals {
-#ifdef MOZ_GECKO_PROFILER
   struct PreferenceReadMarker {
     static constexpr Span<const char> MarkerTypeName() {
       return MakeStringSpan("PreferenceRead");
     }
     static void StreamJSONMarkerData(
         baseprofiler::SpliceableJSONWriter& aWriter,
         const ProfilerString8View& aPrefName,
         const Maybe<PrefValueKind>& aPrefKind, PrefType aPrefType,
@@ -4428,58 +4425,53 @@ struct Internals {
         case PrefType::String:
           return "String";
         default:
           MOZ_ASSERT_UNREACHABLE("Unknown preference type.");
           return "Unknown";
       }
     }
   };
-#endif  // MOZ_GECKO_PROFILER
 
   template <typename T>
   static nsresult GetPrefValue(const char* aPrefName, T&& aResult,
                                PrefValueKind aKind) {
     nsresult rv = NS_ERROR_UNEXPECTED;
     NS_ENSURE_TRUE(Preferences::InitStaticMembers(), NS_ERROR_NOT_AVAILABLE);
 
     if (Maybe<PrefWrapper> pref = pref_Lookup(aPrefName)) {
       rv = pref->GetValue(aKind, std::forward<T>(aResult));
 
-#ifdef MOZ_GECKO_PROFILER
       if (profiler_feature_active(ProfilerFeature::PreferenceReads)) {
         profiler_add_marker(
             "PreferenceRead", baseprofiler::category::OTHER_PreferenceRead, {},
             PreferenceReadMarker{},
             ProfilerString8View::WrapNullTerminatedString(aPrefName),
             Some(aKind), pref->Type(), PrefValueToString(aResult));
       }
-#endif
     }
 
     return rv;
   }
 
   template <typename T>
   static nsresult GetSharedPrefValue(const char* aName, T* aResult) {
     nsresult rv = NS_ERROR_UNEXPECTED;
 
     if (Maybe<PrefWrapper> pref = pref_SharedLookup(aName)) {
       rv = pref->GetValue(PrefValueKind::User, aResult);
 
-#ifdef MOZ_GECKO_PROFILER
       if (profiler_feature_active(ProfilerFeature::PreferenceReads)) {
         profiler_add_marker(
             "PreferenceRead", baseprofiler::category::OTHER_PreferenceRead, {},
             PreferenceReadMarker{},
             ProfilerString8View::WrapNullTerminatedString(aName),
             Nothing() /* indicates Shared */, pref->Type(),
             PrefValueToString(aResult));
       }
-#endif
     }
 
     return rv;
   }
 
   template <typename T>
   static T GetPref(const char* aPrefName, T aFallback,
                    PrefValueKind aKind = PrefValueKind::User) {
--- a/mozglue/misc/PreXULSkeletonUI.cpp
+++ b/mozglue/misc/PreXULSkeletonUI.cpp
@@ -1836,19 +1836,17 @@ static Result<Ok, PreXULSkeletonUIError>
 
 static Result<Ok, PreXULSkeletonUIError> WriteRegBool(
     HKEY regKey, const std::wstring& valueName, bool value) {
   return WriteRegUint(regKey, valueName, value ? 1 : 0);
 }
 
 static Result<Ok, PreXULSkeletonUIError> CreateAndStorePreXULSkeletonUIImpl(
     HINSTANCE hInstance, int argc, char** argv) {
-#ifdef MOZ_GECKO_PROFILER
   const TimeStamp skeletonStart = TimeStamp::NowUnfuzzed();
-#endif
 
   if (!IsWin10OrLater()) {
     return Err(PreXULSkeletonUIError::Ineligible);
   }
 
   HKEY regKey;
   MOZ_TRY_VAR(regKey, OpenPreXULSkeletonUIRegKey());
   AutoCloseRegKey closeKey(regKey);
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -995,17 +995,16 @@ void CycleCollectedJSRuntime::GCCallback
 
 /* static */
 void CycleCollectedJSRuntime::GCSliceCallback(JSContext* aContext,
                                               JS::GCProgress aProgress,
                                               const JS::GCDescription& aDesc) {
   CycleCollectedJSRuntime* self = CycleCollectedJSRuntime::Get();
   MOZ_ASSERT(CycleCollectedJSContext::Get()->Context() == aContext);
 
-#ifdef MOZ_GECKO_PROFILER
   if (profiler_thread_is_being_profiled()) {
     if (aProgress == JS::GC_CYCLE_END) {
       struct GCMajorMarker {
         static constexpr mozilla::Span<const char> MarkerTypeName() {
           return mozilla::MakeStringSpan("GCMajor");
         }
         static void StreamJSONMarkerData(
             mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
@@ -1068,17 +1067,16 @@ void CycleCollectedJSRuntime::GCSliceCal
       profiler_add_marker("GCSlice", baseprofiler::category::GCCC,
                           MarkerTiming::Interval(aDesc.lastSliceStart(aContext),
                                                  aDesc.lastSliceEnd(aContext)),
                           GCSliceMarker{},
                           ProfilerString8View::WrapNullTerminatedString(
                               aDesc.sliceToJSONProfiler(aContext).get()));
     }
   }
-#endif
 
   if (aProgress == JS::GC_CYCLE_END &&
       JS::dbg::FireOnGarbageCollectionHookRequired(aContext)) {
     JS::GCReason reason = aDesc.reason_;
     Unused << NS_WARN_IF(
         NS_FAILED(DebuggerOnGCRunnable::Enqueue(aContext, aDesc)) &&
         reason != JS::GCReason::SHUTDOWN_CC &&
         reason != JS::GCReason::DESTROY_RUNTIME &&
@@ -1140,20 +1138,18 @@ void CycleCollectedJSRuntime::GCNurseryC
   if (timelines && !timelines->IsEmpty()) {
     UniquePtr<AbstractTimelineMarker> abstractMarker(
         MakeUnique<MinorGCMarker>(aProgress, aReason));
     timelines->AddMarkerForAllObservedDocShells(abstractMarker);
   }
 
   if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START) {
     self->mLatestNurseryCollectionStart = TimeStamp::Now();
-  }
-#ifdef MOZ_GECKO_PROFILER
-  else if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END &&
-           profiler_thread_is_being_profiled()) {
+  } else if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END &&
+             profiler_thread_is_being_profiled()) {
     struct GCMinorMarker {
       static constexpr mozilla::Span<const char> MarkerTypeName() {
         return mozilla::MakeStringSpan("GCMinor");
       }
       static void StreamJSONMarkerData(
           mozilla::baseprofiler::SpliceableJSONWriter& aWriter,
           const mozilla::ProfilerString8View& aTimingJSON) {
         if (aTimingJSON.Length() != 0) {
@@ -1179,17 +1175,16 @@ void CycleCollectedJSRuntime::GCNurseryC
 
     profiler_add_marker(
         "GCMinor", baseprofiler::category::GCCC,
         MarkerTiming::IntervalUntilNowFrom(self->mLatestNurseryCollectionStart),
         GCMinorMarker{},
         ProfilerString8View::WrapNullTerminatedString(
             JS::MinorGcToJSON(aContext).get()));
   }
-#endif
 
   if (self->mPrevGCNurseryCollectionCallback) {
     self->mPrevGCNurseryCollectionCallback(aContext, aProgress, aReason);
   }
 }
 
 /* static */
 void CycleCollectedJSRuntime::OutOfMemoryCallback(JSContext* aContext,
--- a/xpcom/base/Logging.cpp
+++ b/xpcom/base/Logging.cpp
@@ -590,17 +590,16 @@ class LogModuleManager {
       charsWritten = strlen(buff);
     } else if (static_cast<size_t>(charsWritten) >= kBuffSize - 1) {
       // We may have maxed out, allocate a buffer instead.
       allocatedBuff = mozilla::Vsmprintf(aFmt, aArgs);
       buffToWrite = allocatedBuff.get();
       charsWritten = strlen(buffToWrite);
     }
 
-#ifdef MOZ_GECKO_PROFILER
     if (mAddProfilerMarker && profiler_can_accept_markers()) {
       struct LogMarker {
         static constexpr Span<const char> MarkerTypeName() {
           return MakeStringSpan("Log");
         }
         static void StreamJSONMarkerData(
             baseprofiler::SpliceableJSONWriter& aWriter,
             const ProfilerString8View& aModule,
@@ -620,17 +619,16 @@ class LogModuleManager {
 
       profiler_add_marker(
           "LogMessages", geckoprofiler::category::OTHER,
           aStart ? MarkerTiming::IntervalUntilNowFrom(*aStart)
                  : MarkerTiming::InstantNow(),
           LogMarker{}, ProfilerString8View::WrapNullTerminatedString(aName),
           ProfilerString8View::WrapNullTerminatedString(buffToWrite));
     }
-#endif
 
     // Determine if a newline needs to be appended to the message.
     const char* newline = "";
     if (charsWritten == 0 || buffToWrite[charsWritten - 1] != '\n') {
       newline = "\n";
     }
 
     FILE* out = stderr;
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -1485,17 +1485,16 @@ void PerformanceCounterState::MaybeRepor
   // Long tasks only matter on the main thread.
   if (mIsMainThread && duration.ToMilliseconds() > LONGTASK_BUSY_WINDOW_MS) {
     // Idle events (gc...) don't *really* count here
     if (!mCurrentRunnableIsIdleRunnable) {
       mLastLongNonIdleTaskEnd = aNow;
     }
     mLastLongTaskEnd = aNow;
 
-#ifdef MOZ_GECKO_PROFILER
     if (profiler_thread_is_being_profiled()) {
       struct LongTaskMarker {
         static constexpr Span<const char> MarkerTypeName() {
           return MakeStringSpan("MainThreadLongTask");
         }
         static void StreamJSONMarkerData(
             baseprofiler::SpliceableJSONWriter& aWriter) {
           aWriter.StringProperty("category", "LongTask");
@@ -1510,13 +1509,12 @@ void PerformanceCounterState::MaybeRepor
 
       profiler_add_marker(mCurrentRunnableIsIdleRunnable
                               ? ProfilerString8View("LongIdleTask")
                               : ProfilerString8View("LongTask"),
                           geckoprofiler::category::OTHER,
                           MarkerTiming::Interval(mCurrentTimeSliceStart, aNow),
                           LongTaskMarker{});
     }
-#endif
   }
 }
 
 }  // namespace mozilla