Closed Bug 1728056 Opened 3 years ago Closed 3 years ago

Remove lock when profiling current thread in profiler_suspend_and_sample_thread

Categories

(Core :: Gecko Profiler, task, P3)

task

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(1 file)

Remaining TODO from bug 1722261:

                // TODO: Remove this lock when on-thread sampling doesn't
                // require it anymore.
                PSAutoLock lock;

It was left for simplicity, as the lock is used in some parts of this code.
But it's only used in the "non-synchronous" code path, i.e., when sampling another thread.
So when sampling the current thread, we could avoid locking the profiler mutex.

The lock in the inner profiler_suspend_and_sample_thread function was only needed on the !aIsAsynchronous code path.
So instead, the pointer to the lock is passed in this case, otherwise nullptr indicates that we're doing an asynchronous (same-thread) sampling.

Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a14cf6b742de
Remove lock when profiling current thread in profiler_suspend_and_sample_thread - r=canaltinova
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: