simpleperf: Make stop recording time more accurate.
simpleperf stops recording in FinishReadMmapEventData(). It contains
two steps:
1. Stop record read thread.
2. Process records in userspace buffer.
But if the second steps takes significant time, users may think
simpleperf doesn't receive the stop recording command. To avoid that,
this CL moves the second step to post processing.
This CL also closes event files when stopping recording. That
prevents the kernel from generating more samples, which may slow down
post processing.
Bug: 227220328
Test: run simpleperf_unit_test
Change-Id: Ib5a11b7ce039e2133a9070a10508da514197e610
3 files changed