mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
Bug 1504347 - Add IDLE markers and AUTO_PROFILER_THREAD_SLEEP around Necko waits - r=mayhemer
IDLE markers help with categorizing threads in the profiler UI. _SLEEP makes the profiler spend less time sampling threads that haven't changed. Differential Revision: https://phabricator.services.mozilla.com/D10815 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
2bde324acf
commit
69cacfa74d
@ -576,7 +576,16 @@ nsSocketTransportService::Poll(TimeDuration *pollDuration,
|
||||
SOCKET_LOG((" timeout = %i milliseconds\n",
|
||||
PR_IntervalToMilliseconds(pollTimeout)));
|
||||
|
||||
int32_t rv = PR_Poll(pollList, pollCount, pollTimeout);
|
||||
int32_t rv = [&]() {
|
||||
if (pollTimeout != PR_INTERVAL_NO_WAIT) {
|
||||
// There will be an actual non-zero wait, let the profiler record
|
||||
// idle time and mark thread as sleeping around the polling call.
|
||||
AUTO_PROFILER_LABEL("nsSocketTransportService::Poll", IDLE);
|
||||
AUTO_PROFILER_THREAD_SLEEP;
|
||||
return PR_Poll(pollList, pollCount, pollTimeout);
|
||||
}
|
||||
return PR_Poll(pollList, pollCount, pollTimeout);
|
||||
}();
|
||||
|
||||
if (mTelemetryEnabledPref && !pollStart.IsNull()) {
|
||||
*pollDuration = TimeStamp::NowLoRes() - pollStart;
|
||||
|
@ -525,6 +525,8 @@ loopStart:
|
||||
break;
|
||||
}
|
||||
|
||||
AUTO_PROFILER_LABEL("CacheIOThread::ThreadFunc::Wait", IDLE);
|
||||
AUTO_PROFILER_THREAD_SLEEP;
|
||||
lock.Wait();
|
||||
|
||||
} while (true);
|
||||
|
Loading…
Reference in New Issue
Block a user