diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-01 23:24:50 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-01 23:24:50 +0000 |
commit | fd44c2016b7176abbd5948ca0f6399de628c9962 (patch) | |
tree | bb6b5127dde362dca94389c8849068dc9c52f689 | |
parent | 90aa21b560cea09ab398ba3014db5b09b20ee42f (diff) | |
parent | bab1ef73746fed28d98810b0e8562a6ebdb05cb6 (diff) | |
download | extras-fd44c2016b7176abbd5948ca0f6399de628c9962.tar.gz |
Snap for 10242133 from bab1ef73746fed28d98810b0e8562a6ebdb05cb6 to udc-release
Change-Id: I94df649bff205e31487e159f0c7082f5bb813094
-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 39803289..5ff09160 100644 --- a/simpleperf/environment.cpp +++ b/simpleperf/environment.cpp @@ -343,9 +343,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) { |