]> rtime.felk.cvut.cz Git - rtems-pluggable-edf.git/commitdiff
Test_EDF and Test_CBS: Task distinction terminal output fixed.
authorPetr Benes <benesp16@fel.cvut.cz>
Sun, 17 Apr 2011 15:33:22 +0000 (17:33 +0200)
committerPetr Benes <benesp16@fel.cvut.cz>
Sun, 17 Apr 2011 15:33:22 +0000 (17:33 +0200)
src/test_cbs/task.c
src/test_edf/task.c

index 22bffe8aff779952febb86aa0e09bfc43047c828..9d0b34db2e742fb25e75bc6b13cd53aad91ad3f7 100644 (file)
@@ -23,7 +23,7 @@
 #define T1_SERVER 0
 #define T2_SERVER 0
 
-void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_j, uint32_t server)
+void test_loop ( unsigned int id, rtems_name name, unsigned int period_length, unsigned int max_j, uint32_t server)
 {
   rtems_id period;
   rtems_status_code status;
@@ -45,10 +45,10 @@ void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_
   while ( 1 ) {
          edf_next_period();
          if (rtems_rate_monotonic_period(period,period_length)==RTEMS_TIMEOUT)
-                    puts("P1 - Deadline miss");
+                    printf("P%u - Deadline miss", id);
          
          rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
-         sprintf(output1,"P1-S  ticks:%u  prio:%u",start, (unsigned int) _Per_CPU_Information.executing->current_priority);
+         sprintf(output1,"P%u-S  ticks:%u  prio:%u", id,start, (unsigned int) _Per_CPU_Information.executing->current_priority);
          puts(output1);
          
          if ( start >= TEST_DURATION ) break;
@@ -67,7 +67,7 @@ void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_
          }
         
          rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop);
-         sprintf(output2,"P1-F  ticks:%u",stop);
+         sprintf(output2,"P%u-F  ticks:%u",id, stop);
          puts(output2);
   }
   
@@ -91,7 +91,7 @@ rtems_task Task_1(
 {
        rtems_name name;
        name = rtems_build_name( 'P', 'E', 'R', 'A' );
-       test_loop(name, T1_PER,T1_DUR,T1_SERVER);
+       test_loop(1, name, T1_PER,T1_DUR,T1_SERVER);
 }
 
 
@@ -101,7 +101,7 @@ rtems_task Task_2(
 {
        rtems_name name;
        name = rtems_build_name( 'P', 'E', 'R', 'B' );
-       test_loop(name, T2_PER,T2_DUR,T2_SERVER);
+       test_loop(2, name, T2_PER,T2_DUR,T2_SERVER);
 
 }
 
index 22bffe8aff779952febb86aa0e09bfc43047c828..9d0b34db2e742fb25e75bc6b13cd53aad91ad3f7 100644 (file)
@@ -23,7 +23,7 @@
 #define T1_SERVER 0
 #define T2_SERVER 0
 
-void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_j, uint32_t server)
+void test_loop ( unsigned int id, rtems_name name, unsigned int period_length, unsigned int max_j, uint32_t server)
 {
   rtems_id period;
   rtems_status_code status;
@@ -45,10 +45,10 @@ void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_
   while ( 1 ) {
          edf_next_period();
          if (rtems_rate_monotonic_period(period,period_length)==RTEMS_TIMEOUT)
-                    puts("P1 - Deadline miss");
+                    printf("P%u - Deadline miss", id);
          
          rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &start);
-         sprintf(output1,"P1-S  ticks:%u  prio:%u",start, (unsigned int) _Per_CPU_Information.executing->current_priority);
+         sprintf(output1,"P%u-S  ticks:%u  prio:%u", id,start, (unsigned int) _Per_CPU_Information.executing->current_priority);
          puts(output1);
          
          if ( start >= TEST_DURATION ) break;
@@ -67,7 +67,7 @@ void test_loop (  rtems_name name, unsigned int period_length, unsigned int max_
          }
         
          rtems_clock_get(RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &stop);
-         sprintf(output2,"P1-F  ticks:%u",stop);
+         sprintf(output2,"P%u-F  ticks:%u",id, stop);
          puts(output2);
   }
   
@@ -91,7 +91,7 @@ rtems_task Task_1(
 {
        rtems_name name;
        name = rtems_build_name( 'P', 'E', 'R', 'A' );
-       test_loop(name, T1_PER,T1_DUR,T1_SERVER);
+       test_loop(1, name, T1_PER,T1_DUR,T1_SERVER);
 }
 
 
@@ -101,7 +101,7 @@ rtems_task Task_2(
 {
        rtems_name name;
        name = rtems_build_name( 'P', 'E', 'R', 'B' );
-       test_loop(name, T2_PER,T2_DUR,T2_SERVER);
+       test_loop(2, name, T2_PER,T2_DUR,T2_SERVER);
 
 }