flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.58k stars 326 forks source link

Timeline doesn't show descheduled time #3454

Open Hixie opened 3 years ago

Hixie commented 3 years ago

Sometimes, a thread spends 15ms of wall-clock time doing something, but only 1ms of CPU time. This represents 14ms where the CPU was busy doing something else. Other timeline viewers typically show this as a bar with a length of 15ms but where the trailing 14ms of the bar are partly faded out to indicate that the thread was descheduled.

kenzieschmoll commented 2 years ago

Duplicate issue: https://github.com/flutter/devtools/issues/778

dnfield commented 2 years ago

From a linked issue, developer reported a randomly long timeline event. In devtools, it was impossible to tell that this was due to descheduling, whereas in observatory it was obvious:

timeline

Particularly bad because the descheduled time was very long (almost 80ms).

kenzieschmoll commented 2 years ago

Which part of this is thread descheduled time? Is it the more opaque portion of the timeline event?

dnfield commented 2 years ago

The more opaque part is scheduled time - the more transparent part is descheduled.

One missing part here that perfetto has is showing you which parts of the event were descheduled, but I don't think we get that in the JSON format that the VM emits.

Hixie commented 2 years ago

Oh man if we knew which part was descheduled that would be fantastic.

dnfield commented 2 years ago

Perfetto/systrace can show that on Android.

kenzieschmoll commented 2 months ago

@derekxu16 do you know if thread descheduling information is something that we can get (or something that we already have access to) with the perfetto recorder in the VM?

derekxu16 commented 2 months ago

This functionality is not part of Observatory anymore either, because we stopped recording the "scheduled time" of events in https://github.com/dart-lang/sdk/commit/08634ec4ee3efb2b574d8da22bae58ead0d5be62 for performance reasons.