diff options
author | Yury Khmel <khmel@google.com> | 2023-05-18 14:31:05 -0700 |
---|---|---|
committer | Yury Khmel <khmel@google.com> | 2023-05-29 18:04:06 -0700 |
commit | 9e269cfc83fa2568b1424192a69064ccef2a8903 (patch) | |
tree | e166d061063d5aa543237e667b59c4f03da508e8 | |
parent | 0eb3232339fb939c294ff8d2f999909b66bdee95 (diff) | |
download | extras-9e269cfc83fa2568b1424192a69064ccef2a8903.tar.gz |
arc: Fix CTS tests for grunt
Waiting loop has 1us delay waiting for requested changes are propagated.
This is too aggressive and Grunt and other low-end devices may
have no chance to react in specific timeout.
Bug: 265675811
Test: cts-tradefed run commandAndExit cts -m CtsSimpleperfTestCases
Most tests are now passing:
Total Tests : 540
PASSED : 528
FAILED : 12
Change-Id: Ida041674c2fea425e6d267ee6a973208da00ed71
-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 5b2fcaa8..4cc47914 100644 --- a/simpleperf/environment.cpp +++ b/simpleperf/environment.cpp @@ -388,9 +388,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) { |