]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #82754 - rylev:rusage-windows, r=pnkfelix
authorbors <bors@rust-lang.org>
Fri, 19 Mar 2021 12:44:33 +0000 (12:44 +0000)
committerbors <bors@rust-lang.org>
Fri, 19 Mar 2021 12:44:33 +0000 (12:44 +0000)
commitb97fd3e5a1545ab02e18c52e7f3d2e78a5c960bf
tree6515b94799921ce5949633ef1dbff1fdf9205991
parenteb95acea8aeaeef834214eaffb15d64095fe9271
parent302867cf48db284cc666fff7c2953f6f94f30aac
Auto merge of #82754 - rylev:rusage-windows, r=pnkfelix

Attempt to gather similar stats as rusage on Windows

A follow up to #82532. This is a bit hacked in because I think we need to discuss this before merging, but this is an attempt to gather similar metrics as `libc::rusage` on Windows.

Some comments on differences:
* Currently, we're passing `RUSAGE_CHILDREN` to `rusage` which collects statistics on all children that have been waited on and terminated. I believe this is currently just the invocation of the real `rustc` that the shim is wrapping. Does `rustc` itself spawn children processes? The windows version gets the child processes handle when spawning it, and uses that to collect the statistics. For maxrss, `rusage` will return "the resident set size of the largest child, not the maximum resident set size of the process tree.", the Windows version will only collect statistics on the wrapped `rustc` child process directly even if some theoretical sub process has a larger memory footprint.
* There might be subtle differences between `rusage`'s "resident set" and Window's "working set". The "working set" and "resident set" should both be the number of pages that are in memory and which would not cause a page fault when accessed.
* I'm not yet sure how best to get the same information that `ru_minflt`, `ru_inblock`, `ru_oublock`, `ru_nivcsw ` and `ru_nvcsw` provide.

r? `@pnkfelix`
src/bootstrap/bin/rustc.rs