From f3b2d37e7754458a14ac99cee970ede383eddc2f Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Tue, 18 Jan 2022 15:24:11 +0100 Subject: [PATCH] Record object file artifact size in self profile data --- src/driver/aot.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/driver/aot.rs b/src/driver/aot.rs index 046e4393a68d..2e047c7eea14 100644 --- a/src/driver/aot.rs +++ b/src/driver/aot.rs @@ -56,6 +56,9 @@ fn emit_module( let tmp_file = tcx.output_filenames(()).temp_path(OutputType::Object, Some(&name)); let obj = product.object.write().unwrap(); + + tcx.sess.prof.artifact_size("object_file", name.clone(), obj.len().try_into().unwrap()); + if let Err(err) = std::fs::write(&tmp_file, obj) { tcx.sess.fatal(&format!("error writing object file: {}", err)); }