class BufferForwarder
Defined at line 15 of file ../../src/performance/trace_manager/buffer_forwarder.h
Protected Members
socket destination_
Public Methods
TransferStatus WriteMagicNumberRecord ()
Write the FxT Magic Bytes to the underlying socket.
Defined at line 14 of file ../../src/performance/trace_manager/buffer_forwarder.cc
void BufferForwarder (zx::socket destination)
Defined at line 17 of file ../../src/performance/trace_manager/buffer_forwarder.h
TransferStatus WriteProviderInfoRecord (uint32_t provider_id, const std::string & name)
Defined at line 27 of file ../../src/performance/trace_manager/buffer_forwarder.cc
TransferStatus WriteProviderSectionRecord (uint32_t provider_id)
Defined at line 42 of file ../../src/performance/trace_manager/buffer_forwarder.cc
TransferStatus Flush ()
Defined at line 44 of file ../../src/performance/trace_manager/buffer_forwarder.h
void ~BufferForwarder ()
Defined at line 45 of file ../../src/performance/trace_manager/buffer_forwarder.h
TransferStatus WriteProviderBufferOverflowEvent (uint32_t provider_id)
Defined at line 53 of file ../../src/performance/trace_manager/buffer_forwarder.cc
TransferStatus WriteChunkBy (ForwardStrategy strategy, const zx::vmo & vmo, size_t vmo_offset, size_t size)
Write the records in |buffer| at |vmo_offset| to the output. |size| is the size in bytes of the
chunk to examine, which may be more than was written if |strategy| is
`ForwardStrategy::Record`. It must always be a multiple of 8.
In oneshot mode we assume the end of written records don't look like records and we can just
run through the buffer examining records to compute how many are there. This is problematic
(without extra effort) in circular and streaming modes as records are written and rewritten.
This function handles both cases. If |strategy| is ForwardStrategy::Record then run through the
buffer computing the size of each record until we find no more records. If |strategy| is
ForwardStrategy::Size then |size| is the number of bytes to write.
Defined at line 90 of file ../../src/performance/trace_manager/buffer_forwarder.cc
Protected Methods
TransferStatus WriteBuffer (cpp20::span<const uint8_t> data)
Writes the contents of |data| to the output socket. Returns
TransferStatus::kComplete if the entire buffer has been
successfully transferred. A return value of
TransferStatus::kReceiverDead indicates that the peer was closed
during the transfer.
Defined at line 138 of file ../../src/performance/trace_manager/buffer_forwarder.cc
Enumerations
enum ForwardStrategy
| Name | Value |
|---|---|
| Size | 0 |
| Records | 1 |
Defined at line 26 of file ../../src/performance/trace_manager/buffer_forwarder.h