Move declarations related to profiler threads sleeping / waking out of GeckoProfiler.h
Categories
(Core :: Gecko Profiler, task, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox100 | --- | fixed |
People
(Reporter: florian, Assigned: mozbugz)
References
Details
Attachments
(3 external files)
Currently GeckoProfiler.h is included by CondVar.h https://searchfox.org/mozilla-central/rev/8f42809e51cb07aa4f5739932a06d14581e9dd4a/xpcom/threads/CondVar.h#16 only in non-debug builds.
This causes includes of many profiler header files in lots of places where they are not really needed, and this causes confusing build errors when building debug builds. Eg. it took me a bit of time to figure out why I had build errors from clang-tidy in https://phabricator.services.mozilla.com/D139733 that I didn't have locally even when moving that cpp file to the non-unified SOURCES list in moz.build.
Seeing that this came from https://phabricator.services.mozilla.com/D96539 makes me think we should also change ReentrantMonitor.h to avoid this confusing non-debug include.
| Assignee | ||
Comment 1•4 years ago
|
||
I almost did it in recent bug 1668867 (because of CondVar.h as well), but went another way.
Yes, we could definitely move sleep/wake functions to a new stand-alone header.
| Assignee | ||
Comment 2•4 years ago
|
||
The next patch would have added yet another PROFILERxx_RAII macro, so it makes sense to gather them all into a single header file, to be #included where needed.
Updated•4 years ago
|
| Assignee | ||
Comment 3•4 years ago
|
||
Profiler sleep/wake functions/macros/classes are used in a small number of files.
By placing most of them in mozilla/ProfilerThread{Sleep,State}.h, the dependence on GeckoProfiler.h is greatly reduced.
The remaining AUTO_PROFILER_THREAD_WAKE and AutoProfilerThreadWake depend on profiler_is_sleeping() in mozilla/ProfilerThreadState.h (but are rarely used), so it makes sense to move them there instead.
Depends on D140169
| Assignee | ||
Comment 4•4 years ago
|
||
And in one case, #include "mozilla/ProfilerThreadState.h" where only AUTO_PROFILER_THREAD_WAKE is used.
Depends on D140172
Comment 6•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d0ae073e3e04
https://hg.mozilla.org/mozilla-central/rev/7bf6cba00c11
https://hg.mozilla.org/mozilla-central/rev/09dc0429a37d
Description
•