Reduce binary size (1.6MB -> 600K) by removing protos/trace:lite dep
This CL removes any dependency from {traced, traced_probes, perfetto}
to //protos/trace:lite. Neither of them really require such dependency
and it causes significant binary bloat due to all the hundreds
.pb.{cc,h} generated by libprotobuf for any possible trace packet.
Specifically:
traced_probes: needs only to depend on the "zero" protos, for writing.
traced: needs the official protobuf only for the following reasons:
- Packet validation (e.g., trusted uid)
- Directly injecting some special packets (TraceConfig, uid, clocks)
Neither of them requires really the hundreds trace packets. They
can just use TrustedPacket, which doesn't pull in the other packets.
perfetto: it requires only TraceConfig, but that is a separate smaller
target.
Bug: 77316877
Test: pefetto_unittests / perfetto_integrationtests
Change-Id: I6e01b47af3313887c685ffb4614009910413bbea
diff --git a/test/end_to_end_shared_memory_fuzzer.cc b/test/end_to_end_shared_memory_fuzzer.cc
index 521fe86..450e801 100644
--- a/test/end_to_end_shared_memory_fuzzer.cc
+++ b/test/end_to_end_shared_memory_fuzzer.cc
@@ -23,8 +23,6 @@
#include "perfetto/base/utils.h"
#include "perfetto/ipc/host.h"
#include "perfetto/trace/test_event.pbzero.h"
-#include "perfetto/trace/trace_packet.pb.h"
-#include "perfetto/trace/trace_packet.pbzero.h"
#include "perfetto/traced/traced.h"
#include "perfetto/tracing/core/data_source_config.h"
#include "perfetto/tracing/core/data_source_descriptor.h"
@@ -37,6 +35,9 @@
#include "test/task_runner_thread_delegates.h"
#include "test/test_helper.h"
+#include "perfetto/trace/trace_packet.pb.h"
+#include "perfetto/trace/trace_packet.pbzero.h"
+
namespace perfetto {
namespace shm_fuzz {
@@ -163,7 +164,7 @@
auto on_readback_complete = task_runner.CreateCheckpoint("readback.complete");
auto on_consumer_data =
- [&on_readback_complete](const TracePacket::DecodedTracePacket& packet) {
+ [&on_readback_complete](const protos::TracePacket& packet) {
if (packet.for_testing().str() == "end")
on_readback_complete();
};