Skip to content

Commit

Permalink
[tracing] Force a packet past-the-end of "File" async events.
Browse files Browse the repository at this point in the history
Same as https://chromium-review.googlesource.com/c/chromium/src/+/3064300
but for async "File" events. Since this is an async event, there's no
higher level event englobing multiple File events like a running
thread did for tasks, so we have to emit it for each one here.

See https://crbug.com/1021571#c28 for screenshot of issue.

FileTracingProviderImpl::FileTracingDisable() called from
FileTracing::~ScopedEnabler() marks the end of the top-level events
on that async track.

Bug: 1021571
Change-Id: I92b0ed4629bf8d5159af19d1c2902ca45db04f64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3212886
Commit-Queue: Eric Seckler <[email protected]>
Auto-Submit: Gabriel Charette <[email protected]>
Reviewed-by: Eric Seckler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#929664}
  • Loading branch information
Gabriel Charette authored and Chromium LUCI CQ committed Oct 8, 2021
1 parent ff0ce8a commit 4140559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/files/file_tracing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "base/atomicops.h"
#include "base/files/file.h"
#include "base/trace_event/base_tracing.h"

using base::subtle::AtomicWord;

Expand Down Expand Up @@ -42,6 +43,8 @@ FileTracing::ScopedEnabler::~ScopedEnabler() {
FileTracing::Provider* provider = GetProvider();
if (provider)
provider->FileTracingDisable(this);
// TODO(crbug.com/1021571): Remove this once fixed.
PERFETTO_INTERNAL_ADD_EMPTY_EVENT();
}

FileTracing::ScopedTrace::~ScopedTrace() {
Expand Down

0 comments on commit 4140559

Please sign in to comment.