]> git.lizzy.rs Git - rust.git/commit
Implementation of build.print_step_rusage.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Fri, 19 Feb 2021 18:27:39 +0000 (13:27 -0500)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 25 Feb 2021 16:38:52 +0000 (11:38 -0500)
commitf2d70c5d188472f5655c9cc8ba47e52d89d8fdd7
tree438cf0cc56a247284d1fe203ac28fbba31ca67fa
parent0d8bf72a36eb78c1a9bf721b9af3055f62cfc3dc
Implementation of build.print_step_rusage.

On non-unix platforms, does not try to call `getrusage` (and does not attempt to
implement its own shim; that could be follow-on work, though its probably best
to not invest too much effort there, versus using separate dedicated tooling).

On unix platforms, calls libc::rusage and attempts to emit the subset of fields
that are supported on Linux and Mac OS X. Omits groups of related stats which
appear to be unsupported on the platform (due to them all remaining zero).

Adjusts output to compensate for Mac using bytes instead of kb (a well known
discrepancy on Mac OS X). However, so far I observe a lot of strange values
(orders of magnitude wrong) reported on Mac OS X in some cases, so I would not
trust this in that context currently.
src/bootstrap/bin/rustc.rs