Skip to content

Commit e5b98eb

Browse files
committed
Collect wall-time on Windows
1 parent 357b9be commit e5b98eb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

collector/src/execute.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,6 +1421,14 @@ fn process_stat_output(
14211421
stats.insert("cpu-clock".into(), counters.cpu_clock);
14221422
continue;
14231423
}
1424+
if line.starts_with("!wall-time:") {
1425+
let d = &line["!wall-time:".len()..];
1426+
stats.insert(
1427+
"wall-time".into(),
1428+
d.parse().map_err(|e| DeserializeStatError::ParseError(d.to_string(), e))?
1429+
);
1430+
continue;
1431+
}
14241432

14251433
// The rest of the loop body handles processing output from the Linux `perf` tool
14261434
// so on Windows, we just skip it and go to the next line.

collector/src/rustc-fake.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ fn main() {
109109
let status = tool.status().expect("tool failed to start");
110110
let dur = start.elapsed();
111111
assert!(status.success(), "tool did not run successfully");
112-
print_time(dur);
112+
println!(
113+
"!wall-time:{}.{:09}",
114+
dur.as_secs(),
115+
dur.subsec_nanos()
116+
);
113117

114118
let xperf = std::env::var("XPERF").unwrap_or("xperf.exe".to_string());
115119
let mut cmd = Command::new(&xperf);

0 commit comments

Comments
 (0)