)]}'
{
  "commit": "063635c0a1237777470cbebae71ce6ac9df6294b",
  "tree": "ac800e7260647c3c3ffb93a27dad004ab083063d",
  "parents": [
    "fb15418c3ccb380cfaf9220e7cdbfa1929289736"
  ],
  "author": {
    "name": "Aditya Gupta",
    "email": "adigupt@google.com",
    "time": "Mon Nov 02 16:46:24 2026 +0000"
  },
  "committer": {
    "name": "Aditya Gupta",
    "email": "adigupt@google.com",
    "time": "Tue Nov 03 15:56:24 2026 +0000"
  },
  "message": "tp: stdlib: let android.cujs consume CUJs with typed vsync args and cross-process frames\n\nGeneralise the android.cujs stdlib so that a CUJ producer which cannot emit\nthe Android-framework style dynamic instant markers\n(`J\u003cX\u003e#FT#beginVsync#\u003cid\u003e`, `#FT#endVsync#\u003cid\u003e`, `#FT#end#0`, `#FT#cancel#0`)\nand whose frames are produced by a different process than the one emitting\nthe `J\u003cX\u003e` slice can still be analysed by android_jank_cuj and friends.\n\nThe first such producer is Chrome, which (crrev.com/c/8705993 and follow-ups)\nemits a `J\u003cWebContentsScroll\u003e` TrackEvent slice in the renderer process with\n`ChromeTrackEvent.android_cuj_metrics.{begin_vsync_id,end_vsync_id,canceled}`\nas typed args, while the SurfaceFlinger frame timeline for the scroll belongs\nto the GPU process (`com.android.chrome:privileged_process0`). Nothing in the\nstdlib is Chrome-specific though; any process emitting the same shape of data\nis handled identically.\n\nChanges (all additive, existing paths unchanged):\n\n* base.sql\n  - New `_cuj_typed_args`: reads `android_cuj_metrics.begin_vsync_id`,\n    `end_vsync_id` and `canceled` from the CUJ slice\u0027s arg set.\n  - `_cuj_instant_events.begin_vsync/end_vsync`: `coalesce(typed arg,\n    FT# marker)` - typed args win when present, otherwise identical to before.\n  - New `_android_jank_cuj_state(cuj_id)`: typed `canceled` (1/0) first, then\n    the existing FT#cancel / FT#end marker logic. Used by `android_jank_cuj`\n    and `android_jank_cuj_slice_summary` instead of two inline copies.\n  - Layer resolution split into `_android_jank_cuj_hwui_layer_name` (the\n    existing explicit-marker / single-layer inference, unchanged) and a new\n    Tier-3 `_android_jank_cuj_frame_timeline_layer`. Tier 3 only applies to\n    CUJs that carry explicit begin/end vsync ids AND have no HWUI frames\n    (`_all_frames_in_cuj` empty), so anything resolved by Tier 1/2 is never\n    touched. It picks the `actual_frame_timeline_slice` layer, owned by the\n    CUJ process or a sibling process of the same package (name up to \u0027:\u0027),\n    that presented at both the begin and the end vsync; ties prefer the own\n    process, then most frames in range. It also returns the owning\n    `timeline_upid`. Public `android_jank_cuj_layer_name` (schema unchanged)\n    is the union of both.\n\n* boundaries.sql\n  - `_android_jank_cuj_vsync_boundary`: CUJs are included if they have\n    `Choreographer#doFrame`s (as before) OR a Tier-3 resolved layer. For the\n    latter `upid` is the layer-owning process so that the downstream\n    `expected/actual_frame_timeline_slice` joins (which key on\n    `boundary.upid`) attribute frames to the right process. Column set is\n    unchanged (metrics/sql/android/jank/cujs_boundaries.sql does SELECT *).\n\n* frames.sql\n  - `android_jank_cuj_slice_summary.state` uses `_android_jank_cuj_state`.\n\n* protos/third_party/chromium/chrome_track_event.proto\n  - Mirror of crrev.com/c/8705993 (`AndroidCujMetrics`, field 1087). Copybara\n    will import the identical hunk from Chromium; included here so the diff\n    test can decode the typed args.\n\nBehavioural impact on existing traces:\n  - CUJs without the typed args and with doFrames: byte-identical output\n    (verified on a SystemUI trace with BACK_PANEL_ARROW CUJs and a Gmail\n    trace with ThreadListScroll/ThreadListSwipe, plus all 50 existing\n    CUJ/Jank diff tests).\n  - The one intentional change: a marker-only CUJ that has explicit\n    beginVsync/endVsync markers but no HWUI frames at all previously got no\n    boundary/frames; it can now get them if exactly one same-package\n    frame-timeline layer spans its vsync range. CUJs without explicit vsync\n    bounds are unaffected (Tier 3 requires both).\n\nTests: new ChromeCujs diff-test suite with a synthetic trace\n(chrome_web_contents_scroll_cuj.py): renderer-emitted J\u003cWebContentsScroll\u003e\nslices with typed args (one completed, one canceled), GPU-process frame\ntimeline with one app-missed frame, and distractor frames from the browser\nprocess and SystemUI at overlapping vsyncs. Covers android_jank_cuj, state,\nboundary + layer, slice summary and per-frame attribution.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "31e3f6f8fe0c351bf6a340616ff083814f46affc",
      "old_mode": 33188,
      "old_path": "protos/third_party/chromium/chrome_track_event.proto",
      "new_id": "7468fefe76c7f49d76c1ef70f6b45778023c23c8",
      "new_mode": 33188,
      "new_path": "protos/third_party/chromium/chrome_track_event.proto"
    },
    {
      "type": "modify",
      "old_id": "d76f866d662f40ef78dfa81a009eec671f62327c",
      "old_mode": 33188,
      "old_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/base.sql",
      "new_id": "df8ebf01d183a5dcfc4d94fb55179e1718f658b4",
      "new_mode": 33188,
      "new_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/base.sql"
    },
    {
      "type": "modify",
      "old_id": "947a0f519d401d4fcaff8c74b37ae72d4e0ce2d6",
      "old_mode": 33188,
      "old_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/boundaries.sql",
      "new_id": "f1effa62d3f101545e2d6dbe0b4edf908bf34186",
      "new_mode": 33188,
      "new_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/boundaries.sql"
    },
    {
      "type": "modify",
      "old_id": "e0ed4409cf3d305fc999334dca0f8585840a7cad",
      "old_mode": 33188,
      "old_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/frames.sql",
      "new_id": "7cd440565ad06ead55f93f84d4c2c58f2a3371be",
      "new_mode": 33188,
      "new_path": "src/trace_processor/perfetto_sql/stdlib/android/cujs/frames.sql"
    },
    {
      "type": "modify",
      "old_id": "f9aa4476c119bb3380787d87ff8f19912bc7fb23",
      "old_mode": 33188,
      "old_path": "test/trace_processor/diff_tests/include_index.py",
      "new_id": "b39a9890599d6530af17374f873c38ab2f6d2e68",
      "new_mode": 33188,
      "new_path": "test/trace_processor/diff_tests/include_index.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "f7b1a89d7e9d4b3a75a01ba5dbe198124906648d",
      "new_mode": 33188,
      "new_path": "test/trace_processor/diff_tests/stdlib/android/chrome_cujs_tests.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4dd73011a6dee09d9a1180ffbf36f2f6e267acb7",
      "new_mode": 33188,
      "new_path": "test/trace_processor/diff_tests/stdlib/android/chrome_web_contents_scroll_cuj.py"
    }
  ]
}
