Add some categories to the Java stack
Categories
(Core :: Gecko Profiler, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox77 | --- | fixed |
People
(Reporter: canova, Assigned: mstange)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Currently we don't have a way to annotate java stack to add the categories. We are using label frames for that in the profiler. There could be 2 possible implementation
- Adding label frames for Java. But it requires adding a stack merging step, and it's not quite fast easy/fast.
- We could deduce the categories from the function names. That would be the easier implementation. Also we already have something like this for idle category
There is also another issue which Markus mentioned on the Matrix channel:
the big problem to having useful categories in Java code is the fact that a totally different set of categories would be useful for Java code
e.g. there's no "Layout" or "JS" or "GC" running on the Java thread
but there's "Mozilla" vs "Android" vs "Java language" code running
we only have one list of categories for the entire profile, and a limited set of category colors
in theory, we could just add the new Java categories to the central category list and then have duplicated colors, and then Gecko threads only use one half of the list and Java threads use the other half
it might be a bit misleading that different colors in the activity graph have different meanings depending on what thread you're looking at
Comment 1•5 years ago
|
||
Would it make sense to re-use colors from the Android Studio? They might already be familiar to some engineers.
Reporter | ||
Comment 2•5 years ago
|
||
Yeah, that sounds good to me!
Assignee | ||
Comment 3•5 years ago
|
||
I basically implemented this in the Android trace importer PR so I'm just going to port that implementation to CollectJavaThreadProfileData
.
Example profile from the Android trace importer: https://perfht.ml/2IGD6KG
I followed the colors from Android studio to some extent: org.mozilla.* / mozilla.* is green, sun.* / java.* is blue, androidx.* is orange.
I also added some other colors; I split out android.* into a separate yellow category, kotlin.* / kotlinx.* into a purple category, and I added a special "Blocking" category in light blue for java.lang.Object.wait.
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
(I'm still waiting for this patch to finish compiling. I will post a profile once I have an Android build.)
Assignee | ||
Comment 6•5 years ago
|
||
Here's a profile from GeckoView-example: https://perfht.ml/2VimhNo
Assignee | ||
Comment 7•5 years ago
|
||
Here's a profile from a (debug) Fenix: https://perfht.ml/3csNW48
Comment 9•5 years ago
|
||
bugherder |
Description
•