Skip to content

Commit

Permalink
Backed out 5 changesets (bug 1738627) for causing xpcshell failures o…
Browse files Browse the repository at this point in the history
…n test_ext_geckoProfiler_schema.js CLOSED TREE

Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
  • Loading branch information
Cristian Tuns committed Nov 5, 2021
1 parent de04658 commit 1aeac93
Show file tree
Hide file tree
Showing 52 changed files with 325 additions and 893 deletions.
2 changes: 1 addition & 1 deletion accessible/generic/LocalAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ void LocalAccessible::XULElmName(DocAccessible* aDocument, nsIContent* aElm,
nsresult LocalAccessible::HandleAccEvent(AccEvent* aEvent) {
NS_ENSURE_ARG_POINTER(aEvent);

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsAutoCString strEventType;
GetAccService()->GetStringEventType(aEvent->GetEventType(), strEventType);
nsAutoCString strMarker;
Expand Down
19 changes: 0 additions & 19 deletions devtools/client/performance-new/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,25 +417,6 @@ const featureDescriptions = [
"increase in some processes.",
disabledReason: "Windows only.",
},
{
name: "CPU Utilization - All Threads",
value: "cpuallthreads",
title:
"Record how much CPU has been used between samples by ALL registered thread.",
experimental: true,
},
{
name: "Periodic Sampling - All Threads",
value: "samplingallthreads",
title: "Capture stack samples in ALL registered thread.",
experimental: true,
},
{
name: "Markers - All Threads",
value: "markersallthreads",
title: "Record markers in ALL registered threads.",
experimental: true,
},
];

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7906,7 +7906,7 @@ nsresult nsDocShell::CreateContentViewer(const nsACString& aContentType,
NS_ENSURE_SUCCESS(rv, rv);

if (!parentSite.Equals(thisSite)) {
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsCOMPtr<nsIURI> prinURI;
BasePrincipal::Cast(thisPrincipal)->GetURI(getter_AddRefs(prinURI));
nsPrintfCString marker("Iframe loaded in background: %s",
Expand Down
4 changes: 2 additions & 2 deletions dom/animation/AnimationEventDispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct AnimationEventInfo {
nsCSSPseudoElements::PseudoTypeAsString(aTarget.mPseudoType);

if ((aMessage == eAnimationCancel || aMessage == eAnimationEnd) &&
profiler_thread_is_being_profiled_for_markers()) {
profiler_thread_is_being_profiled()) {
nsCString markerText;
aAnimationName->ToUTF8String(markerText);
PROFILER_MARKER_TEXT(
Expand Down Expand Up @@ -89,7 +89,7 @@ struct AnimationEventInfo {
nsCSSPseudoElements::PseudoTypeAsString(aTarget.mPseudoType);

if ((aMessage == eTransitionEnd || aMessage == eTransitionCancel) &&
profiler_thread_is_being_profiled_for_markers()) {
profiler_thread_is_being_profiled()) {
nsCString markerText;
markerText.Assign(nsCSSProps::GetStringValue(aProperty));
if (aMessage == eTransitionCancel) {
Expand Down
2 changes: 1 addition & 1 deletion dom/base/ChromeUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void ChromeUtils::AddProfilerMarker(
GlobalObject& aGlobal, const nsACString& aName,
const ProfilerMarkerOptionsOrDouble& aOptions,
const Optional<nsACString>& aText) {
if (!profiler_thread_is_being_profiled_for_markers()) {
if (!profiler_thread_is_being_profiled()) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion dom/base/TimeoutManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void TimeoutManager::MoveIdleToActive() {
}
timeout->remove();
mTimeouts.InsertFront(timeout);
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
if (num == 0) {
now = TimeStamp::Now();
}
Expand Down
15 changes: 5 additions & 10 deletions dom/base/nsDOMNavigationTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ void nsDOMNavigationTiming::NotifyLoadEventEnd() {
Tracing, "Navigation");

if (IsTopLevelContentDocumentInContentProcess()) {
if (profiler_thread_is_being_profiled_for_markers() ||
PAGELOAD_LOG_ENABLED()) {
if (profiler_thread_is_being_profiled() || PAGELOAD_LOG_ENABLED()) {
TimeDuration elapsed = mLoadEventEnd - mNavigationStart;
TimeDuration duration = mLoadEventEnd - mLoadEventStart;
nsAutoCString spec;
Expand Down Expand Up @@ -369,8 +368,7 @@ void nsDOMNavigationTiming::TTITimeout(nsITimer* aTimer) {

mTTITimer = nullptr;

if (profiler_thread_is_being_profiled_for_markers() ||
PAGELOAD_LOG_ENABLED()) {
if (profiler_thread_is_being_profiled() || PAGELOAD_LOG_ENABLED()) {
TimeDuration elapsed = mTTFI - mNavigationStart;
MOZ_ASSERT(elapsed.ToMilliseconds() > 0);
TimeDuration elapsedLongTask =
Expand Down Expand Up @@ -401,8 +399,7 @@ void nsDOMNavigationTiming::NotifyNonBlankPaintForRootContentDocument() {

mNonBlankPaint = TimeStamp::Now();

if (profiler_thread_is_being_profiled_for_markers() ||
PAGELOAD_LOG_ENABLED()) {
if (profiler_thread_is_being_profiled() || PAGELOAD_LOG_ENABLED()) {
TimeDuration elapsed = mNonBlankPaint - mNavigationStart;
nsAutoCString spec;
if (mLoadedURI) {
Expand Down Expand Up @@ -450,8 +447,7 @@ void nsDOMNavigationTiming::NotifyContentfulCompositeForRootContentDocument(

mContentfulComposite = aCompositeEndTime;

if (profiler_thread_is_being_profiled_for_markers() ||
PAGELOAD_LOG_ENABLED()) {
if (profiler_thread_is_being_profiled() || PAGELOAD_LOG_ENABLED()) {
TimeDuration elapsed = mContentfulComposite - mNavigationStart;
nsAutoCString spec;
if (mLoadedURI) {
Expand Down Expand Up @@ -500,8 +496,7 @@ void nsDOMNavigationTiming::NotifyDOMContentFlushedForRootContentDocument() {

mDOMContentFlushed = TimeStamp::Now();

if (profiler_thread_is_being_profiled_for_markers() ||
PAGELOAD_LOG_ENABLED()) {
if (profiler_thread_is_being_profiled() || PAGELOAD_LOG_ENABLED()) {
TimeDuration elapsed = mDOMContentFlushed - mNavigationStart;
nsAutoCString spec;
if (mLoadedURI) {
Expand Down
2 changes: 1 addition & 1 deletion dom/base/nsGlobalWindowInner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6240,7 +6240,7 @@ bool nsGlobalWindowInner::RunTimeoutHandler(Timeout* aTimeout,
const char* reason = GetTimeoutReasonString(timeout);

nsCString str;
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
TimeDuration originalInterval = timeout->When() - timeout->SubmitTime();
str.Append(reason);
str.Append(" with interval ");
Expand Down
2 changes: 1 addition & 1 deletion dom/indexedDB/ProfilerHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void LoggingHelper(bool aUseProfiler, const char* aFmt, va_list args) {
static const mozilla::LogLevel logLevel = LogLevel::Warning;

if (MOZ_LOG_TEST(logModule, logLevel) ||
(aUseProfiler && profiler_thread_is_being_profiled_for_markers())) {
(aUseProfiler && profiler_thread_is_being_profiled())) {
nsAutoCString message;

message.AppendVprintf(aFmt, args);
Expand Down
8 changes: 4 additions & 4 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
// If the provider returned an existing ContentParent, use that one.
if (0 <= index && static_cast<uint32_t>(index) <= aMaxContentParents) {
RefPtr<ContentParent> retval = aContentParents[index];
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Reused process %u",
(unsigned int)retval->ChildID());
PROFILER_MARKER_TEXT("Process", DOM, {}, marker);
Expand Down Expand Up @@ -968,7 +968,7 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
recycled->AssertAlive();
recycled->StopRecycling();

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Recycled process %u (%p)",
(unsigned int)recycled->ChildID(), recycled.get());
PROFILER_MARKER_TEXT("Process", DOM, {}, marker);
Expand All @@ -990,7 +990,7 @@ already_AddRefed<ContentParent> ContentParent::GetUsedBrowserProcess(
MOZ_DIAGNOSTIC_ASSERT(sRecycledE10SProcess != preallocated);
preallocated->AssertAlive();

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker(
"Assigned preallocated process %u%s",
(unsigned int)preallocated->ChildID(),
Expand Down Expand Up @@ -2601,7 +2601,7 @@ bool ContentParent::LaunchSubprocessResolve(bool aIsSync,
mPrefSerializer = nullptr;

const auto launchResumeTS = TimeStamp::Now();
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString marker("Process start%s for %u",
mIsAPreallocBlocker ? " (immediate)" : "",
(unsigned int)ChildID());
Expand Down
2 changes: 1 addition & 1 deletion dom/media/mediasink/AudioSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ UniquePtr<AudioStream::Chunk> AudioSink::PopFrames(uint32_t aFrames) {
mCurrentData->mTime.ToMicroseconds(),
mCurrentData->Frames() - mCursor->Available(), framesToPop);

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
mOwnerThread->Dispatch(NS_NewRunnableFunction(
"AudioSink:AddMarker",
[startTime = mCurrentData->mTime.ToMicroseconds(),
Expand Down
12 changes: 6 additions & 6 deletions dom/media/mediasink/DecodedStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ nsresult DecodedStream::Start(const TimeUnit& aStartTime,
MOZ_ASSERT(mStartTime.isNothing(), "playback already started.");

AUTO_PROFILER_LABEL(FUNCTION_SIGNATURE, MEDIA_PLAYBACK);
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("StartTime=%" PRId64,
aStartTime.ToMicroseconds());
PLAYBACK_PROFILER_MARKER(markerString);
Expand Down Expand Up @@ -665,7 +665,7 @@ void DecodedStream::SetPlaying(bool aPlaying) {
return;
}

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("Playing=%s", aPlaying ? "true" : "false");
PLAYBACK_PROFILER_MARKER(markerString);
}
Expand All @@ -675,7 +675,7 @@ void DecodedStream::SetPlaying(bool aPlaying) {

void DecodedStream::SetVolume(double aVolume) {
AssertOwnerThread();
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("Volume=%f", aVolume);
PLAYBACK_PROFILER_MARKER(markerString);
}
Expand All @@ -690,7 +690,7 @@ void DecodedStream::SetVolume(double aVolume) {

void DecodedStream::SetPlaybackRate(double aPlaybackRate) {
AssertOwnerThread();
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("PlaybackRate=%f", aPlaybackRate);
PLAYBACK_PROFILER_MARKER(markerString);
}
Expand All @@ -705,7 +705,7 @@ void DecodedStream::SetPlaybackRate(double aPlaybackRate) {

void DecodedStream::SetPreservesPitch(bool aPreservesPitch) {
AssertOwnerThread();
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("PreservesPitch=%s",
aPreservesPitch ? "true" : "false");
PLAYBACK_PROFILER_MARKER(markerString);
Expand Down Expand Up @@ -1088,7 +1088,7 @@ void DecodedStream::NotifyOutput(int64_t aTime) {
mLastOutputTime = time;
auto currentTime = GetPosition();

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString("OutputTime=%" PRId64,
currentTime.ToMicroseconds());
PLAYBACK_PROFILER_MARKER(markerString);
Expand Down
4 changes: 2 additions & 2 deletions dom/media/mediasource/TrackBuffersManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,7 @@ void TrackBuffersManager::InsertFrames(TrackBuffer& aSamples,
aSamples.Length(), aTrackData.mInfo->mMimeType.get(),
aIntervals.GetStart().ToMicroseconds(),
aIntervals.GetEnd().ToMicroseconds());
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString(
"Processing %zu %s frames(start:%" PRId64 " end:%" PRId64 ")",
aSamples.Length(), aTrackData.mInfo->mMimeType.get(),
Expand Down Expand Up @@ -2348,7 +2348,7 @@ uint32_t TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
lastRemovedIndex - firstRemovedIndex.ref() + 1,
removedIntervals.GetStart().ToSeconds(),
removedIntervals.GetEnd().ToSeconds());
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsPrintfCString markerString(
"Removing frames from:%u (frames:%u) ([%f, %f))",
firstRemovedIndex.ref(), lastRemovedIndex - firstRemovedIndex.ref() + 1,
Expand Down
2 changes: 1 addition & 1 deletion dom/media/utils/PerformanceRecorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const char* PerformanceRecorder::FindMediaResolution(int32_t aHeight) {

/* static */
bool PerformanceRecorder::IsMeasurementEnabled() {
return profiler_thread_is_being_profiled_for_markers() ||
return profiler_thread_is_being_profiled() ||
PerformanceRecorder::sEnableMeasurementForTesting;
}

Expand Down
4 changes: 2 additions & 2 deletions dom/performance/Performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void Performance::Mark(const nsAString& aName, ErrorResult& aRv) {
new PerformanceMark(GetParentObject(), aName, Now());
InsertUserEntry(performanceMark);

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
Maybe<uint64_t> innerWindowId;
if (GetOwner()) {
innerWindowId = Some(GetOwner()->WindowID());
Expand Down Expand Up @@ -408,7 +408,7 @@ void Performance::Measure(const nsAString& aName,
new PerformanceMeasure(GetParentObject(), aName, startTime, endTime);
InsertUserEntry(performanceMeasure);

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
TimeStamp startTimeStamp =
CreationTimeStamp() + TimeDuration::FromMilliseconds(startTime);
TimeStamp endTimeStamp =
Expand Down
2 changes: 1 addition & 1 deletion dom/workers/WorkerScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ void WorkerGlobalScope::ImportScripts(JSContext* aCx,
{
AUTO_PROFILER_MARKER_TEXT(
"ImportScripts", JS, MarkerStack::Capture(),
profiler_thread_is_being_profiled_for_markers()
profiler_thread_is_being_profiled()
? StringJoin(","_ns, aScriptURLs,
[](nsACString& dest, const auto& scriptUrl) {
AppendUTF16toUTF8(scriptUrl, dest);
Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/Layers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "mozilla/ArrayIterator.h" // for ArrayIterator
#include "mozilla/DebugOnly.h" // for DebugOnly
#include "mozilla/Logging.h" // for LogLevel, LogLevel::Debug, MOZ_LOG_TEST
#include "mozilla/ProfilerMarkers.h" // for profiler_thread_is_being_profiled_for_markers, PROFILER_MARKER_TEXT
#include "mozilla/ProfilerMarkers.h" // for profiler_thread_is_being_profiled, PROFILER_MARKER_TEXT
#include "mozilla/ScrollPositionUpdate.h" // for ScrollPositionUpdate
#include "mozilla/Telemetry.h" // for AccumulateTimeDelta
#include "mozilla/TelemetryHistogramEnums.h" // for KEYPRESS_PRESENT_LATENCY, SCROLL_PRESENT_LATENCY
Expand Down Expand Up @@ -98,7 +98,7 @@ void RecordCompositionPayloadsPresented(
if (aPayloads.Length()) {
TimeStamp presented = aCompositionEndTime;
for (const CompositionPayload& payload : aPayloads) {
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
MOZ_RELEASE_ASSERT(payload.mType <= kHighestCompositionPayloadType);
nsAutoCString name(
kCompositionPayloadTypeNames[uint8_t(payload.mType)]);
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/ProfilerScreenshots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void ProfilerScreenshots::SubmitScreenshot(
originalSize, scaledSize, timeStamp]() {
// Create a new surface that wraps backingSurface's data but has the
// correct size.
if (profiler_thread_is_being_profiled_for_markers(sourceThread)) {
if (profiler_thread_is_being_profiled(sourceThread)) {
DataSourceSurface::ScopedMap scopedMap(backingSurface,
DataSourceSurface::READ);
RefPtr<DataSourceSurface> surf =
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/SurfacePoolCA.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

aFn();

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
PROFILER_MARKER_TEXT(
"SurfacePool", GRAPHICS, MarkerTiming::IntervalUntilNowFrom(before),
nsPrintfCString("%d -> %d in use | %d -> %d waiting for | %d -> %d "
Expand Down
11 changes: 5 additions & 6 deletions gfx/layers/composite/ImageComposite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void ImageComposite::UpdateBias(size_t aImageIndex, bool aFrameChanged) {
? mImages[aImageIndex + 1].mTimeStamp
: TimeStamp();

if (profiler_thread_is_being_profiled_for_markers() && compositedImageTime &&
if (profiler_thread_is_being_profiled() && compositedImageTime &&
nextImageTime) {
TimeDuration offsetCurrent = compositedImageTime - compositionTime;
TimeDuration offsetNext = nextImageTime - compositionTime;
Expand Down Expand Up @@ -182,7 +182,7 @@ void ImageComposite::SetImages(nsTArray<TimedImage>&& aNewImages) {
// will never be shown.
CountSkippedFrames(&aNewImages[0]);

if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
int len = aNewImages.Length();
const auto& first = aNewImages[0];
const auto& last = aNewImages.LastElement();
Expand All @@ -209,7 +209,7 @@ bool ImageComposite::UpdateCompositedFrame(
"Should only be called during a composition");

nsCString descr;
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
nsCString relativeTimeString;
if (image.mTimeStamp) {
relativeTimeString.AppendPrintf(
Expand Down Expand Up @@ -254,7 +254,7 @@ bool ImageComposite::UpdateCompositedFrame(

if (dropped > 0) {
mDroppedFrames += dropped;
if (profiler_thread_is_being_profiled_for_markers()) {
if (profiler_thread_is_being_profiled()) {
const char* frameOrFrames = dropped == 1 ? "frame" : "frames";
nsPrintfCString text("%" PRId32 " %s dropped: %" PRId32 " -> %" PRId32
" (producer %" PRId32 ")",
Expand Down Expand Up @@ -347,8 +347,7 @@ void ImageComposite::CountSkippedFrames(const TimedImage* aImage) {
}

void ImageComposite::DetectTimeStampJitter(const TimedImage* aNewImage) {
if (!profiler_thread_is_being_profiled_for_markers() ||
aNewImage->mTimeStamp.IsNull()) {
if (!profiler_thread_is_being_profiled() || aNewImage->mTimeStamp.IsNull()) {
return;
}

Expand Down
Loading

0 comments on commit 1aeac93

Please sign in to comment.