Always collect memory usage info in analysis-stats

This commit is contained in:
Laurențiu Nicola 2023-08-15 17:35:29 +03:00
parent d548146c30
commit 4c67becd44
4 changed files with 11 additions and 24 deletions

View file

@ -235,9 +235,7 @@ impl flags::AnalysisStats {
if let Some(instructions) = total_span.instructions {
report_metric("total instructions", instructions, "#instr");
}
if let Some(memory) = total_span.memory {
report_metric("total memory", memory.allocated.megabytes() as u64, "MB");
}
report_metric("total memory", total_span.memory.allocated.megabytes() as u64, "MB");
if env::var("RA_COUNT").is_ok() {
eprintln!("{}", profile::countme::get_all());
@ -257,7 +255,7 @@ impl flags::AnalysisStats {
eprintln!("source files: {total_file_size}, macro files: {total_macro_file_size}");
}
if self.memory_usage && verbosity.is_verbose() {
if verbosity.is_verbose() {
print_memory_usage(host, vfs);
}
@ -814,7 +812,7 @@ impl flags::AnalysisStats {
}
fn stop_watch(&self) -> StopWatch {
StopWatch::start().memory(self.memory_usage)
StopWatch::start()
}
}

View file

@ -62,8 +62,6 @@ xflags::xflags! {
optional --randomize
/// Run type inference in parallel.
optional --parallel
/// Collect memory usage statistics.
optional --memory-usage
/// Print the total length of all source and macro files (whitespace is not counted).
optional --source-stats
@ -191,7 +189,6 @@ pub struct AnalysisStats {
pub output: Option<OutputFormat>,
pub randomize: bool,
pub parallel: bool,
pub memory_usage: bool,
pub source_stats: bool,
pub only: Option<String>,
pub with_deps: bool,