• Francois Doray's avatar
    [startup] Avoid large allocations when getting the number of hard faults. · 2c6f7843
    Francois Doray authored
    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: default avatarGabriel Charette <gab@chromium.org>
    Commit-Queue: François Doray <fdoray@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#823977}
    2c6f7843
enums.xml 3.37 MB
The source could not be displayed because it is larger than 1 MB. You can load it anyway or download it instead.