Clear BPF data in KernelCpuUidTimeReader.removeUid()

Currently KernelCpuUidTimeReader removes BPF cputime data in
removeUidsInRange(), but not in removeUid(), causing a leak where data
for some UIDs persists after it should have been removed. Update
removeUid() so that BPF data for removed UIDs is removed in both
paths.

Bug: 174739872
Test: open Chrome app & tabs & then close them; confirm isolated UID
data is removed.
Change-Id: I46315e37c2ac21a3964bb18f8fc9e050a83f97fe
Signed-off-by: Connor O'Brien <connoro@google.com>
This commit is contained in:
Connor O'Brien
2020-12-07 18:45:46 -08:00
parent 95d5d13bb5
commit 2eb8ad6245

View File

@@ -143,6 +143,10 @@ public abstract class KernelCpuUidTimeReader<T> {
*/
public void removeUid(int uid) {
mLastTimes.delete(uid);
if (mBpfTimesAvailable) {
mBpfReader.removeUidsInRange(uid, uid);
}
}
/**