Skip to content

Commit 0d8bf72

Browse files
committed
Created experimental build.print_step_rusage setting
Intended to piggy-back on output from existing build.print_step_timings setting.
1 parent b36f770 commit 0d8bf72

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

config.toml.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,12 @@ changelog-seen = 2
290290
# tracking over time)
291291
#print-step-timings = false
292292

293+
# Print out resource usage data for each rustbuild step, as defined by the Unix
294+
# struct rusage. (Note that this setting is completely unstable: the data it
295+
# captures, what platforms it supports, the format of its associated output, and
296+
# this setting's very existence, are all subject to change.)
297+
#print-step-rusage = false
298+
293299
# =============================================================================
294300
# General install configuration options
295301
# =============================================================================

src/bootstrap/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,10 @@ impl<'a> Builder<'a> {
12591259
cargo.env("RUSTC_PRINT_STEP_TIMINGS", "1");
12601260
}
12611261

1262+
if self.config.print_step_rusage {
1263+
cargo.env("RUSTC_PRINT_STEP_RUSAGE", "1");
1264+
}
1265+
12621266
if self.config.backtrace_on_ice {
12631267
cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
12641268
}

src/bootstrap/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pub struct Config {
161161
pub verbose_tests: bool,
162162
pub save_toolstates: Option<PathBuf>,
163163
pub print_step_timings: bool,
164+
pub print_step_rusage: bool,
164165
pub missing_tools: bool,
165166

166167
// Fallback musl-root for all targets
@@ -380,6 +381,7 @@ struct Build {
380381
configure_args: Option<Vec<String>>,
381382
local_rebuild: Option<bool>,
382383
print_step_timings: Option<bool>,
384+
print_step_rusage: Option<bool>,
383385
check_stage: Option<u32>,
384386
doc_stage: Option<u32>,
385387
build_stage: Option<u32>,
@@ -679,6 +681,7 @@ impl Config {
679681
set(&mut config.configure_args, build.configure_args);
680682
set(&mut config.local_rebuild, build.local_rebuild);
681683
set(&mut config.print_step_timings, build.print_step_timings);
684+
set(&mut config.print_step_rusage, build.print_step_rusage);
682685

683686
// See https://github.com/rust-lang/compiler-team/issues/326
684687
config.stage = match config.cmd {

0 commit comments

Comments
 (0)