IdleWakeups: skip processes that report 0 threads
This change fixes IdleWakeups' SystemInformationSampler failing to handle processes for which ::NtQuerySystemInformation() returns a thread count of zero. With this change, processes with "zero" threads are simply skipped. Currently, the "Secure System" process reports a thread count of 0 (as it prohibits other processes from accessing it in any way), and SystemInformationSampler subtracts 1 from this (logically assuming that every process has at least one thread), which overflows to a large number. SystemInformationSampler, noting that thread information for <large number> threads would not fit in its buffer, triggers an early return. In practice, this results in IdleWakeups showing 0 processes when a process with "zero" threads exists before its targeted process in the process list, because it hits the early return described above before reaching the process of interest. Change-Id: I63b9a36bb139aba0b18539e65312bdc5d836cc69 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335799 Commit-Queue: Jesse McKenna <jessemckenna@google.com> Reviewed-by:Bruce Dawson <brucedawson@chromium.org> Cr-Commit-Position: refs/heads/master@{#795542}
Showing
Please register or sign in to comment