diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-01 20:33:19 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-01 20:33:19 +0000 |
commit | c3fd87906165b81e6fb5004faf8e045a649e2d56 (patch) | |
tree | 65dbe6dae9bdd3ccda0816c93fe11ad8aec87fdb | |
parent | e53d4f01e5588769c0896b05f3646263c4036144 (diff) | |
parent | 7650777c5f4fab90981af0a8509fe2821d613592 (diff) | |
download | extras-c3fd87906165b81e6fb5004faf8e045a649e2d56.tar.gz |
Snap for 10238052 from 7650777c5f4fab90981af0a8509fe2821d613592 to android13-tests-release
Change-Id: Ib141cf34ab752fc56e00e300d7bfa19bab3ec7fb
-rw-r--r-- | simpleperf/environment.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/simpleperf/environment.cpp b/simpleperf/environment.cpp index 8e95d449..9d698924 100644 --- a/simpleperf/environment.cpp +++ b/simpleperf/environment.cpp @@ -332,9 +332,10 @@ bool SetPerfEventLimits(uint64_t sample_freq, size_t cpu_percent, uint64_t mlock } // Wait for init process to change perf event limits based on properties. const size_t max_wait_us = 3 * 1000000; + const size_t interval_us = 10000; int finish_mask = 0; - for (size_t i = 0; i < max_wait_us && finish_mask != 7; ++i) { - usleep(1); // Wait 1us to avoid busy loop. + for (size_t i = 0; i < max_wait_us && finish_mask != 7; i += interval_us) { + usleep(interval_us); // Wait 10ms to avoid busy loop. if ((finish_mask & 1) == 0) { uint64_t freq; if (!GetMaxSampleFrequency(&freq) || freq == sample_freq) { |