commit | 16541e7699118f38b31f8dcd64cbfabe8d72c277 | [log] [tgz] |
---|---|---|
author | Prashanth Swaminathan <prashanthsw@google.com> | Mon Jun 21 09:22:25 2021 -0700 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Jul 13 17:37:16 2021 +0000 |
tree | 2c7fcde348cb94930fb52f1113ecb47d9348b1a4 | |
parent | 2d4fa78d91e9cb9f65c0dcaebc6ebfae8350953f [diff] |
pw_ring_buffer: Add ring buffer iterator To support walking through the ring buffers in crash contexts, it's useful to have a mechanism that allows processing entries in the ring buffer without requiring buffer copies (in favor of raw access). This adds a new unsafe iteration class that can be used while the caller has a guarantee that the underlying buffer is not being mutated. The multisink is also updated to support this unsafe iteration by adding an oldest entry reader that is used as a reference point for the iterator class. This will additionally support late-drain attach flows where a drain may want to match the oldest entry available in the buffer, as opposed to the current logic that always starts it at the write index. Bug: b/190547664 Change-Id: I430bab37b47630dbdfba184ad94f818a5225f79a Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/50262 Commit-Queue: Prashanth Swaminathan <prashanthsw@google.com> Reviewed-by: Wyatt Hepler <hepler@google.com> Reviewed-by: Ewout van Bekkum <ewout@google.com>
See our website: http://pigweed.dev