Closed Bug 1435091 Opened 7 years ago Closed 6 years ago

We are accumulating pending markers for threads that aren't sampled without bound, until the profiler is stopped

Categories

(Core :: Gecko Profiler, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: mstange, Assigned: mozbugz)

References

Details

Attachments

(4 files)

No description provided.
Yes we do. Luckily, the only threads that frequently add markers (GeckoMain and Compositor) are part of the default thread filter. But if I remove Compositor from the thread filter, then I can see thousands of markers pile up in the mPendingMarkers list for that thread. This is only a problem while the profiler is running; once the profiler is stopped, these markers get deleted anyway.
Priority: -- → P2
Summary: If we add a marker on a thread which does not match the thread filter, do we still hold on to the marker? → We are accumulating pending markers for threads that aren't sampled without bound, until the profiler is stopped
Working on it. My basic idea is to add RacyRegisteredThread::ShouldProfile() and only add marker when it's true (i.e., when the thread is in the filter list).
Assignee: nobody → gsquelart
profiler_thread_is_actively_profiled() should probably be used instead of profiler_is_active() when guarding a profiler_add_marker() call. Depends on D11306
(Unless there were other profiler actions, as I'm not sure yet whether it would be safe to skip them when the profiler is paused; another bug should investigate.) Depends on D11307
Attachment #9023581 - Attachment description: Bug 1435091 - RacyRegisteredThread::ShouldProfile() indicates if the thread is in the filter list - r?mstange → Bug 1435091 - p1. RacyRegisteredThread::IsBeingProfiled() - r?mstange
Attachment #9023583 - Attachment description: Bug 1435091 - Don't record markers when current thread is not in filter list - r?mstange → Bug 1435091 - p2. Don't record markers when current thread is not actively being profiled - r?mstange
Attachment #9023584 - Attachment description: Bug 1435091 - Added profiler_thread_should_be_profiled() and profiler_thread_is_actively_profiled() - r?mstange → Bug 1435091 - p3. profiler_thread_is_being_profiled() - r?mstange
Attachment #9023585 - Attachment description: Bug 1435091 - Use profiler_thread_is_actively_profiled() instead of profiler_is_active() around profiler_add_marker()s - r?mstange → Bug 1435091 - p4. Use profiler_thread_is_being_profiled() instead of profiler_is_active() around profiler_add_marker()s - r?mstange
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9096b7d003cf p1. RacyRegisteredThread::IsBeingProfiled() - r=mstange,njn https://hg.mozilla.org/integration/autoland/rev/a8d4a9012456 p2. Don't record markers when current thread is not actively being profiled - r=mstange https://hg.mozilla.org/integration/autoland/rev/46d2f807824a p3. profiler_thread_is_being_profiled() - r=mstange https://hg.mozilla.org/integration/autoland/rev/02d02cae92cd p4. Use profiler_thread_is_being_profiled() instead of profiler_is_active() around profiler_add_marker()s - r=mstange
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: