GpuMem: refactor and add unittest for traverseGpuMemTotals
Use explicit std::function instead of lambda to make the interface more
stable and reliable. The trivial perf difference doesn't matter since
the data is only collected once upon tracing start and we just need to
ensure that the timestamp stays close enough to the map query.
Bug: 164194338
Test: atest gpuservice_unittest:GpuMemTest
Change-Id: I0b1e92214085eac5f75e7cdf4c00c017c520ff5b
Merged-In: I0b1e92214085eac5f75e7cdf4c00c017c520ff5b
4 files changed