Bug 1686383 - Remove misleading setTimeout lateness markers. r=smaug

These markers span the time between when a setTimeout callback was supposed to
run, and the time at which it actually run. So these markers indicate the
"lateness" of a timeout.
However, this fact is not very apparent from their appearance in the profiler.
In addition, the markers take up an enormous amount of space in the profiler
marker chart, because they are displayed on multiple rows due to overlap.

They are superseded by "setTimeout callback" markers, which only span the time
that the callback actually ran. Those markers also have a "cause" which records
the time at which the timeout was submitted, i.e. at which "setTimeout" was called.

Differential Revision: https://phabricator.services.mozilla.com/D101534
This commit is contained in:
Markus Stange 2021-01-13 22:49:47 +00:00
Родитель a8926ffa47
Коммит e6d2ba3a31
1 изменённых файлов: 0 добавлений и 24 удалений

Просмотреть файл

@ -894,30 +894,6 @@ void TimeoutManager::RunTimeout(const TimeStamp& aNow,
#endif
// This timeout is good to run.
bool timeout_was_cleared = window->RunTimeoutHandler(timeout, scx);
#if MOZ_GECKO_PROFILER
if (profiler_can_accept_markers()) {
TimeDuration elapsed = now - timeout->SubmitTime();
TimeDuration target = timeout->When() - timeout->SubmitTime();
TimeDuration delta = now - timeout->When();
TimeDuration runtime = TimeStamp::Now() - now;
nsPrintfCString marker(
"%sset%s() for %dms (original target time was %dms (%dms "
"delta)); runtime = %dms",
aProcessIdle ? "Deferred " : "",
timeout->mIsInterval ? "Interval" : "Timeout",
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);
}
#endif
MOZ_LOG(gTimeoutLog, LogLevel::Debug,
("Run%s(TimeoutManager=%p, timeout=%p) returned %d\n",
timeout->mIsInterval ? "Interval" : "Timeout", this,