time_in_state_test: fix active CPU counts

nr_active_map is initialized to 0 from userspace and updated only by
the sched_switch bpf program. To make test behavior consistent with
time_in_state.c, set nr_active_map to 0 rather than 1 in
enableTracking and update the tp_sched_switch test case accordingly.

Also, set policy_nr_active_map entries to 0 in initCpuPolicy
regardless of whether they already exist. This ensures stale counts
from previous tests will be cleared, which is necessary to allow for
multiple test cases that use assertConcurrentTimes.

Test: bpf-time-in-state-tests
Change-Id: I3f0dd8284ae76748fd9cba34c63aa19fe0534bfa
Signed-off-by: Connor O'Brien <connoro@google.com>
1 file changed
tree: db968b364589498423429698d0615abf2eccea87
  1. test/
  2. Android.bp
  3. LICENSE
  4. METADATA
  5. OWNERS
  6. PREUPLOAD.cfg
  7. time_in_state.c
  8. time_in_state_test.cpp