trace_writer_impl: Pack length field in FinishTracePacket()
This applies the same optimization done in 6e516e800c31("protozero: Pack
length fields for short nested messages") to FinishTracePacket().
`FinishTracePacket()` is an alternative to
`protozero::Message::Finalize()` that's only used by the C shared_lib
API.
Future commits might reuse this code also for the C++ SDK, which already
has the optimization in `protozero::Message::Finalize()`.
Bug: 162206162
Change-Id: I74e7b52ba35c9f772238d175eb9a7d98e36ed859
Perfetto is a production-grade open-source stack for performance instrumentation and trace analysis. It offers services and libraries and for recording system-level and app-level traces, native + java heap profiling, a library for analyzing traces using SQL and a web-based UI to visualize and explore multi-GB traces.
See https://perfetto.dev/docs or the /docs/ directory for documentation.