]> git.lizzy.rs Git - rust.git/commitdiff
Created experimental build.print_step_rusage setting
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 19 Feb 2021 18:25:26 +0000 (13:25 -0500)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 25 Feb 2021 16:38:51 +0000 (11:38 -0500)
Intended to piggy-back on output from existing build.print_step_timings setting.

config.toml.example
src/bootstrap/builder.rs
src/bootstrap/config.rs

index f3bc98d78aed440be29cafc9607541a03d18b494..ba382aac828d4b139ddb382f62830addf4d74125 100644 (file)
@@ -290,6 +290,12 @@ changelog-seen = 2
 # tracking over time)
 #print-step-timings = false
 
+# Print out resource usage data for each rustbuild step, as defined by the Unix
+# struct rusage. (Note that this setting is completely unstable: the data it
+# captures, what platforms it supports, the format of its associated output, and
+# this setting's very existence, are all subject to change.)
+#print-step-rusage = false
+
 # =============================================================================
 # General install configuration options
 # =============================================================================
index 61554a316d0a1e7e071afd95d35079426336f390..c0175a0710fdc61c16999c07325ad1139b5e6f1e 100644 (file)
@@ -1259,6 +1259,10 @@ pub fn cargo(
             cargo.env("RUSTC_PRINT_STEP_TIMINGS", "1");
         }
 
+        if self.config.print_step_rusage {
+            cargo.env("RUSTC_PRINT_STEP_RUSAGE", "1");
+        }
+
         if self.config.backtrace_on_ice {
             cargo.env("RUSTC_BACKTRACE_ON_ICE", "1");
         }
index d50d605d5c695cd24e6bcb5e1277bbc982123029..b2af8e59b7c9fcb5e0ed4eda2117b912d2f64792 100644 (file)
@@ -161,6 +161,7 @@ pub struct Config {
     pub verbose_tests: bool,
     pub save_toolstates: Option<PathBuf>,
     pub print_step_timings: bool,
+    pub print_step_rusage: bool,
     pub missing_tools: bool,
 
     // Fallback musl-root for all targets
@@ -380,6 +381,7 @@ struct Build {
     configure_args: Option<Vec<String>>,
     local_rebuild: Option<bool>,
     print_step_timings: Option<bool>,
+    print_step_rusage: Option<bool>,
     check_stage: Option<u32>,
     doc_stage: Option<u32>,
     build_stage: Option<u32>,
@@ -679,6 +681,7 @@ pub fn parse(args: &[String]) -> Config {
         set(&mut config.configure_args, build.configure_args);
         set(&mut config.local_rebuild, build.local_rebuild);
         set(&mut config.print_step_timings, build.print_step_timings);
+        set(&mut config.print_step_rusage, build.print_step_rusage);
 
         // See https://github.com/rust-lang/compiler-team/issues/326
         config.stage = match config.cmd {