diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-05-31 19:56:49 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-05-31 19:56:49 +0000 |
commit | 66f20d311e0c015cafba3d797821a67fb5c9dcf6 (patch) | |
tree | 82c7b26a6007744fd8b0cc5fa9472196a5ee5587 | |
parent | b2dee26f989a5ab41fc7790634d8a6851635b897 (diff) | |
parent | 448f7acf034c521e145c8e5c734e0394c24b3101 (diff) | |
download | extras-66f20d311e0c015cafba3d797821a67fb5c9dcf6.tar.gz |
Merge "Merge "Merge "arc: Fix CTS tests for grunt" into android11-tests-dev am: b19afd3d01" into android12-tests-dev am: 886dfe2c36" into android12L-tests-dev
-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 4c960350..35790370 100644 --- a/simpleperf/environment.cpp +++ b/simpleperf/environment.cpp @@ -331,9 +331,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) { |