Skip to content

Commit a810404

Browse files
uysalereloic-sharma
authored andcommitted
[fuchsia] Add trace flow for Flatland::Present (flutter#38565)
1 parent 1747e54 commit a810404

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

shell/platform/fuchsia/flutter/flatland_connection.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <zircon/status.h>
88

99
#include "flutter/fml/logging.h"
10+
#include "flutter/fml/trace_event.h"
1011

1112
namespace flutter_runner {
1213

@@ -61,6 +62,10 @@ void FlatlandConnection::Present() {
6162

6263
// This method is called from the raster thread.
6364
void FlatlandConnection::DoPresent() {
65+
TRACE_DURATION("flutter", "FlatlandConnection::DoPresent");
66+
TRACE_FLOW_BEGIN("gfx", "Flatland::Present", next_present_trace_id_);
67+
++next_present_trace_id_;
68+
6469
FML_CHECK(present_credits_ > 0);
6570
--present_credits_;
6671

shell/platform/fuchsia/flutter/flatland_connection.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class FlatlandConnection final {
8181
uint32_t present_credits_ = 1;
8282
bool present_pending_ = false;
8383

84+
// A flow event trace id for following |Flatland::Present| calls into Scenic.
85+
uint64_t next_present_trace_id_ = 0;
86+
8487
// This struct contains state that is accessed from both from the UI thread
8588
// (in AwaitVsync) and the raster thread (in OnNextFrameBegin and Present).
8689
// You should always lock mutex_ before touching anything in this struct

0 commit comments

Comments
 (0)