libtimeinstate: improve error handling in single-UID functions

getUidCpuFreqTimes and getUidConcurrentTimes return all zeros if the
requested UID is not present in the BPF maps on the assumption that
that UID has zero runtime, but this could also indicate that tracking
never started (in which case the map will be empty). Add a check to
distinguish these cases and return an error when tracking is not
working.

Test: load maps (but not progs) from time_in_state.o, enable
track_cpu_times_by_proc_state, run BstatsCpuTimesValidationTest
Bug: 163593704
Signed-off-by: Connor O'Brien <connoro@google.com>

Change-Id: I1d889cd02e67263c0b031be74f0b963ed80961b0
1 file changed