aboutsummaryrefslogtreecommitdiff
path: root/src/perfetto_cmd/packet_writer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/perfetto_cmd/packet_writer.h')
-rw-r--r--src/perfetto_cmd/packet_writer.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/perfetto_cmd/packet_writer.h b/src/perfetto_cmd/packet_writer.h
index 11d4f2965..e42d1e937 100644
--- a/src/perfetto_cmd/packet_writer.h
+++ b/src/perfetto_cmd/packet_writer.h
@@ -22,15 +22,23 @@
#include <stdio.h>
-namespace perfetto {
+#include "perfetto/ext/tracing/core/trace_packet.h"
-class TracePacket;
+namespace perfetto {
class PacketWriter {
public:
PacketWriter();
virtual ~PacketWriter();
- virtual bool WritePackets(const std::vector<TracePacket>& packets) = 0;
+ virtual bool WritePackets(const std::vector<TracePacket>& packets) {
+ for (const TracePacket& packet : packets) {
+ if (!WritePacket(packet)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ virtual bool WritePacket(const TracePacket& packets) = 0;
};
std::unique_ptr<PacketWriter> CreateFilePacketWriter(FILE*);