)]}'
{
  "commit": "cd02576bfad2a205d6adbe8b9faa91871354e603",
  "tree": "dd1414dfb326841a8edea55f0d394e8a3934a85e",
  "parents": [
    "8ab086bef24031bf72b10fa49083c957616538dd"
  ],
  "author": {
    "name": "Googler",
    "email": "noreply@google.com",
    "time": "Mon Sep 21 09:10:21 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Sep 21 09:11:37 2026 -0700"
  },
  "message": "Propagate the profile changelist when MemProf comes from an fdo_profile rule.\n\n`BUILD_MEMPROF_PROFILE_CHANGELIST` is stamped as `0` for almost every\nPGHO-optimized binary in the fleet, even though the MemProf profile is applied\ncorrectly. On 2026-09-16, of the binaries reporting `pgho_type\u003dopt`, 243.0M GCUs\nacross 12,949 targets stamped `0`, versus 58.2M GCUs across 28 targets that\nstamped a real changelist.\n\nThe cause is in `_create_fdo_context`. When the MemProf profile arrives through\nan explicit `--memprof_profile`, the rule\u0027s `MemProfProfileInfo` is forwarded\nintact and keeps its `changelist`. When it instead arrives as the\n`memprof_profile` attribute of an `fdo_profile` (or `fdo_optimize`, or the\nconfigless AutoFDO `xbinary_fdo` path), a fresh `MemProfProfileInfo` was\nsynthesized from the artifact alone, dropping `changelist`. The later\n`getattr(mem_prof_profile, \"changelist\", None)` then returned `None`, so\n`get_linkstamp_stamps` skipped the define and `builddata_globals.cc` fell back\nto its `0` default.\n\nForward `FdoProfileInfo.changelist` into the synthesized `MemProfProfileInfo` in\nall three fallback branches. `fdo_profile.changelist` already defaults to `\"0\"`,\nso targets that do not set it keep the same stamped value as before; the only\nbehavioral difference for them is an explicit `-DBUILD_MEMPROF_PROFILE_CHANGELIST\u003d0`\ninstead of relying on the header default.\n\nThis only affects the recorded provenance of the profile, not which profile is\nselected or how the binary is optimized.\n\nPiperOrigin-RevId: 985317805\nChange-Id: I015d2cd31fb19e7d89d958775b72836ba255dd89\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b8789c29d837102e1c827a7200c55a7aa5aa8a18",
      "old_mode": 33188,
      "old_path": "cc/private/rules_impl/fdo/fdo_context.bzl",
      "new_id": "5da888068b74c51266059cbad0d2e03feebe8577",
      "new_mode": 33188,
      "new_path": "cc/private/rules_impl/fdo/fdo_context.bzl"
    },
    {
      "type": "modify",
      "old_id": "108ee1c243c975ead125a8855c8a03def81cf0e3",
      "old_mode": 33188,
      "old_path": "tests/cc/common/cc_linkstamp_compile_test.bzl",
      "new_id": "295cfc7f1625d5c954c7b5f61c31777b44d2c942",
      "new_mode": 33188,
      "new_path": "tests/cc/common/cc_linkstamp_compile_test.bzl"
    }
  ]
}
