[rtems commit] smptests/smpcapture02: Adjust for clock changes

Sebastian Huber sebh at rtems.org
Thu May 12 11:35:37 UTC 2016


Module:    rtems
Branch:    master
Commit:    1379d840a483ccdce109fa8e45ef63d51a6e8e00
Changeset: http://git.rtems.org/rtems/commit/?id=1379d840a483ccdce109fa8e45ef63d51a6e8e00

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu May 12 10:57:15 2016 +0200

smptests/smpcapture02: Adjust for clock changes

Fix overall clock tick count.  Change introduced by
90d8567d34a6d80da04b1cb37b667a3173f584c4.

Update #2554.

---

 testsuites/smptests/smpcapture02/init.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/testsuites/smptests/smpcapture02/init.c b/testsuites/smptests/smpcapture02/init.c
index bd912ee..787b7f3 100644
--- a/testsuites/smptests/smpcapture02/init.c
+++ b/testsuites/smptests/smpcapture02/init.c
@@ -155,10 +155,9 @@ static void task(rtems_task_argument arg)
   rtems_task_suspend(rtems_task_self());
 }
 
-static void test(void)
+static void test(uint32_t cpu_count)
 {
   rtems_status_code sc;
-  uint32_t cpu_count;
   uint32_t t;
   uint32_t c;
   rtems_task_argument idx;
@@ -171,9 +170,6 @@ static void test(void)
       RTEMS_NO_PRIORITY_CEILING |
       RTEMS_FIFO, 0, &finished_sem);
 
-  /* Get the number of processors that we are using. */
-  cpu_count = rtems_get_processor_count();
-
   /*
    * Create a set of tasks per CPU. Chain them together using
    * semaphores so that only one task can be active at any given
@@ -266,6 +262,7 @@ static void Init(rtems_task_argument arg)
   rtems_status_code sc;
   uint32_t i;
   uint32_t cpu;
+  uint32_t cpu_count;
   uint32_t read;
   uint32_t enter_count;
   uint32_t exit_count;
@@ -282,6 +279,9 @@ static void Init(rtems_task_argument arg)
 
   TEST_BEGIN();
 
+  /* Get the number of processors that we are using. */
+  cpu_count = rtems_get_processor_count();
+
   sc = rtems_capture_open(50000, NULL);
   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
 
@@ -292,7 +292,7 @@ static void Init(rtems_task_argument arg)
   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
 
   /* Run main test */
-  test();
+  test(cpu_count);
 
   /* Try to find the clock interrupt handler */
   for ( vec=BSP_INTERRUPT_VECTOR_MIN; vec<BSP_INTERRUPT_VECTOR_MAX; vec++ ) {
@@ -322,7 +322,7 @@ static void Init(rtems_task_argument arg)
   clock_tick_count = 0;
 
   /* Read out the trace from all processors */
-  for ( cpu = 0; cpu < rtems_get_processor_count(); cpu++ ) {
+  for ( cpu = 0; cpu < cpu_count; cpu++ ) {
     sc = rtems_capture_read(cpu, &read, &recs);
     rtems_test_assert(sc == RTEMS_SUCCESSFUL);
 
@@ -400,7 +400,7 @@ static void Init(rtems_task_argument arg)
   }
 
   if( cih.found )
-    rtems_test_assert(clock_tick_count == CLOCK_TICKS);
+    rtems_test_assert(clock_tick_count == cpu_count * CLOCK_TICKS);
 
   TEST_END();
   rtems_test_exit(0);




More information about the vc mailing list