Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3fc2cb71 authored by Connor O'Brien's avatar Connor O'Brien
Browse files

libtimeinstate: clear stale map values in startTrackingUidTimes()



If system_server is killed and restarted after attaching programs to
tracepoints, the values in several maps will become stale before the
programs are re-attached, leading to errors. For example, stale times
in the cpu_last_update map will cause the entire time since the
sched_switch program was detached to be attributed to the first task
to switch out after reattach.
To mitigate this, zero out all potentially stale map entries before
attaching any bpf programs to tracepoints.
Also, give the map fds in startTrackingUidTimes() more descriptive
names now that there are six different maps being opened.

Bug: 138317993
Test: libtimeinstate_test passes after restarting attaching process
Change-Id: I786d728108ca40575047c5c22c76034d05b6e2c2
Signed-off-by: default avatarConnor O'Brien <connoro@google.com>
parent 86df959a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment