refactor(memtrack): rename track-rmap toggle to track-physical - #526
refactor(memtrack): rename track-rmap toggle to track-physical#526not-matthias wants to merge 1 commit into
Conversation
Rename the CODSPEED_MEMTRACK_TRACK_RMAP environment variable and the TrackerOptions.rmap field to their physical-memory-oriented names (CODSPEED_MEMTRACK_TRACK_PHYSICAL / TrackerOptions.physical). Physical (resident) memory is reconstructed from the folio rmap fentry hooks, so the toggle now names the capability rather than the mechanism. Default behavior is unchanged: tracking stays opt-in (=1), since the full folio rmap hook set only exists on newer kernels and RmapSupport::detect still gates what actually attaches. The rmap mechanism layer keeps its name.
Greptile SummaryThe PR renames memtrack’s opt-in physical-memory tracking field and environment variable while retaining the existing rmap-based implementation and default-off behavior.
Confidence Score: 5/5The PR appears safe to merge with no concrete regressions identified. The renamed option remains default-off, is passed unchanged into the existing rmap implementation, and has no stale consumers in the primary or related repositories.
|
| Filename | Overview |
|---|---|
| crates/memtrack/src/ebpf/tracker.rs | Consistently renames the public option and environment-variable plumbing while preserving defaults and BPF attachment behavior. |
| crates/memtrack/tests/shared.rs | Updates the physical-memory test helper to use the renamed builder setter. |
Reviews (1): Last reviewed commit: "refactor(memtrack): rename track-rmap to..." | Re-trigger Greptile
Merging this PR will not alter performance
|
What
Renames the memtrack physical-memory tracking toggle so it names the capability rather than the underlying mechanism:
CODSPEED_MEMTRACK_TRACK_RMAP->CODSPEED_MEMTRACK_TRACK_PHYSICALTrackerOptions.rmap->TrackerOptions.physicalPhysical (resident) memory is reconstructed from the folio rmap fentry hooks, so
physicaldescribes the intent while the internal rmap mechanism layer (RmapSupport,MemtrackBpf::new_with_rmap,for_each_rmap_*, the BPF C) keeps its accurate name.Behavior
Unchanged. Tracking stays opt-in (enable with
=1); the builder default remainsfalse. The full folio rmap hook set only exists on newer kernels, andRmapSupport::detect()still gates what actually attaches per kernel — so the default is not flipped to on.Notes
rmap_only_options()test helper are updated accordingly.cargo check --tests -p memtrackpasses (crate + test targets compile). The privileged rss/c integration tests areGITHUB_ACTIONS-gated and skipped locally, so they were not executed here.Closes COD-3468