Skip to content

Commit

Permalink
[Tracing w/SDK] Call Flush before tracing stop
Browse files Browse the repository at this point in the history
The asynchronous stop requires us to call Flush() explicitly because
no other flushes will happen before the stop signal.

Change-Id: I09f189f79c9e5316b0cfd5b7500aaf5a62a15aec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3955714
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#1059880}
  • Loading branch information
Mikhail Khokhlov authored and Chromium LUCI CQ committed Oct 17, 2022
1 parent ad5e011 commit eb7a9ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/tracing/public/cpp/perfetto/custom_event_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,9 @@ void CustomEventRecorder::OnTracingStopped(
}

#if BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY)
// We have to flush explicitly because we're using the asynchronous stop
// mechanism.
perfetto::TrackEvent::Flush();
std::move(stop_complete_callback).Run();
#endif // BUILDFLAG(USE_PERFETTO_CLIENT_LIBRARY)
}
Expand Down

0 comments on commit eb7a9ff

Please sign in to comment.