profiler
profiler copied to clipboard
[deploy preview] Support categories with color: "dynamic" and determine the color based on the library / crate
For #3711.
Deploy preview Deploy preview Deploy preview
Profiles from perfrecord don't have any useful categories. They end up being entirely blue: https://share.firefox.dev/3u8RGDV
However, there are two things which we could use to add a splash of color:
- Which native library the function is from
- The hg / git repository
- For Rust code from dependencies, the package name
The latter two are only known after symbolication. So we can't embed categories for them into the original profile JSON.
In this PR I am exploring one potential solution: Make a category with a new category color called "dynamic", and then have one additional step of color resolution which takes into account the post-symbolication filename information.
With this approach, the color would become somewhat independent from the category. We could even have profiles with both meaningful categories and dynamic colors, and then make the color depend on the combination (category, bucket name). For example, in profiles with kernel stacks, we could have two categories "User" and "Kernel", with the colors "dynamic-warm" and "dynamic-cold", splitting the hue space into two halves.
Addendum: I've come to the conclusion that we should create resources in the resource table for hg repos / git repos / Rust packages. Then all of this will become a lot simpler. But it means that we will need to modify the resourceTable during symbolication.