aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Niu <ben.niu@mediatek.com>2023-06-05 16:58:11 +0800
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-06-08 20:40:22 +0000
commitc52b9da7d6e24cf7d35a7c66d62efef1ca13f247 (patch)
treeca9fb9627238d682b378b2118cf9376d8236c47b
parentd6d5581123f3fd54737df1d65eb057aa48b7ea00 (diff)
downloadltp-c52b9da7d6e24cf7d35a7c66d62efef1ca13f247.tar.gz
Add buffer for RT throttling default configandroid14-dev
perf_event_open02 will run testing about 4s as RT thread then get HW instruction and SW task clock event counter to compare. Under kernel RT throttling default config (sched_rt_period_us=1000000, sched_rt_runtime_us=950000), the RT testing thread will sleep around 50ms for 4 times because of RT throttling. The sleeping will lead device enter idle then exit idle for 4 times. This behavior leads overhead and affect perf event counter. After update RT throttling config (sched_rt_period_us=3000000, sched_rt_runtime_us=2850000), the test case could pass because of less idle times. Bug: 285838050 Test: run vts vts_ltp_test_arm_64 (cherry picked from https://android-review.googlesource.com/q/commit:d1d611252c553db4b3b1cd9ab2f18e0e1c14396e) Merged-In: I643ed60c051f799a5c28746ac033acf563fae615 Change-Id: I643ed60c051f799a5c28746ac033acf563fae615
-rw-r--r--testcases/kernel/syscalls/perf_event_open/perf_event_open02.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c b/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
index defe13c62..20dbb6133 100644
--- a/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
+++ b/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
@@ -23,8 +23,8 @@
* that can count instructions. If the task clock counters in the groups
* don't stop when their group gets taken off the PMU, the ratio will
* instead be close to N+4. The program will declare that the test fails
- * if the ratio is greater than N (actually, N + 0.0001 to allow for FP
- * rounding errors).
+ * if the ratio is greater than N (actually, N + 0.0005 to allow for FP
+ * rounding errors and RT throttling overhead).
*/
#define _GNU_SOURCE
@@ -318,7 +318,7 @@ static void verify(void)
ratio = (double)vtsum / vt0;
tst_res(TINFO, "ratio: %lf", ratio);
- if (ratio > nhw + 0.0001) {
+ if (ratio > nhw + 0.0005) {
tst_res(TFAIL, "test failed (ratio was greater than %d)", nhw);
} else {
tst_res(TPASS, "test passed");