Bug 1435091 - p2. Don't record markers when current thread is not actively being profiled - r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D11306

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Gerald Squelart 2018-11-19 17:40:51 +00:00
Родитель 5e9017b540
Коммит c5055b88e3
1 изменённых файлов: 4 добавлений и 4 удалений

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

@ -3719,16 +3719,16 @@ racy_profiler_add_marker(const char* aMarkerName,
{
MOZ_RELEASE_ASSERT(CorePS::Exists());
// We don't assert that RacyFeatures::IsActiveWithoutPrivacy() is true here,
// because it's possible that the result has changed since we tested it in
// the caller.
// We don't assert that RacyFeatures::IsActiveWithoutPrivacy() or
// RacyRegisteredThread::IsBeingProfiled() is true here, because it's
// possible that the result has changed since we tested it in the caller.
//
// Because of this imprecision it's possible to miss a marker or record one
// we shouldn't. Either way is not a big deal.
RacyRegisteredThread* racyRegisteredThread =
TLSRegisteredThread::RacyRegisteredThread();
if (!racyRegisteredThread) {
if (!racyRegisteredThread || !racyRegisteredThread->IsBeingProfiled()) {
return;
}