Record more artifact sizes during self-profiling.
This commit is contained in:
@@ -121,6 +121,19 @@ pub fn link_binary<'a, B: ArchiveBuilder<'a>>(
|
||||
if sess.opts.json_artifact_notifications {
|
||||
sess.parse_sess.span_diagnostic.emit_artifact_notification(&out_filename, "link");
|
||||
}
|
||||
|
||||
if sess.prof.enabled() {
|
||||
if let Some(artifact_name) = out_filename.file_name() {
|
||||
// Record size for self-profiling
|
||||
let file_size = std::fs::metadata(&out_filename).map(|m| m.len()).unwrap_or(0);
|
||||
|
||||
sess.prof.artifact_size(
|
||||
"linked_artifact",
|
||||
artifact_name.to_string_lossy(),
|
||||
file_size,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user