Move Profiler state-reading and labels APIs to separate headers
Categories
(Core :: Gecko Profiler, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: mozbugz, Assigned: mozbugz)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
As part of bug 1691092, we would like to add labels in add-marker functions.
This is currently not possible because label functions are in the main Base/GeckoProfiler.h headers, which include marker headers.
So we need to extract label APIs into a separate header, which can then be included by marker functions.
And this will help with bug 1681416 (splitting profiler headers).
Assignee | ||
Comment 1•3 years ago
|
||
New headers BaseProfilerLabels.h and ProfilerLabels.h now contain all label-related APIs.
These files were hg-copied from the main headers, to preserve history, and then non-label content was removed from the main headers.
The "RAII" macros were moved to these *ProfilerLabels.h headers, because that's the most-common header in which they're needed. Meta-bug 1681416 will probably move these again as needed.
Assignee | ||
Comment 2•3 years ago
|
||
There are no code changes, only #include changes.
It was a fairly mechanical process: Search for all "AUTO_PROFILER_LABEL", and in each file, if only labels are used, convert "GeckoProfiler.h" into "ProfilerLabels.h" (or just add that last one where needed).
In some files, there were also some marker calls but no other profiler-related calls, in these cases "GeckoProfiler.h" was replaced with both "ProfilerLabels.h" and "ProfilerMarkers.h", which still helps in reducing the use of the all-encompassing "GeckoProfiler.h".
Depends on D104587
Assignee | ||
Comment 3•3 years ago
|
||
Some label macros use profiler_is_active()
, so I'll add a patch to move state-reading APIs to new headers {Base,}ProfilerState.h.
And on the way this will help remove the reliance of {Base,}ProfilerMarkers.h on {Base,Gecko}Profiler.h, which in turn will help reduce the use of GeckoProfiler.h even more.
Assignee | ||
Comment 4•3 years ago
|
||
New headers BaseProfilerState.h and ProfilerState.h now contain most state-reading APIs.
These files were hg-copied from the main headers, to preserve history, and then chosen declarations were kept only in the relevant header.
This is needed in a following patch, where new headers *ProfilerLabels.h use profiler_is_active()
.
Assignee | ||
Comment 5•3 years ago
|
||
BaseProfilerMarkers.h can now rely on BaseProfilerState.h (and one function forward declaration), so it doesn't need to include BaseProfiler.h anymore.
Thanks to that, BaseProfiler.h can now include BaseProfilerMarkers.h at the top.
(And equivalent changes in ProfilerMarkers.h and GeckoProfiler.h.)
Depends on D104968
Updated•3 years ago
|
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/030dc9521157 Extract profiler state APIs into separate headers - r=florian https://hg.mozilla.org/integration/autoland/rev/fd0f61133b02 Don't include main profiler headers from markers headers - r=florian https://hg.mozilla.org/integration/autoland/rev/09027f2dc40a Extract profiler label APIs into separate headers - r=florian https://hg.mozilla.org/integration/autoland/rev/14358973739c Reduce reliance on GeckoProfiler.h when only labels (and maybe markers) are needed - r=necko-reviewers,geckoview-reviewers,sg,agi,florian
Comment 7•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/030dc9521157
https://hg.mozilla.org/mozilla-central/rev/fd0f61133b02
https://hg.mozilla.org/mozilla-central/rev/09027f2dc40a
https://hg.mozilla.org/mozilla-central/rev/14358973739c
Description
•