Bug 1752861 - [profiler] Rename and expose to JS some existing frame labels as well as adding a few r=mstange

Differential Revision: https://phabricator.services.mozilla.com/D140389
This commit is contained in:
Julien Wajsberg 2022-03-11 09:18:30 +00:00
Родитель 94fa561963
Коммит 830ac30ee4
6 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -171,7 +171,7 @@ LexerResult Decoder::Decode(IResumable* aOnResume /* = nullptr */) {
LexerResult lexerResult(TerminalState::FAILURE);
{
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_ImageDecoding);
AUTO_PROFILER_LABEL_CATEGORY_PAIR_RELEVANT_FOR_JS(GRAPHICS_ImageDecoding);
AutoRecordDecoderTelemetry telemetry(this);
lexerResult = DoDecode(*mIterator, aOnResume);

Просмотреть файл

@ -6257,7 +6257,7 @@ void PresShell::PaintInternal(nsView* aViewToPaint, PaintInternalFlags aFlags) {
uri = contentRoot->GetDocumentURI();
}
url = uri ? uri->GetSpecOrDefault() : "N/A"_ns;
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("PresShell::Paint", GRAPHICS, url);
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING_RELEVANT_FOR_JS("Paint", GRAPHICS, url);
Maybe<js::AutoAssertNoContentJS> nojs;
@ -9417,7 +9417,7 @@ bool PresShell::ScheduleReflowOffTimer() {
bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible,
OverflowChangedTracker* aOverflowTracker) {
[[maybe_unused]] nsIURI* uri = mDocument->GetDocumentURI();
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING(
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING_RELEVANT_FOR_JS(
"Reflow", LAYOUT_Reflow, uri ? uri->GetSpecOrDefault() : "N/A"_ns);
LAYOUT_TELEMETRY_RECORD_BASE(Reflow);

Просмотреть файл

@ -3171,6 +3171,7 @@ static void VerifyFlatTree(const nsIContent& aContent) {
#endif
void RestyleManager::ProcessPendingRestyles() {
AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Styles", LAYOUT);
#ifdef DEBUG
if (auto* root = mPresContext->Document()->GetRootElement()) {
VerifyFlatTree(*root);

Просмотреть файл

@ -1982,6 +1982,8 @@ void nsRefreshDriver::RunFullscreenSteps() {
}
void nsRefreshDriver::UpdateIntersectionObservations(TimeStamp aNowTime) {
AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Compute intersections", LAYOUT);
AutoTArray<RefPtr<Document>, 32> documents;
if (mPresContext->Document()->HasIntersectionObservers()) {
@ -2268,7 +2270,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime,
UpdateThrottledState();
}
AUTO_PROFILER_LABEL("nsRefreshDriver::Tick", LAYOUT);
AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("RefreshDriver tick", LAYOUT);
nsAutoCString profilerStr;
if (profiler_thread_is_being_profiled_for_markers()) {

Просмотреть файл

@ -1542,7 +1542,7 @@ Loader::Completed Loader::ParseSheet(const nsACString& aBytes,
if (aLoadData.mURI) {
LOG_URI(" Load succeeded for URI: '%s', parsing", aLoadData.mURI);
}
AUTO_PROFILER_LABEL("css::Loader::ParseSheet", LAYOUT_CSSParsing);
AUTO_PROFILER_LABEL_CATEGORY_PAIR_RELEVANT_FOR_JS(LAYOUT_CSSParsing);
++mParsedSheetCount;

Просмотреть файл

@ -1214,6 +1214,7 @@ already_AddRefed<ComputedStyle> ServoStyleSet::ResolveForDeclarations(
}
void ServoStyleSet::UpdateStylist() {
AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Update stylesheet information", LAYOUT);
MOZ_ASSERT(StylistNeedsUpdate());
if (mStylistState & StylistState::StyleSheetsDirty) {