Bug 1667915 - Separate marker category from marker options - r=gregtatum

The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
This commit is contained in:
Gerald Squelart
2020-10-01 01:44:47 +00:00
parent 300de37f87
commit 4eb5bd3574
26 changed files with 380 additions and 360 deletions

View File

@@ -1283,11 +1283,10 @@ bool nsRefreshDriver::RemoveRefreshObserver(nsARefreshObserver* aObserver,
nsPrintfCString str("%s [%s]", data.mDescription,
kFlushTypeNames[aFlushType]);
PROFILER_MARKER_TEXT(
"RefreshObserver",
GRAPHICS.WithOptions(
MarkerStack::TakeBacktrace(std::move(data.mCause)),
MarkerTiming::IntervalUntilNowFrom(data.mRegisterTime),
MarkerInnerWindowId(data.mInnerWindowId)),
"RefreshObserver", GRAPHICS,
MarkerOptions(MarkerStack::TakeBacktrace(std::move(data.mCause)),
MarkerTiming::IntervalUntilNowFrom(data.mRegisterTime),
MarkerInnerWindowId(data.mInnerWindowId)),
str);
}
#endif
@@ -2070,8 +2069,8 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
}
#endif
AUTO_PROFILER_MARKER_TEXT(
"RefreshDriverTick",
GRAPHICS.WithOptions(
"RefreshDriverTick", GRAPHICS,
MarkerOptions(
MarkerStack::TakeBacktrace(std::move(mRefreshTimerStartedCause)),
MarkerInnerWindowIdFromDocShell(GetDocShell(mPresContext))),
profilerStr);
@@ -2333,10 +2332,10 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
transactionId.AppendInt((uint64_t)mNextTransactionId);
}
#endif
AUTO_PROFILER_MARKER_TEXT("ViewManagerFlush",
GRAPHICS.WithOptions(MarkerStack::TakeBacktrace(
std::move(mViewManagerFlushCause))),
transactionId);
AUTO_PROFILER_MARKER_TEXT(
"ViewManagerFlush", GRAPHICS,
MarkerStack::TakeBacktrace(std::move(mViewManagerFlushCause)),
transactionId);
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();