Record more artifact sizes during self-profiling.
This commit is contained in:
parent
3e3890c9d4
commit
fefe1e9192
4 changed files with 73 additions and 0 deletions
|
@ -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,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue