#include "src/tracing/service/zlib_compressor.h"
#if !PERFETTO_BUILDFLAG(PERFETTO_ZLIB)
#error "Zlib must be enabled to compile this file."
#endif
#include <zlib.h>
#include "protos/perfetto/trace/trace.pbzero.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"
namespace perfetto {
namespace {
struct Preamble { … };
template <uint32_t id>
Preamble GetPreamble(size_t sz) { … }
Slice PreambleToSlice(const Preamble& preamble) { … }
class ZlibPacketCompressor { … };
ZlibPacketCompressor::ZlibPacketCompressor() { … }
ZlibPacketCompressor::~ZlibPacketCompressor() { … }
void ZlibPacketCompressor::PushPacket(const TracePacket& packet) { … }
void ZlibPacketCompressor::PushData(const void* data, uint32_t size) { … }
TracePacket ZlibPacketCompressor::Finish() { … }
void ZlibPacketCompressor::NewOutputSlice() { … }
void ZlibPacketCompressor::PushCurSlice() { … }
}
void ZlibCompressFn(std::vector<TracePacket>* packets) { … }
}