• Eric Seckler's avatar
    Reland "perfetto: Split COMPLETE events into BEGIN/END pairs" · 2f56155d
    Eric Seckler authored
    This is a reland of 4da16526.
    
    Relanding after the bad event nesting in v8's GC events was fixed.
    Also increases the default trace buffer size, because the traces
    with split events are slightly larger and cause some benchmarks to
    lose data otherwise. Furthermore, includes a fix for a bug that
    caused us to emit COMPLETE events as atrace events twice.
    
    Original change's description:
    > 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}
    
    Bug: 983307, 928738, 1006770
    Change-Id: I478ab4ade4bf5182d41cedb2f0b5fd22ba2e1604
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1931750
    Commit-Queue: Eric Seckler <eseckler@chromium.org>
    Reviewed-by: default avataroysteine <oysteine@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#718975}
    2f56155d
trace_log.h 22.5 KB