diff options
author | Yabin Cui <yabinc@google.com> | 2018-07-09 13:18:28 -0700 |
---|---|---|
committer | Yabin Cui <yabinc@google.com> | 2018-07-09 13:18:48 -0700 |
commit | caf9fd54788c71cba570a3661c28839ebdaef944 (patch) | |
tree | 85dd03fa85a9b46b865af03ae7c68d30141cc143 /simpleperf/cmd_record.cpp | |
parent | f011a9ff8a6c2f7faa30153141d630c3878ae678 (diff) | |
download | extras-caf9fd54788c71cba570a3661c28839ebdaef944.tar.gz |
simpleperf: fix more recording time than requested.
EventSelectionSet::ReadMmapEventData() reads records until the
record buffer is empty, so stop recording event may not be processed
in time.
This patch fix it with below changes:
1. Add time limit for ReadMmapEventData(). So it can stop reading
after taking 100ms.
2. In FinishReadMmapEventData(), stop the read thread before reading
all records.
Bug: 111083259
Test: run simpleperf_unit_test.
Test: run simpleperf manually, the recording time takes no more than
Test: 200ms than requested.
Change-Id: Id58e100e774770e3a10e41ac593867e8ae3b2288
Diffstat (limited to 'simpleperf/cmd_record.cpp')
-rw-r--r-- | simpleperf/cmd_record.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/simpleperf/cmd_record.cpp b/simpleperf/cmd_record.cpp index 6a069cd5..e58e6594 100644 --- a/simpleperf/cmd_record.cpp +++ b/simpleperf/cmd_record.cpp @@ -1190,7 +1190,7 @@ bool RecordCommand::ProcessJITDebugInfo(const std::vector<JITSymFile>& jit_symfi // generated after them. So process existing samples each time generating new JIT maps. We prefer // to process samples after processing JIT maps. Because some of the samples may hit the new JIT // maps, and we want to report them properly. - if (sync_kernel_records && !event_selection_set_.ReadMmapEventData(true)) { + if (sync_kernel_records && !event_selection_set_.SyncKernelBuffer()) { return false; } return true; |