MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / names_mapped_file

Function names_mapped_file

src/executor/memory/module_artifacts.rs:279–289  ·  view source on GitHub ↗

Whether the path still names the file that was mapped. The mapping records the inode the kernel resolved the path from; a file rebuilt or replaced since then is a different inode, and reading unwind data out of it would bind eh_frame from the wrong binary to those addresses. The current identity is read from a fresh mapping of the path rather than `stat`: overlayfs can report a per-layer pseudo

(mapping: &ProcessMapping, current: (u64, u64))

Source from the content-addressed store, hash-verified

277/// mappings carry the overlay's own device, so an unchanged file in a nested
278/// overlay would never match.
279fn names_mapped_file(mapping: &ProcessMapping, current: (u64, u64)) -> bool {
280 let recorded = (mapping.dev, mapping.ino);
281 if recorded != current {
282 debug!(
283 "{} changed since it was mapped (recorded {recorded:?}, now {current:?})",
284 mapping.path
285 );
286 return false;
287 }
288 true
289}
290
291/// A whole-file mapping of a module, with the `(dev, ino)` the kernel reports
292/// for that mapping, in the `(major << 20) | minor` encoding

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected