about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-05-10 13:27:31 -0400
committerBen Kimock <kimockb@gmail.com>2023-05-10 13:27:31 -0400
commitf9a42139682aff545e41b9ed3566fafbafdd09f1 (patch)
tree856b5735fb6b86cbabe3fc73b049935c1bf48f4c
parent9f1624a22d9d0243be11ffee0049ae06a48639da (diff)
downloadrust-f9a42139682aff545e41b9ed3566fafbafdd09f1.tar.gz
rust-f9a42139682aff545e41b9ed3566fafbafdd09f1.zip
Explain the padding
-rw-r--r--src/tools/miri/src/machine.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs
index b91efae3bcb..32717a0d28b 100644
--- a/src/tools/miri/src/machine.rs
+++ b/src/tools/miri/src/machine.rs
@@ -508,6 +508,10 @@ impl<'mir, 'tcx> MiriMachine<'mir, 'tcx> {
                 .clone()
                 .unwrap_or_else(|| "unknown-crate".to_string());
             let pid = process::id();
+            // We adopt the same naming scheme for the profiler output that rustc uses. In rustc,
+            // the PID is padded so that the nondeterministic value of the PID does not spread
+            // nondeterminisim to the allocator. In Miri we are not aiming for such performance
+            // control, we just pad for consistency with rustc.
             let filename = format!("{crate_name}-{pid:07}");
             let path = Path::new(out).join(filename);
             measureme::Profiler::new(path).expect("Couldn't create `measureme` profiler")