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: Connor O'Brien <connoro@google.com>
1 file changed