#include "src/tracing/core/trace_writer_impl.h"
#include <string.h>
#include <algorithm>
#include <type_traits>
#include <utility>
#include "perfetto/base/logging.h"
#include "perfetto/ext/base/thread_annotations.h"
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/proto_utils.h"
#include "perfetto/protozero/root_message.h"
#include "perfetto/protozero/static_buffer.h"
#include "src/tracing/core/shared_memory_arbiter_impl.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"
kMessageLengthFieldSize;
WriteRedundantVarInt;
ChunkHeader;
namespace perfetto {
namespace {
constexpr size_t kPacketHeaderSize = …;
constexpr size_t kMaxPacketsPerChunk = …;
constexpr size_t kExtraRoomForInflatedPacket = …;
uint8_t g_garbage_chunk[1024];
}
TraceWriterImpl::TraceWriterImpl(SharedMemoryArbiterImpl* shmem_arbiter,
WriterID id,
MaybeUnboundBufferID target_buffer,
BufferExhaustedPolicy buffer_exhausted_policy)
: … { … }
TraceWriterImpl::~TraceWriterImpl() { … }
void TraceWriterImpl::ReturnCompletedChunk() { … }
void TraceWriterImpl::Flush(std::function<void()> callback) { … }
TraceWriterImpl::TracePacketHandle TraceWriterImpl::NewTracePacket() { … }
protozero::ContiguousMemoryRange TraceWriterImpl::GetNewBuffer() { … }
void TraceWriterImpl::FinishTracePacket() { … }
void TraceWriterImpl::FinalizeFragmentIfRequired() { … }
uint8_t* TraceWriterImpl::AnnotatePatch(uint8_t* to_patch) { … }
void TraceWriterImpl::OnMessageFinalized(protozero::Message*) { … }
WriterID TraceWriterImpl::writer_id() const { … }
TraceWriter::TraceWriter() = default;
TraceWriter::~TraceWriter() = default;
}