Bug 1693037 - Fix non-MOZ_GECKO_PROFILER builds - r=florian

No code changes.

Build issues were found by renaming `MOZ_GECKO_PROFILER` to something else in toolkit/moz.configure, in both unified and non-unified builds, on all supported platforms.

Also updated some profiler-related comments.

Differential Revision: https://phabricator.services.mozilla.com/D105375
This commit is contained in:
Gerald Squelart
2021-02-17 22:36:28 +00:00
parent c07ace61b1
commit 1e5211cff5
14 changed files with 36 additions and 19 deletions

View File

@@ -20,6 +20,7 @@
#include "mozilla/dom/WorkerRunnable.h"
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/dom/EventSourceEventService.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/UniquePtrExtensions.h"
#include "nsComponentManagerUtils.h"
#include "nsIThreadRetargetableStreamListener.h"

View File

@@ -15,6 +15,7 @@
#include "mozilla/Logging.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Sprintf.h"
#include "mozilla/TimeStamp.h"
#include "GeckoProfiler.h"
#include "MPSCQueue.h"

View File

@@ -15,7 +15,9 @@
#include "mozilla/Logging.h"
#include "mozilla/MathAlgorithms.h"
#include "mozilla/NotNull.h"
#include "mozilla/Preferences.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkerTypes.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/Sprintf.h"
#include "mozilla/StaticPrefs_media.h"
@@ -38,10 +40,6 @@
#include "VideoSegment.h"
#include "VideoUtils.h"
#ifdef MOZ_GECKO_PROFILER
# include "mozilla/ProfilerMarkerTypes.h"
#endif // MOZ_GECKO_PROFILER
namespace mozilla {
using namespace mozilla::media;

View File

@@ -270,7 +270,7 @@ void RDDParent::ActorDestroy(ActorDestroyReason aWhy) {
// Wait until all RemoteDecoderManagerParent have closed.
mShutdownBlockers.WaitUntilClear(10 * 1000 /* 10s timeout*/)
->Then(GetCurrentSerialEventTarget(), __func__, [this]() {
->Then(GetCurrentSerialEventTarget(), __func__, [&]() {
#ifdef XP_WIN
wmf::MFShutdown();

View File

@@ -42,9 +42,16 @@ 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(const ProfilerString8View& aMarkerTag,
const char* aFormat, ...) {
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, ...) {
va_list ap;
va_start(ap, aFormat);
const nsVprintfCString markerString(aFormat, ap);

View File

@@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/JSONWriter.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/dom/EndpointForReportChild.h"
#include "mozilla/dom/Fetch.h"

View File

@@ -8,6 +8,7 @@
#include "nsIDOMEventListener.h"
#include "GeckoProfiler.h"
#include "jsapi.h" // JS::RootedValueArray
#include "jsfriendapi.h"
#include "js/ArrayBuffer.h" // JS::Is{,Detached}ArrayBufferObject
@@ -45,6 +46,7 @@
#include "mozilla/UniquePtr.h"
namespace mozilla {
namespace dom {
/**

View File

@@ -9,6 +9,7 @@
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Hal.h"
#include "mozilla/ProfilerLabels.h"
#include "mozilla/ProfilerMarkers.h"
#include "mozilla/StaticPrefs_apz.h"
#include "mozilla/StaticPrefs_gfx.h"
#include "mozilla/StaticPrefs_layers.h"

View File

@@ -70,10 +70,6 @@ if CONFIG["MOZ_GECKO_PROFILER"]:
FINAL_LIBRARY = "mozglue"
# Many of the headers in this directory are usable in non-MOZ_GECKO_PROFILER
# builds.
# BaseProfiler.h and BaseProfilerCounts.h only contain no-op macros in that
# case.
EXPORTS += [
"public/BaseProfiler.h",
]

View File

@@ -21,6 +21,9 @@
// These headers are also safe to include unconditionally, with empty macros if
// MOZ_GECKO_PROFILER is not set.
// If your file only uses particular APIs (e.g., only markers), please consider
// including only the needed headers instead of this one, to reduce compilation
// dependencies.
#include "mozilla/BaseProfilerCounts.h"
#include "mozilla/BaseProfilerLabels.h"
#include "mozilla/BaseProfilerMarkers.h"

View File

@@ -128,9 +128,6 @@ IPDL_SOURCES += [
include("/ipc/chromium/chromium-config.mozbuild")
# GeckoProfiler.h and ProfilerCounts.h are the only code that's visible in
# non-MOZ_GECKO_PROFILER builds, and they only contains no-op macros in that
# case.
EXPORTS += [
"public/GeckoProfiler.h",
]
@@ -138,7 +135,6 @@ EXPORTS += [
EXPORTS.mozilla += [
"public/ProfileBufferEntrySerializationGeckoExtensions.h",
"public/ProfileJSONWriter.h",
# vm/GeckoProfiler.h needs to include this and doesn't like #include "ProfilerCounts.h"
"public/ProfilerCounts.h",
"public/ProfilerLabels.h",
"public/ProfilerMarkers.h",

View File

@@ -16,8 +16,11 @@
#ifndef GeckoProfiler_h
#define GeckoProfiler_h
// everything in here is also safe to include unconditionally, and only defines
// empty macros if MOZ_GECKO_PROFILER is unset
// Everything in here is also safe to include unconditionally, and only defines
// empty macros if MOZ_GECKO_PROFILER is unset.
// If your file only uses particular APIs (e.g., only markers), please consider
// including only the needed headers instead of this one, to reduce compilation
// dependencies.
#include "BaseProfiler.h"
#include "mozilla/ProfilerCounts.h"
#include "mozilla/ProfilerLabels.h"
@@ -55,7 +58,7 @@
// This won't be used, it's just there to allow the empty definition of
// `profiler_get_backtrace`.
struct ProfilerBacktrace {};
using UniqueProfilerBacktrace = mozilla::UniquePtr<int>;
using UniqueProfilerBacktrace = mozilla::UniquePtr<ProfilerBacktrace>;
// Get/Capture-backtrace functions can return nullptr or false, the result
// should be fed to another empty macro or stub anyway.
@@ -64,6 +67,10 @@ static inline UniqueProfilerBacktrace profiler_get_backtrace() {
return nullptr;
}
// This won't be used, it's just there to allow the empty definitions of
// `profiler_capture_backtrace_into` and `profiler_capture_backtrace`.
struct ProfileChunkedBuffer {};
static inline bool profiler_capture_backtrace_into(
mozilla::ProfileChunkedBuffer& aChunkedBuffer,
mozilla::StackCaptureOptions aCaptureOptions) {

View File

@@ -46,6 +46,7 @@
#include "mozilla/Maybe.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/StaticPrefs_gfx.h"
#include "mozilla/StaticPrefs_widget.h"
#include "mozilla/WritingModes.h"

View File

@@ -17,6 +17,7 @@
#include "mozilla/InputTaskManager.h"
#include "mozilla/Mutex.h"
#include "mozilla/Preferences.h"
#include "mozilla/ProfilerMarkers.h"
#include "mozilla/SpinEventLoopUntil.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/TaskQueue.h"
@@ -631,7 +632,9 @@ nsThreadManager::NewNamedThread(const nsACString& aName, uint32_t aStackSize,
return NS_ERROR_NOT_INITIALIZED;
}
#ifdef MOZ_GECKO_PROFILER
TimeStamp startTime = TimeStamp::Now();
#endif
RefPtr<ThreadEventQueue> queue =
new ThreadEventQueue(MakeUnique<EventQueue>());