diff --git a/services/tracing/public/cpp/perfetto/custom_event_recorder.cc b/services/tracing/public/cpp/perfetto/custom_event_recorder.cc index 82618eb9abf9b8..122e86975dd152 100644 --- a/services/tracing/public/cpp/perfetto/custom_event_recorder.cc +++ b/services/tracing/public/cpp/perfetto/custom_event_recorder.cc @@ -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) }