time_in_state: handle SDK sandbox UIDs
Add a check to detect UIDs in the SDK sandbox range. CPU times for
these UIDs will be attributed to corresponding app UID, calculated by
subtracting a fixed offset from the current UID. We also attribute
these times to AID_SDK_SANDBOX, a UID reserved specifically for the
purpose of collecting aggregate stats across all SDK sandbox uids.
To avoid redundant code, factor out per-UID accounting logic into a
helper function that we can call twice in this new case.
Add a new test case to verify such UIDs are handled correctly.
Test: atest --test-mapping system/bpfprogs
Bug: 219080829
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I6aa5404a2201c2583e7b6a1292d3c80b9e3ec5cb
2 files changed