perfetto: Split COMPLETE events into BEGIN/END pairs
There are a few reasons why this is desirable: (1) Reduces need for complete event stack in ThreadLocalEventSinks, which was brittle before (e.g. crbug.com/983307). (2) Makes it possible to flush event sinks while tracing in the future without losing not-yet-completed COMPLETE events from the stack (streamed tracing use case). Events that didn't end before the flush will still be present in the trace as BEGIN only. (3) Prevents reordering of nested COMPLETE events - something which could confuse TraceProcessor in the past (events with identical begin timestamps would be imported incorrectly). To achieve this, this patch also plumbs the EXPLICIT_TIMESTAMP flag and thread id through to TraceLog::UpdateTraceEventDurationExplicit, because it seems that android can add COMPLETE events with explicit timestamps / threads [1]. [1] https://cs.chromium.org/chromium/src/base/android/early_trace_event_binding.cc?q=INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMPS&ss=chromium&l=31 Bug: 983307, 928738, 1006770 Change-Id: I66e685c04c068646d550f182185d3c45febcbfa8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899852 Commit-Queue: Eric Seckler <eseckler@chromium.org> Reviewed-by:oysteine <oysteine@chromium.org> Cr-Commit-Position: refs/heads/master@{#716871}
Showing
This diff is collapsed.
Please register or sign in to comment