perfetto: further cleanup and consolidate test code

With the introduction of test helper, integration tests have already been made much cleaner.
Now the next step is to take this further and reduce coupling between producer
service and consumer. We can do this by making the producer emit data without
the test explicitly requesting it (like ftrace) if a flag in config is enabled.

Moreover, we can also consolidate all checkpointing code inside the helper class instead
of every file defining its own.

Bug: 74380167
Change-Id: Idbe24586a4aaadb17f934f6e06c5c6d378be0ec3
diff --git a/src/tracing/core/test_config.cc b/src/tracing/core/test_config.cc
index d58cbce..6aa26ab 100644
--- a/src/tracing/core/test_config.cc
+++ b/src/tracing/core/test_config.cc
@@ -55,6 +55,12 @@
   static_assert(sizeof(message_size_) == sizeof(proto.message_size()),
                 "size mismatch");
   message_size_ = static_cast<decltype(message_size_)>(proto.message_size());
+
+  static_assert(
+      sizeof(send_batch_on_register_) == sizeof(proto.send_batch_on_register()),
+      "size mismatch");
+  send_batch_on_register_ = static_cast<decltype(send_batch_on_register_)>(
+      proto.send_batch_on_register());
   unknown_fields_ = proto.unknown_fields();
 }
 
@@ -80,6 +86,13 @@
                 "size mismatch");
   proto->set_message_size(
       static_cast<decltype(proto->message_size())>(message_size_));
+
+  static_assert(sizeof(send_batch_on_register_) ==
+                    sizeof(proto->send_batch_on_register()),
+                "size mismatch");
+  proto->set_send_batch_on_register(
+      static_cast<decltype(proto->send_batch_on_register())>(
+          send_batch_on_register_));
   *(proto->mutable_unknown_fields()) = unknown_fields_;
 }