Skip to content

perfetto: Add TraceBufferV3 - #7907

Open
sashwinbalaji wants to merge 1 commit into
mainfrom
dev/sashwinbalaji/05-tbv3-buffer
Open

sashwinbalaji wants to merge 1 commit into
mainfrom
dev/sashwinbalaji/05-tbv3-buffer

Conversation

@sashwinbalaji

@sashwinbalaji sashwinbalaji commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Use TBv2 staging to assemble packets into compressed bundles. Add
bundle storage, readback, sequence leases, loss reporting, cloning,
ProtoVM support and buffer statistics.

Staging owns the sequence table. Each bundle takes a lease on each of
its sequences, so pruning keeps a sequence until no bundle needs it.

Before each write, ask staging whether the write might wrap or
overwrite, and bundle first if so. This keeps the TBv2 write path
unchanged. As a result, a write that needs no new space, such as a
recommit, can also start a bundling pass when staging is full.

TBv2 gains only what staging needs, and standalone TBv2 behaviour does
not change:

  • WriteWouldWrapOrOverwrite() lets the caller ask before writing.
  • CompactChunks() also runs in kDiscard buffers, so staging can reuse
    its space. Writes stopped by StopAcceptingWrites() stay stopped.

Add the write-checkpoint interface. The service starts to use it in
the next change.

Allow late commits of already-consumed scraped chunks without a debug
failure, because bundling can consume their earlier copy.

Design: #7838

@sashwinbalaji
sashwinbalaji added this pull request to stack #7909 October 12, 2026 08:20
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🎨 Perfetto UI Builds & Tests

@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 5a411e0 to e55aadd Compare October 14, 2026 10:26
Base automatically changed from dev/sashwinbalaji/04-tbv3-buffer-interface to dev/sashwinbalaji/02-tbv2-read-gap October 14, 2026 10:26
@sashwinbalaji
sashwinbalaji removed this pull request from stack #7909 October 14, 2026 10:31
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from e55aadd to 4cf42f0 Compare October 14, 2026 11:47
@sashwinbalaji
sashwinbalaji added this pull request to stack #7974 October 14, 2026 11:48
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 4cf42f0 to 6309974 Compare October 14, 2026 12:04
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch 2 times, most recently from a6505e2 to dc6f9e1 Compare October 14, 2026 15:29
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from dc6f9e1 to f87a521 Compare October 15, 2026 16:01
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from f87a521 to cd85f4c Compare October 22, 2026 15:57
@sashwinbalaji
sashwinbalaji removed this pull request from stack #7974 October 22, 2026 15:59
@sashwinbalaji
sashwinbalaji changed the base branch from dev/sashwinbalaji/02-tbv2-read-gap to dev/sashwinbalaji/03-tbv3-foundations October 22, 2026 16:00
@sashwinbalaji
sashwinbalaji added this pull request to stack #8212 October 22, 2026 16:00
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from cd85f4c to 484b271 Compare October 22, 2026 16:19
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 484b271 to 94e0467 Compare October 26, 2026 00:18
@sashwinbalaji
sashwinbalaji marked this pull request as ready for review October 26, 2026 00:22
@sashwinbalaji
sashwinbalaji requested a review from a team as a code owner October 26, 2026 00:22
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 94e0467 to 09bbcc6 Compare October 26, 2026 11:46
@primiano

Copy link
Copy Markdown
Member

Old school review sorry. I was in a flight with no wifi.

0001-Primiano-s-review-on-dev-sashwinbalaji-05-tbv3-buffe.patch

Better to discuss in person. See commit message in the patch

@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 09bbcc6 to c57eefd Compare October 29, 2026 18:30
@sashwinbalaji
sashwinbalaji removed this pull request from stack #8212 October 30, 2026 15:28
Base automatically changed from dev/sashwinbalaji/03-tbv3-foundations to main October 30, 2026 15:52
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from c57eefd to 1e30805 Compare November 4, 2026 11:25
@sashwinbalaji
sashwinbalaji changed the base branch from main to dev/sashwinbalaji/05b-tbv3-sequence-table November 4, 2026 11:25
@sashwinbalaji
sashwinbalaji added this pull request to stack #8492 November 4, 2026 11:25
@sashwinbalaji
sashwinbalaji removed this pull request from stack #8492 November 5, 2026 09:39
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 1e30805 to 01f4146 Compare November 5, 2026 09:40
@sashwinbalaji
sashwinbalaji added this pull request to stack #8531 November 5, 2026 09:40
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch 4 times, most recently from c55f9d0 to 81e85cc Compare November 5, 2026 20:25
Base automatically changed from dev/sashwinbalaji/05b-tbv3-sequence-table to main November 5, 2026 22:28
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from 81e85cc to b0f7da7 Compare November 5, 2026 22:28
Use TBv2 staging to assemble packets into compressed bundles. Add
bundle storage, readback, sequence leases, loss reporting, cloning,
ProtoVM support and buffer statistics.

Staging owns the sequence state map. Each bundle takes a lease on each
of its sequences, so pruning keeps a sequence until no bundle needs it.

Before each write, ask staging whether the write might wrap or
overwrite, and bundle first if so. This keeps the TBv2 write path
unchanged. As a result, a write that needs no new space, such as a
recommit, can also start a bundling pass when staging is full.

TBv2 gains only what staging needs, and standalone TBv2 behaviour does
not change:
- WriteWouldWrapOrOverwrite() lets the caller ask before writing.
- CompactChunks() also runs in kDiscard buffers, so staging can reuse
  its space. Writes stopped by StopAcceptingWrites() stay stopped.

Add the write-checkpoint interface. The service starts to use it in
the next change.

Allow late commits of already-consumed scraped chunks without a debug
failure, because bundling can consume their earlier copy.
@sashwinbalaji
sashwinbalaji force-pushed the dev/sashwinbalaji/05-tbv3-buffer branch from b0f7da7 to 2d42d34 Compare November 5, 2026 22:50

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants