[fuchsia] Add trace flow for Flatland::Present (flutter/engine#38565)

This commit is contained in:
Emircan Uysaler
2022-12-29 15:52:09 -05:00
committed by GitHub
parent 6411e1fcc2
commit 8528d4f572
2 changed files with 8 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
#include <zircon/status.h>
#include "flutter/fml/logging.h"
#include "flutter/fml/trace_event.h"
namespace flutter_runner {
@@ -61,6 +62,10 @@ void FlatlandConnection::Present() {
// This method is called from the raster thread.
void FlatlandConnection::DoPresent() {
TRACE_DURATION("flutter", "FlatlandConnection::DoPresent");
TRACE_FLOW_BEGIN("gfx", "Flatland::Present", next_present_trace_id_);
++next_present_trace_id_;
FML_CHECK(present_credits_ > 0);
--present_credits_;

View File

@@ -81,6 +81,9 @@ class FlatlandConnection final {
uint32_t present_credits_ = 1;
bool present_pending_ = false;
// A flow event trace id for following |Flatland::Present| calls into Scenic.
uint64_t next_present_trace_id_ = 0;
// This struct contains state that is accessed from both from the UI thread
// (in AwaitVsync) and the raster thread (in OnNextFrameBegin and Present).
// You should always lock mutex_ before touching anything in this struct