From a2f14f5c02feb294997d29b702e004fe9f389ded Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Tue, 24 Aug 2021 21:58:44 +0000 Subject: [PATCH] Bug 1716959 - Don't use lock from profiler_capture_backtrace_into - r=canaltinova `profiler_capture_backtrace_into` now only uses thread-safe functions: ThreadRegistration::WithOnThreadRefOf, Register::SyncPopulate, DoSyncSample. So we don't need to lock the main profiler mutex anymore. This means that on-thread sampling (typically used in markers) can happen at the same time the periodic sampler has locked the profiler mutex and is sampling this and other threads. Differential Revision: https://phabricator.services.mozilla.com/D122089 --- tools/profiler/core/platform.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index b81cbdd3933b..df7d3ddd83cd 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -5509,8 +5509,6 @@ bool profiler_capture_backtrace_into(ProfileChunkedBuffer& aChunkedBuffer, StackCaptureOptions aCaptureOptions) { MOZ_RELEASE_ASSERT(CorePS::Exists()); - PSAutoLock lock; - if (!profiler_is_active() || aCaptureOptions == StackCaptureOptions::NoStack) { return false;