Closed Bug 1785764 Opened 2 years ago Closed 2 years ago

Color of all Wr* threads should be green for easier readability

Categories

(Core :: Gecko Profiler, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: mayankleoboy1, Assigned: canova)

References

Details

Attachments

(1 file)

Example profile : https://share.firefox.dev/3AtGFja

All WR* threads should have the green color for easy discoverability/readability

Severity: -- → N/A
Priority: -- → P3

My understanding is that we need to set a category using a frame label, but this is only rust code. Can we add frame labels from rust code? Nazim, do you know?

Flags: needinfo?(canaltinova)

Yeah, we need to add some categories to WebRender codebase. We have a new label frames API for Rust that we can use for that. See: https://firefox-source-docs.mozilla.org/tools/profiler/instrumenting-rust.html#adding-stack-frame-labels

This requires analyzing the webrender codebase and finding all the functions we run through rayon. I can take a look at it when I have some time, but ideally it would be a lot better if someone who knows webrender code can take a look.

Flags: needinfo?(canaltinova)

Actually looking at the profile, it looks like the main entrance for these threads seems to be pretty much the same all the time. So we can probably easily add these. I will try to take a look at it.
As a start, it looks like these are the main entrances for some WR threads:

WRWorkerLP:
webrender_bindings::moz2d_renderer::rasterize_blob
WRRendererBackend:
webrender::renderer::init::create_webrender_instance
WRWorker:
webrender::glyph_rasterizer::GlyphRasterizer::flush_glyph_requests

Assignee: nobody → canaltinova
Status: NEW → ASSIGNED

Hmm, it turns out it's not so easy to add labels for webrender::* ones because we can't have dependencies from the mozilla_central packages in that. We are only allowed to have through webrender_bindings. But since webrender_bindings only exposes a ProfilerHooks trait, we can't really use our RAII gecko_profiler_label macro inside, since it's designed to destruct the label once it goes out of scope. So we should figure out another option for these cases.
On the other hand, it's pretty easy to add a label to webrender_bindings::moz2d_renderer::rasterize_blob. Probably I will start with only that.

While looking at the some of the Rust threads in the profiler they were always
appearing gray, which are not easy to follow/understand. Adding
Graphics::Rasterization category to these code paths allows us to show the
appropriate category for WRWorker threads. It changes the category color to
green as well which is easier to follow and understand.

See the following profiler links:
Before: https://share.firefox.dev/3egkhRC
After: https://share.firefox.dev/3cGEcca
Timeline color is different as well as the colors in the Call Tree.

See Also: → 1788865
Pushed by canaltinova@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/b97bfa3a045c
Add Graphics profiling category to some of the rasterization code paths r=gerald,gfx-reviewers,jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
See Also: → 1810122
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: