diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2019-02-11 00:03:51 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2019-02-11 00:53:16 +0100 |
| commit | f0b15f6d6ae8e771ef68a0d8c85d88dfddee8afa (patch) | |
| tree | bd201989c3eef4369b5296c707b08bdd3de29888 /src | |
| parent | 2e08bb1dd2863b94943fdca5a57ff2188e87623f (diff) | |
Add an option to print the status of incremental tasks / dep nodes after running them
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/dep_graph/graph.rs | 15 | ||||
| -rw-r--r-- | src/librustc/session/config.rs | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index e8c1cd36064..42d76a26b4b 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -292,17 +292,28 @@ impl DepGraph { task_deps.map(|lock| lock.into_inner()), ); + let print_status = cfg!(debug_assertions) && hcx.sess().opts.debugging_opts.dep_tasks; + // Determine the color of the new DepNode. if let Some(prev_index) = data.previous.node_to_index_opt(&key) { let prev_fingerprint = data.previous.fingerprint_by_index(prev_index); let color = if let Some(current_fingerprint) = current_fingerprint { if current_fingerprint == prev_fingerprint { + if print_status { + eprintln!("[task::green] {:?}", key); + } DepNodeColor::Green(dep_node_index) } else { + if print_status { + eprintln!("[task::red] {:?}", key); + } DepNodeColor::Red } } else { + if print_status { + eprintln!("[task::unknown] {:?}", key); + } // Mark the node as Red if we can't hash the result DepNodeColor::Red }; @@ -312,6 +323,10 @@ impl DepGraph { insertion for {:?}", key); data.colors.insert(prev_index, color); + } else { + if print_status { + eprintln!("[task::new] {:?}", key); + } } (result, dep_node_index) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 1a92f2c0f7a..178217d524a 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1233,6 +1233,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options, "show extended diagnostic help"), continue_parse_after_error: bool = (false, parse_bool, [TRACKED], "attempt to recover from parse errors (experimental)"), + dep_tasks: bool = (false, parse_bool, [UNTRACKED], + "print tasks that execute and the color their dep node gets (requires debug build)"), incremental: Option<String> = (None, parse_opt_string, [UNTRACKED], "enable incremental compilation (experimental)"), incremental_queries: bool = (true, parse_bool, [UNTRACKED], |
