profiler icon indicating copy to clipboard operation
profiler copied to clipboard

Stop treating "GeckoMain" threads specially and replace the name-based detection with an `isMainThread` or `isPrimaryThread` field

Open mstange opened this issue 4 years ago • 3 comments

In some places we treat threads specially when they have the name "GeckoMain": These threads become the thread of a globalTrack, and they get a marker track shown for them. Similar treatment can benefit threads from non-Gecko sources, too, so this should be based on a field, not on the thread name. I'm not sure whether isMainThread or isPrimaryThread would be the better name. For example, in GeckoView, the "GeckoMain" thread is not actually the true main thread of the process; instead, the Java UI thread is the actual main thread. But we still want to treat the GeckoMain thread as the primary thread in the globalTrack.

mstange avatar Apr 20 '20 17:04 mstange

Let's just call the property isMainThread.

So the tasks for this bug are:

  • Add an isMainThread field to Thread.
  • In profile processing, detect GeckoMain threads and set this field on them.
  • Add a profile upgrader for the processed format.
  • In various places that check for the string GeckoMain, use the isMainThread field instead.
  • Take advantage of the new field in various importers like the Chrome importer.

mstange avatar Jun 08 '22 18:06 mstange

Hello @mstange , still working on this?

aashu avatar Aug 31 '22 19:08 aashu

I have a branch laying around...

parttimenerd avatar Sep 16 '22 12:09 parttimenerd