Skip to content

Commit

Permalink
Backed out 23 changesets (bug 1675409) for build bustages on Preferen…
Browse files Browse the repository at this point in the history
…ces.cpp. CLOSED TREE

Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
  • Loading branch information
Razvan Maries committed Nov 18, 2020
1 parent 44aac69 commit cdb2616
Show file tree
Hide file tree
Showing 64 changed files with 4,293 additions and 1,343 deletions.
4 changes: 4 additions & 0 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@
# include "nsIWebBrowserPrint.h"
#endif

#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif

using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::net;
Expand Down
3 changes: 3 additions & 0 deletions dom/base/ChromeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
#include "nsThreadUtils.h"
#include "mozJSComponentLoader.h"
#include "GeckoProfiler.h"
#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif
#include "nsIException.h"

namespace mozilla::dom {
Expand Down
25 changes: 11 additions & 14 deletions dom/base/TimeoutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include "TimeoutBudgetManager.h"
#include "mozilla/net/WebSocketEventService.h"
#include "mozilla/MediaManager.h"
#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif

using namespace mozilla;
using namespace mozilla::dom;
Expand Down Expand Up @@ -151,13 +154,10 @@ void TimeoutManager::MoveIdleToActive() {
int(elapsed.ToMilliseconds()), int(target.ToMilliseconds()),
int(delta.ToMilliseconds()));
// don't have end before start...
PROFILER_MARKER_TEXT(
"setTimeout deferred release", DOM,
MarkerOptions(
MarkerTiming::Interval(
delta.ToMilliseconds() >= 0 ? timeout->When() : now, now),
MarkerInnerWindowId(mWindow.WindowID())),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"setTimeout deferred release", DOM, TextMarkerPayload,
(marker, delta.ToMilliseconds() >= 0 ? timeout->When() : now, now,
Some(mWindow.WindowID())));
}
#endif
num++;
Expand Down Expand Up @@ -906,13 +906,10 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
int(elapsed.ToMilliseconds()), int(target.ToMilliseconds()),
int(delta.ToMilliseconds()), int(runtime.ToMilliseconds()));
// don't have end before start...
PROFILER_MARKER_TEXT(
"setTimeout", DOM,
MarkerOptions(
MarkerTiming::Interval(
delta.ToMilliseconds() >= 0 ? timeout->When() : now, now),
MarkerInnerWindowId(mWindow.WindowID())),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"setTimeout", DOM, TextMarkerPayload,
(marker, delta.ToMilliseconds() >= 0 ? timeout->When() : now, now,
Some(mWindow.WindowID())));
}
#endif

Expand Down
93 changes: 33 additions & 60 deletions dom/base/nsDOMNavigationTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "nsPrintfCString.h"
#include "prtime.h"
#ifdef MOZ_GECKO_PROFILER
# include "mozilla/ProfilerMarkerTypes.h"
# include "ProfilerMarkerPayload.h"
#endif

