[rtems commit] libtest: Improve the interrupt test timing
Sebastian Huber
sebh at rtems.org
Mon Nov 15 08:15:16 UTC 2021
Module: rtems
Branch: master
Commit: 69aaf58745250cd27689dc5e8c24468bc173625a
Changeset: http://git.rtems.org/rtems/commit/?id=69aaf58745250cd27689dc5e8c24468bc173625a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Wed Nov 10 09:15:58 2021 +0100
libtest: Improve the interrupt test timing
If no state change occurred during the test action, then assume a late
interrupt.
---
cpukit/libtest/t-test-interrupt.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/cpukit/libtest/t-test-interrupt.c b/cpukit/libtest/t-test-interrupt.c
index 5d83b78..85b9b6f 100644
--- a/cpukit/libtest/t-test-interrupt.c
+++ b/cpukit/libtest/t-test-interrupt.c
@@ -456,9 +456,16 @@ T_interrupt_test(const T_interrupt_test_config *config, void *arg)
lower_bound[sample] = lower - delta;
sample = (sample + 1) % T_INTERRUPT_SAMPLE_COUNT;
- } else if (state == T_INTERRUPT_TEST_LATE) {
+ } else if (state == T_INTERRUPT_TEST_LATE ||
+ state == T_INTERRUPT_TEST_ACTION) {
uint_fast32_t upper;
+ /*
+ * If the state is T_INTERRUPT_TEST_ACTION, then there
+ * was probably no interrupt during the action, so the
+ * interrupt would be late.
+ */
+
lower_sum -= lower_bound[sample];
lower_sum += busy;
lower_bound[sample] = busy;
More information about the vc
mailing list