Skip to content

Commit f9a4213

Browse files
committed
Explain the padding
1 parent 9f1624a commit f9a4213

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/tools/miri/src/machine.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,10 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
508508
.clone()
509509
.unwrap_or_else(|| "unknown-crate".to_string());
510510
let pid = process::id();
511+
// We adopt the same naming scheme for the profiler output that rustc uses. In rustc,
512+
// the PID is padded so that the nondeterministic value of the PID does not spread
513+
// nondeterminisim to the allocator. In Miri we are not aiming for such performance
514+
// control, we just pad for consistency with rustc.
511515
let filename = format!("{crate_name}-{pid:07}");
512516
let path = Path::new(out).join(filename);
513517
measureme::Profiler::new(path).expect("Couldn't create `measureme` profiler")

0 commit comments

Comments
 (0)