Commit ad94f374 authored by ssid's avatar ssid Committed by Commit Bot

Fix missing events issue when startup tracing is cancelled

The threads after startup tracing is cancelled should write to trace
writer created by perfetto producer instead of startup registry. This
can be done by incrementing the session id when cancelling startup
registry.

BUG=993799

Change-Id: Ib2ad173a788dd4fe6d3fb563b761c5bc12549fb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809918
Commit-Queue: ssid <ssid@chromium.org>
Reviewed-by: default avataroysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#697408}
parent 26650a25
......@@ -361,6 +361,11 @@ void TraceEventDataSource::OnFlushFinished(
return;
}
// Increment the session id to make sure that once tracing starts the events
// are added to a new trace writer that comes from perfetto producer, instead
// of holding on to the startup registry's writers.
session_id_.fetch_add(1u, std::memory_order_relaxed);
// Clear the pending task on the tracing service thread.
DCHECK_CALLED_ON_VALID_SEQUENCE(perfetto_sequence_checker_);
base::OnceClosure task;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment