[tracing] Add trace events for DartIsolate::HandleMessage (flutter/engine#25241)

This captures majority of the non frame related workload
happening on the UI thread.
This commit is contained in:
Kaushik Iska 2021-03-25 16:59:00 -05:00 committed by GitHub
parent 9f88f31f86
commit 6301223cee

View File

@ -445,8 +445,13 @@ void DartIsolate::SetMessageHandlingTaskRunner(
message_handling_task_runner_ = runner;
message_handler().Initialize(
[runner](std::function<void()> task) { runner->PostTask(task); });
message_handler().Initialize([runner](std::function<void()> task) {
TRACE_EVENT0("flutter", "DartIsolate::PostMessage");
runner->PostTask([task = std::move(task)]() {
TRACE_EVENT0("flutter", "DartIsolate::HandleMessage");
task();
});
});
}
// Updating thread names here does not change the underlying OS thread names.