using namespace mozilla;
Expand Down Expand Up @@ -116,18 +116,14 @@ void nsDOMNavigationTiming::NotifyUnloadAccepted(nsIURI* aOldURI) {

void nsDOMNavigationTiming::NotifyUnloadEventStart() {
mUnloadStart = TimeStamp::Now();
PROFILER_MARKER("Unload", NETWORK,
MarkerOptions(MarkerTiming::IntervalStart(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "Unload", NETWORK,
TRACING_INTERVAL_START, mDocShell);
}

void nsDOMNavigationTiming::NotifyUnloadEventEnd() {
mUnloadEnd = TimeStamp::Now();
PROFILER_MARKER("Unload", NETWORK,
MarkerOptions(MarkerTiming::IntervalEnd(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "Unload", NETWORK,
TRACING_INTERVAL_END, mDocShell);
}

void nsDOMNavigationTiming::NotifyLoadEventStart() {
Expand All @@ -136,10 +132,8 @@ void nsDOMNavigationTiming::NotifyLoadEventStart() {
}
mLoadEventStart = TimeStamp::Now();

PROFILER_MARKER("Load", NETWORK,
MarkerOptions(MarkerTiming::IntervalStart(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "Load", NETWORK,
TRACING_INTERVAL_START, mDocShell);

if (IsTopLevelContentDocumentInContentProcess()) {
mLoadEventStartForTelemetry = TimeStamp::Now();
Expand Down Expand Up @@ -169,10 +163,8 @@ void nsDOMNavigationTiming::NotifyLoadEventEnd() {
}
mLoadEventEnd = TimeStamp::Now();

PROFILER_MARKER("Load", NETWORK,
MarkerOptions(MarkerTiming::IntervalEnd(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "Load", NETWORK,
TRACING_INTERVAL_END, mDocShell);

if (IsTopLevelContentDocumentInContentProcess()) {
#ifdef MOZ_GECKO_PROFILER
Expand All @@ -187,13 +179,10 @@ void nsDOMNavigationTiming::NotifyLoadEventEnd() {
"Document %s loaded after %dms, load event duration %dms", spec.get(),
int(elapsed.ToMilliseconds()), int(duration.ToMilliseconds()));
PAGELOAD_LOG(("%s", marker.get()));
PROFILER_MARKER_TEXT(
"DocumentLoad", DOM,
MarkerOptions(
MarkerTiming::Interval(mNavigationStart, mLoadEventEnd),
MarkerInnerWindowId(
profiler_get_inner_window_id_from_docshell(mDocShell))),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"DocumentLoad", DOM, TextMarkerPayload,
(marker, mNavigationStart, mLoadEventEnd,
profiler_get_inner_window_id_from_docshell(mDocShell)));
}
#endif
TimeStamp loadEventEnd = TimeStamp::Now();
Expand Down Expand Up @@ -252,10 +241,8 @@ void nsDOMNavigationTiming::NotifyDOMContentLoadedStart(nsIURI* aURI) {
mLoadedURI = aURI;
mDOMContentLoadedEventStart = TimeStamp::Now();

PROFILER_MARKER("DOMContentLoaded", NETWORK,
MarkerOptions(MarkerTiming::IntervalStart(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "DOMContentLoaded", NETWORK,
TRACING_INTERVAL_START, mDocShell);

if (IsTopLevelContentDocumentInContentProcess()) {
TimeStamp now = TimeStamp::Now();
Expand Down Expand Up @@ -286,10 +273,8 @@ void nsDOMNavigationTiming::NotifyDOMContentLoadedEnd(nsIURI* aURI) {
mLoadedURI = aURI;
mDOMContentLoadedEventEnd = TimeStamp::Now();

PROFILER_MARKER("DOMContentLoaded", NETWORK,
MarkerOptions(MarkerTiming::IntervalEnd(),
MarkerInnerWindowIdFromDocShell(mDocShell)),
Tracing, "Navigation");
PROFILER_TRACING_MARKER_DOCSHELL("Navigation", "DOMContentLoaded", NETWORK,
TRACING_INTERVAL_END, mDocShell);

if (IsTopLevelContentDocumentInContentProcess()) {
Telemetry::AccumulateTimeDelta(Telemetry::TIME_TO_DOM_CONTENT_LOADED_END_MS,
Expand Down Expand Up @@ -392,13 +377,10 @@ void nsDOMNavigationTiming::TTITimeout(nsITimer* aTimer) {
int(elapsed.ToMilliseconds()),
int(elapsedLongTask.ToMilliseconds()), spec.get());

PROFILER_MARKER_TEXT(
"TimeToFirstInteractive (TTFI)", DOM,
MarkerOptions(
MarkerTiming::Interval(mNavigationStart, mTTFI),
MarkerInnerWindowId(
profiler_get_inner_window_id_from_docshell(mDocShell))),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"TimeToFirstInteractive (TTFI)", DOM, TextMarkerPayload,
(marker, mNavigationStart, mTTFI,
profiler_get_inner_window_id_from_docshell(mDocShell)));
}
#endif
}
Expand Down Expand Up @@ -428,13 +410,10 @@ void nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument() {
: "this tab was inactive some of the time between navigation start "
"and first non-blank paint");
PAGELOAD_LOG(("%s", marker.get()));
PROFILER_MARKER_TEXT(
"FirstNonBlankPaint", DOM,
MarkerOptions(
MarkerTiming::Interval(mNavigationStart, mNonBlankPaint),
MarkerInnerWindowId(
profiler_get_inner_window_id_from_docshell(mDocShell))),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"FirstNonBlankPaint", DOM, TextMarkerPayload,
(marker, mNavigationStart, mNonBlankPaint,
profiler_get_inner_window_id_from_docshell(mDocShell)));
}
#endif

Expand Down Expand Up @@ -480,13 +459,10 @@ void nsDOMNavigationTiming::NotifyContentfulPaintForRootContentDocument(
: "this tab was inactive some of the time between navigation start "
"and first non-blank paint");
PAGELOAD_LOG(("%s", marker.get()));
PROFILER_MARKER_TEXT(
"FirstContentfulPaint", DOM,
MarkerOptions(
MarkerTiming::Interval(mNavigationStart, mContentfulPaint),
MarkerInnerWindowId(
profiler_get_inner_window_id_from_docshell(mDocShell))),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"FirstContentfulPaint", DOM, TextMarkerPayload,
(marker, mNavigationStart, mContentfulPaint,
profiler_get_inner_window_id_from_docshell(mDocShell)));
}
#endif

Expand Down Expand Up @@ -532,13 +508,10 @@ void nsDOMNavigationTiming::NotifyDOMContentFlushedForRootContentDocument() {
: "this tab was inactive some of the time between navigation start "
"and DOMContentFlushed");
PAGELOAD_LOG(("%s", marker.get()));
PROFILER_MARKER_TEXT(
"DOMContentFlushed", DOM,
MarkerOptions(
MarkerTiming::Interval(mNavigationStart, mDOMContentFlushed),
MarkerInnerWindowId(
profiler_get_inner_window_id_from_docshell(mDocShell))),
marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
"DOMContentFlushed", DOM, TextMarkerPayload,
(marker, mNavigationStart, mDOMContentFlushed,
profiler_get_inner_window_id_from_docshell(mDocShell)));
}
#endif
}
Expand Down
4 changes: 4 additions & 0 deletions dom/events/EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,10 @@ nsresult EventDispatcher::Dispatch(nsISupports* aTarget,

struct DOMEventMarker {
static constexpr Span<const char> MarkerTypeName() {
// Note: DOMEventMarkerPayload was originally a sub-class of
// TracingMarkerPayload, so it uses the same payload type.
// TODO: Change to its own distinct type, but this will require
// front-end changes.
return MakeStringSpan("DOMEvent");
}
static void StreamJSONMarkerData(
Expand Down
22 changes: 15 additions & 7 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
# include "mozilla/a11y/PDocAccessible.h"
#endif
#include "GeckoProfiler.h"
#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif
#include "GMPServiceParent.h"
#include "HandlerServiceParent.h"
#include "IHistory.h"
Expand Down Expand Up @@ -915,7 +918,9 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Reused process %u",
(unsigned int)retval->ChildID());
PROFILER_MARKER_TEXT("Process", DOM, {}, marker);
TimeStamp now = TimeStamp::Now();
PROFILER_ADD_MARKER_WITH_PAYLOAD("Process", DOM, TextMarkerPayload,
(marker, now, now));
}
#endif
MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
Expand Down Expand Up @@ -954,7 +959,9 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Recycled process %u (%p)",
(unsigned int)recycled->ChildID(), recycled.get());
PROFILER_MARKER_TEXT("Process", DOM, {}, marker);
TimeStamp now = TimeStamp::Now();
PROFILER_ADD_MARKER_WITH_PAYLOAD("Process", DOM, TextMarkerPayload,
(marker, now, now));
}
#endif
MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
Expand All @@ -977,7 +984,9 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Assigned preallocated process %u",
(unsigned int)preallocated->ChildID());
PROFILER_MARKER_TEXT("Process", DOM, {}, marker);
TimeStamp now = TimeStamp::Now();
PROFILER_ADD_MARKER_WITH_PAYLOAD("Process", DOM, TextMarkerPayload,
(marker, now, now));
}
#endif
MOZ_LOG(ContentParent::GetLog(), LogLevel::Debug,
Expand Down Expand Up @@ -2414,10 +2423,9 @@ bool ContentParent::LaunchSubprocessResolve(bool aIsSync,
nsPrintfCString marker("Process start%s for %u",
mIsAPreallocBlocker ? " (immediate)" : "",
(unsigned int)ChildID());
PROFILER_MARKER_TEXT(
mIsAPreallocBlocker ? ProfilerString8View("Process Immediate Launch")
: ProfilerString8View("Process Launch"),
DOM, MarkerTiming::Interval(mLaunchTS, launchResumeTS), marker);
PROFILER_ADD_MARKER_WITH_PAYLOAD(
mIsAPreallocBlocker ? "Process Immediate Launch" : "Process Launch",
DOM, TextMarkerPayload, (marker, mLaunchTS, launchResumeTS));
}
#endif

Expand Down
48 changes: 17 additions & 31 deletions dom/media/AsyncLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include "mozilla/MathAlgorithms.h"
#include "mozilla/Sprintf.h"
#include "GeckoProfiler.h"
#ifdef MOZ_GECKO_PROFILER
# include "ProfilerMarkerPayload.h"
#endif
#include "MPSCQueue.h"

#if defined(_WIN32)
Expand Down Expand Up @@ -196,41 +199,24 @@ class AsyncLogger {
}
#ifdef MOZ_GECKO_PROFILER
{
struct Budget {
static constexpr Span<const char> MarkerTypeName() {
return MakeStringSpan("Budget");
}
static void StreamJSONMarkerData(
baseprofiler::SpliceableJSONWriter& aWriter) {}
static MarkerSchema MarkerTypeDisplay() {
using MS = MarkerSchema;
MS schema{MS::Location::markerChart, MS::Location::markerTable};
// Nothing outside the defaults.
return schema;
}
};

TracePayload message;
while (mMessageQueueProfiler.Pop(&message) && mRunning) {
if (message.mPhase != TracingPhase::COMPLETE) {
profiler_add_marker(
ProfilerString8View::WrapNullTerminatedString(message.mName),
geckoprofiler::category::MEDIA_RT,
{MarkerThreadId(message.mTID),
(message.mPhase == TracingPhase::BEGIN)
? MarkerTiming::IntervalStart(message.mTimestamp)
: MarkerTiming::IntervalEnd(message.mTimestamp)},
Budget{});
TracingKind kind = message.mPhase == TracingPhase::BEGIN
? TracingKind::TRACING_INTERVAL_START
: TracingKind::TRACING_INTERVAL_END;
TracingMarkerPayload payload("media", kind, message.mTimestamp);
profiler_add_marker_for_thread(
message.mTID, JS::ProfilingCategoryPair::MEDIA_RT,
message.mName, payload);
} else {
profiler_add_marker(
ProfilerString8View::WrapNullTerminatedString(message.mName),
geckoprofiler::category::MEDIA_RT,
{MarkerThreadId(message.mTID),
MarkerTiming::Interval(
message.mTimestamp,
message.mTimestamp + TimeDuration::FromMicroseconds(
message.mDurationUs))},
Budget{});
mozilla::TimeStamp end =
message.mTimestamp +
TimeDuration::FromMicroseconds(message.mDurationUs);
BudgetMarkerPayload payload(message.mTimestamp, end);
profiler_add_marker_for_thread(
message.mTID, JS::ProfilingCategoryPair::MEDIA_RT,
message.mName, payload);
}
}
}
Expand Down
Loading

0 comments on commit cdb2616

Please sign in to comment.