diff options
| author | Ben Kimock <kimockb@gmail.com> | 2023-05-10 13:27:31 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2023-05-10 13:27:31 -0400 |
| commit | f9a42139682aff545e41b9ed3566fafbafdd09f1 (patch) | |
| tree | 856b5735fb6b86cbabe3fc73b049935c1bf48f4c | |
| parent | 9f1624a22d9d0243be11ffee0049ae06a48639da (diff) | |
| download | rust-f9a42139682aff545e41b9ed3566fafbafdd09f1.tar.gz rust-f9a42139682aff545e41b9ed3566fafbafdd09f1.zip | |
Explain the padding
| -rw-r--r-- | src/tools/miri/src/machine.rs | 4 |
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") |
