)]}'
{
  "commit": "e64499e71a5182d23dd01f0acab23f844c63fb80",
  "tree": "86665e4dfbeade1f6b2815f94dbc0d81e9d830ad",
  "parents": [
    "b6cf6b1a1d722d7f9ccec4c824efe0a067ca6f93"
  ],
  "author": {
    "name": "S Ashwin Balaji",
    "email": "sashwinbalaji@google.com",
    "time": "Wed Nov 04 10:01:24 2026 +0000"
  },
  "committer": {
    "name": "S Ashwin Balaji",
    "email": "sashwinbalaji@google.com",
    "time": "Wed Nov 04 11:22:01 2026 +0000"
  },
  "message": "perfetto: Prune empty TBv2 sequences without counting them\n\nTBv2 now works out which empty sequences to delete when a GC runs, so\nit no longer keeps a count of them.\n\nWe want to move sequence state out of TBv2 into its own class. The\ncount can\u0027t live in one sequence, so it would need a home outside that\nclass, and every chunk added or removed would have to keep it updated.\nThat ties each sequence to whatever holds the count. The count was only\nbest effort anyway, and each GC already had to check it again.\n\nThis changes two behaviours.\n- When a GC runs: a write starts one once the sequence map has grown\n  enough since the last GC. Before, it started one once enough\n  sequences were empty.\n  - A GC can now delete with more than 1024 empty sequences, where\n    main needed more than 1152.\n  - If a read drains 2000 active writers, main trims to 1024 on the\n    next write. This keeps them all until the map grows, so gap\n    detection and rejection of consumed recommits survive.\n- Which sequences go first: a GC deletes the least recently used empty\n  sequences. Before, it deleted the ones that became empty first. The\n  two differ only when an empty sequence is looked up again, by\n  RecordChunkV2DataLoss(), TryPatchChunkContents() or a rejected write.\n\nThe cost is that when many writers stop, their empty sequences stay in\nmemory until enough new writers arrive.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d4a5499cf493b1004c6e13075ade65a0c0ef81e5",
      "old_mode": 33188,
      "old_path": "docs/design-docs/trace-buffer.md",
      "new_id": "646fb67a5e3910bf2cd8ff5c429cb3eb4086738e",
      "new_mode": 33188,
      "new_path": "docs/design-docs/trace-buffer.md"
    },
    {
      "type": "modify",
      "old_id": "247b565a1313b37277b17ed4a2990f7dc4bb74b7",
      "old_mode": 33188,
      "old_path": "src/tracing/service/trace_buffer_v2.cc",
      "new_id": "852f2a04cd6c4d426826e725b6f4d0b20e63bb4b",
      "new_mode": 33188,
      "new_path": "src/tracing/service/trace_buffer_v2.cc"
    },
    {
      "type": "modify",
      "old_id": "ff42a2caa46e89cfb65b9c5087fb70059b0af13d",
      "old_mode": 33188,
      "old_path": "src/tracing/service/trace_buffer_v2.h",
      "new_id": "7d07893f01555f66230ef6d79ac7cbb11692e228",
      "new_mode": 33188,
      "new_path": "src/tracing/service/trace_buffer_v2.h"
    },
    {
      "type": "modify",
      "old_id": "45046930c7ae74bef76142363701c035fa337abd",
      "old_mode": 33188,
      "old_path": "src/tracing/service/trace_buffer_v2_unittest.cc",
      "new_id": "d54d27df52aca79a8753a90b8ad901797b18925a",
      "new_mode": 33188,
      "new_path": "src/tracing/service/trace_buffer_v2_unittest.cc"
    }
  ]
}
