)]}'
{
  "commit": "d61f4ced1badd0a50e51549c7614f37be42691a0",
  "tree": "3ff1e8d21bfa81f4181515538c841a8329e5f6b0",
  "parents": [
    "df65cacf93ad9fd1d8d3a4d943381e84c9831e4a"
  ],
  "author": {
    "name": "S Ashwin Balaji",
    "email": "sashwinbalaji@google.com",
    "time": "Tue Aug 18 02:36:26 2026 +0100"
  },
  "committer": {
    "name": "S Ashwin Balaji",
    "email": "sashwinbalaji@google.com",
    "time": "Tue Aug 18 17:55:32 2026 +0100"
  },
  "message": "tracing: add append-only proto encoding for v2 writers\n\nProtozero backfills a nested message\u0027s four-byte length when the message\ncloses. That is illegal on the v2 ring, where the bytes in front of it\nmay already have been taken by the reader. This adds a second\nnested-message framing that never writes a length ahead of its payload,\nand the pass that turns it back into ordinary protobuf.\n\n- The framing opens a nested field with varint((f \u003c\u003c 3) | 3) and closes\n  it with the bare byte 0x04. The terminator carries no field id, so\n  this is not group encoding and a field-numbered end-group tag is\n  rejected. A root emits neither wrapper nor terminator.\n- protozero::NestedMessageEncoding is chosen once at Reset() and\n  inherited by every child. The two-argument Reset() stays the default\n  and stays out-of-line, so the exported symbol still resolves for\n  anything already linked. A value outside the enum is rejected there.\n- The C runtime emits the same bytes. struct PerfettoPbMsg keeps its\n  public layout by putting the mode and finalized bits in the top two\n  bits of `size`. They are set only in the new mode, so `size` on the\n  existing path is what it always was, before and after Finalize().\n- Both C ABI boundaries abort on an encoding they do not recognise\n  rather than guessing v1 framing, and the legacy packet factory CHECKs\n  that the root is length-delimited.\n- RewriteToLengthDelimitedProto() converts a reassembled packet back,\n  with bounds checks and a cleared output on every failure: these bytes\n  become untrusted input once the consumer moves into traced.\n- TraceWriterV2 gives protozero one fragment at a time. When a packet\n  outgrows its chunk it publishes with \"continues on next chunk\",\n  notifies the delegate, and only then asks for the next chunk; it also\n  notifies when an acquisition burned positions. Both matter for a\n  packet larger than the ring, where nothing else gives the reader a\n  reason to run before the writer needs the capacity back.\n\nNot wired up: no bridge, no muxer, no flag.\n\nTests: exact byte vectors for both modes in C++ and C, C/C++ parity, the\npublic struct\u0027s layout and raw `size` against a legacy mirror, a death\ntest for an unknown encoding, the rewriter\u0027s rejection cases, and\nTraceWriterV2 through the ring and the rewriter - including a packet\nseveral times larger than the whole ring and a stalling writer\nrecovering from chunks it could not claim.\n\nBug: 536851377\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8e4bc4a3f34de6280e82d38c170fe5bca59bf537",
      "old_mode": 33188,
      "old_path": "Android.bp",
      "new_id": "b0add79d0bed1717620fc21b0b96f58d73622fb4",
      "new_mode": 33188,
      "new_path": "Android.bp"
    },
    {
      "type": "modify",
      "old_id": "de56e67a87e3523578830f8edf954961225ad71d",
      "old_mode": 33188,
      "old_path": "gn/perfetto_unittests.gni",
      "new_id": "721ea2aca6996d50211c11f48ad24ef516f4fe23",
      "new_mode": 33188,
      "new_path": "gn/perfetto_unittests.gni"
    },
    {
      "type": "modify",
      "old_id": "1bcadaf688bf3e02587a362567b358b4a6ddd08b",
      "old_mode": 33188,
      "old_path": "include/perfetto/protozero/message.h",
      "new_id": "d9ba0e89c6ffb2d1fad4d8e09dc16c54dd7f4b45",
      "new_mode": 33188,
      "new_path": "include/perfetto/protozero/message.h"
    },
    {
      "type": "modify",
      "old_id": "ce8b24e279c68df1e1fce8380480c4a5eb3cdde1",
      "old_mode": 33188,
      "old_path": "include/perfetto/protozero/proto_utils.h",
      "new_id": "cbc71c92071656c313225a99bb964ccc90dc1e11",
      "new_mode": 33188,
      "new_path": "include/perfetto/protozero/proto_utils.h"
    },
    {
      "type": "modify",
      "old_id": "40e232896def55c9a91d87edaa570ceae3a92428",
      "old_mode": 33188,
      "old_path": "include/perfetto/protozero/root_message.h",
      "new_id": "cfb90f71080c3efe64436add64569d6dbee4c179",
      "new_mode": 33188,
      "new_path": "include/perfetto/protozero/root_message.h"
    },
    {
      "type": "modify",
      "old_id": "2f790b2148eba6612cdf4c6dcb4c31e586d81656",
      "old_mode": 33188,
      "old_path": "include/perfetto/protozero/scattered_heap_buffer.h",
      "new_id": "6937858f853c26635b37299dfe745cbcc52f3d38",
      "new_mode": 33188,
      "new_path": "include/perfetto/protozero/scattered_heap_buffer.h"
    },
    {
      "type": "modify",
      "old_id": "17df6f7041818ab7208f23101af8e415ccfb26da",
      "old_mode": 33188,
      "old_path": "include/perfetto/public/abi/data_source_abi.h",
      "new_id": "4e563f67f18c4e1e238dbc9660b676217b2834b1",
      "new_mode": 33188,
      "new_path": "include/perfetto/public/abi/data_source_abi.h"
    },
    {
      "type": "modify",
      "old_id": "8f163d2d2bebeb39e2abd4d05e6b9d769d6f7a60",
      "old_mode": 33188,
      "old_path": "include/perfetto/public/data_source.h",
      "new_id": "dd8af120b42bd70307e8bddcad5acb998c00fa74",
      "new_mode": 33188,
      "new_path": "include/perfetto/public/data_source.h"
    },
    {
      "type": "modify",
      "old_id": "717a080d974c12f400905bfbc42b323510cc0823",
      "old_mode": 33188,
      "old_path": "include/perfetto/public/pb_msg.h",
      "new_id": "336e8117db285a5df7a55acbe4e21acd96c4f282",
      "new_mode": 33188,
      "new_path": "include/perfetto/public/pb_msg.h"
    },
    {
      "type": "modify",
      "old_id": "7e7a83bdc23ebc88f6882b3b47b486576f74bb2c",
      "old_mode": 33188,
      "old_path": "include/perfetto/public/pb_utils.h",
      "new_id": "26dbe2d5fc5a79657d2c498f59f0bc02d1d66e6f",
      "new_mode": 33188,
      "new_path": "include/perfetto/public/pb_utils.h"
    },
    {
      "type": "modify",
      "old_id": "074e306144392ea2ecd02ba2d53efd0cbdee5f81",
      "old_mode": 33188,
      "old_path": "include/perfetto/public/track_event.h",
      "new_id": "66ef210fdcc9675a2e72f1160f88d93509e7be2a",
      "new_mode": 33188,
      "new_path": "include/perfetto/public/track_event.h"
    },
    {
      "type": "modify",
      "old_id": "562438b0fa0420f669fb248b6955ce29d5e9d6bb",
      "old_mode": 33188,
      "old_path": "src/protozero/message.cc",
      "new_id": "815a8cfa9bc6ad6ae0e2bf10fe448167caa4b56b",
      "new_mode": 33188,
      "new_path": "src/protozero/message.cc"
    },
    {
      "type": "modify",
      "old_id": "0ded04af30d903305f1351e5a0bdebfd6ce01c5d",
      "old_mode": 33188,
      "old_path": "src/protozero/message_unittest.cc",
      "new_id": "bac5896ea3da1d7017ed38e2aac2bb0bf48d2720",
      "new_mode": 33188,
      "new_path": "src/protozero/message_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "da67cdebcc16c135864102552b84769ddd6af1b4",
      "old_mode": 33188,
      "old_path": "src/shared_lib/BUILD.gn",
      "new_id": "b515452852e170b0983a2dda548a116d7395f4d1",
      "new_mode": 33188,
      "new_path": "src/shared_lib/BUILD.gn"
    },
    {
      "type": "modify",
      "old_id": "69a93848f33a790642a995f8159f1961fab40717",
      "old_mode": 33188,
      "old_path": "src/shared_lib/data_source.cc",
      "new_id": "4f03486b604beef688f1e8839d56b28a52e7124d",
      "new_mode": 33188,
      "new_path": "src/shared_lib/data_source.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "ede437d2c48a289dcbc49d886c411db754f5d76d",
      "new_mode": 33188,
      "new_path": "src/shared_lib/pb_msg_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "02ee009ea5309c8be58a6c99cf879425a646b3f1",
      "old_mode": 33188,
      "old_path": "src/tracing/v2/BUILD.gn",
      "new_id": "a52bac91f97376aeb68f39f269a1ce49f75c0020",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/BUILD.gn"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3f7408b09baf217f0a7c5755151a3dd758ae88e4",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/proto_rewriter.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "65ca42585ce4cd65ac51446d27f4225f35441fa7",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/proto_rewriter.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "c97ce1ea2aec92e78c168df81fcb758032f9752d",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/proto_rewriter_unittest.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "844213a3be489ba2b5e469a47a4745315d727b9f",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/trace_writer_v2.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5382c9e93d37444ab03a75b657ae43bcec13a473",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/trace_writer_v2.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "8aa61985e2e383348a244c87c1a6abb575017588",
      "new_mode": 33188,
      "new_path": "src/tracing/v2/trace_writer_v2_unittest.cc"
    }
  ]
}
