tracing: route in-process SDK writers through the v2 ring - #7326
Draft
sashwinbalaji wants to merge 1 commit into
Draft
Conversation
🎨 Perfetto UI Builds
|
Add the temporary SDK-to-v2 path used to exercise the producer-local ring in a real tracing session. The consumer still receives ordinary TracePackets through the existing v1 service connection.
The temporary hop is:
SDK -> TraceWriterV2 -> v2 ring -> relay reader/rewriter
-> v1 writer -> v1 SMB -> traced
When traced reads the v2 ring directly, the relay, v1 writer and second SMB go away; the reader and rewriter move into the service ahead of the trace buffer.
- Select v2 through the C/C++ SDK initialization arguments. Keep the producer-wide option default-off, require encoding-aware data sources and leave Rust without an opt-in.
- Keep the optional implementation behind the established linker indirection so SDK binaries that do not enable it can discard it.
- Decorate ProducerEndpoint::CreateTraceWriter(). Startup writers and writers without an id remain on v1.
- Drain rings on one relay sequence. Reassemble fragments, rewrite proto groups and forward through one v1 writer per WriterID.
- Serialize endpoint controls, per-writer flushes and retirement through ring-position watermarks and downstream v1 acknowledgements.
- Preserve no_flush data-source semantics while still draining the ring before the producer acknowledges a service flush.
- Retire each downstream writer only after its last ring position has been drained and flushed.
- Complete Sync callbacks after endpoint loss instead of stranding their callers.
- Report malformed and unsupported ring chunks as data loss on the next packet instead of silently discarding them.
- Keep v1 writers and their arbiters alive through disconnect and shutdown, and release them on the relay sequence.
- Test SDK selection, routing, reassembly, barrier ordering, no_flush, data loss and teardown.
Bug: 536851377
sashwinbalaji
force-pushed
the
dev/sashwinbalaji/tracing-v2-step1-scaffolding-stack
branch
from
September 4, 2026 09:14
a942aa5 to
f0806ee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the temporary SDK-to-v2 path used to exercise the producer-local ring in a real tracing session. The consumer still receives ordinary TracePackets through the existing v1 service connection.
The temporary hop is:
When traced reads the v2 ring directly, the relay, v1 writer and second SMB go away; the reader and rewriter move into the service ahead of the trace buffer.