libtimeinstate: support concurrent_{active,policy}_time
Add support for querying and clearing stats for time each UID spent running concurrently with tasks on all other CPUs and on CPUs in the same cluster. Also add tests for the new functions, including consistency checks comparing time in state vs concurrent times. Finally, because the BPF program cannot update multiple map values atomically, userspace reads occasionally occur in between the updates to a UID's active and policy times. Add a check for this in our reader functions and retry once when it is detected. For the (very rare) case where the same race occurs when retrying, include a comment in our consistency test to help distinguish these transient failures from a more serious bug. Test: libtimeinstate_test passes Bug: 138317993 Change-Id: I429ed39d3ef82b6643fd042a74d9d403c658a8c1 Signed-off-by:Connor O'Brien <connoro@google.com> (cherry picked from commit daceef75) Merged-In: I429ed39d3ef82b6643fd042a74d9d403c658a8c1
Loading
Please register or sign in to comment