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:
@@ -143,6 +143,10 @@ public abstract class KernelCpuUidTimeReader<T> {
|
||||
*/
|
||||
public void removeUid(int uid) {
|
||||
mLastTimes.delete(uid);
|
||||
|
||||
if (mBpfTimesAvailable) {
|
||||
mBpfReader.removeUidsInRange(uid, uid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user