Merge "Drain BPF ring buffer after disabling tracing."

This commit is contained in:
Treehugger Robot
2023-04-08 01:08:14 +00:00
committed by Gerrit Code Review

View File

@@ -99,9 +99,14 @@ bool NetworkTracePoller::Stop() {
ALOGW("Failed to disable tracing: %s", res.error().message().c_str());
}
// make sure everything in the system has actually seen the 'false' we just wrote
// Make sure everything in the system has actually seen the 'false' we just
// wrote, things should now be well and truly disabled.
synchronizeKernelRCU();
// things should now be well and truly disabled
// Drain remaining events from the ring buffer now that tracing is disabled.
// This prevents the next trace from seeing stale events and allows writing
// the last batch of events to Perfetto.
ConsumeAllLocked();
mTaskRunner.reset();
mRingBuffer.reset();