[startup] Avoid large allocations when getting the number of hard faults.
On startup, ::NtQuerySystemInformation() is invoked to get the number of hard faults and determine if the startup is "warm" or "cold". The function can fail if the provided buffer is too small. In that case, we resize the buffer to the size requested by the function and we retry. In some cases, the size returned by the function is very large (> 1 MB). It is undesirable to invoke a function to fill a large buffer just to record startup histograms. This CL does not get the hard fault count if it requires a buffer with a size >= 512 KB. The failure to get the hard fault count is reported in the "undetermined" bucket of the Startup.Temperature histogram. Histograms suffixed with the startup temperature are obviously not recorded. Bug: 1085716 Change-Id: I0864a2af26e07cddcab4e094d344473ccbb5b9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302829Reviewed-by:Gabriel Charette <gab@chromium.org> Commit-Queue: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#823977}
Showing
Please register or sign in to comment