From: Petr Benes Date: Sun, 17 Apr 2011 15:33:22 +0000 (+0200) Subject: Test_EDF and Test_CBS: Task distinction terminal output fixed. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/rtems-pluggable-edf.git/commitdiff_plain/e2450937bf46b3f1dbaedf88d084404cecc0e181 Test_EDF and Test_CBS: Task distinction terminal output fixed. --- diff --git a/src/test_cbs/task.c b/src/test_cbs/task.c index 22bffe8..9d0b34d 100644 --- a/src/test_cbs/task.c +++ b/src/test_cbs/task.c @@ -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); } diff --git a/src/test_edf/task.c b/src/test_edf/task.c index 22bffe8..9d0b34d 100644 --- a/src/test_edf/task.c +++ b/src/test_edf/task.c @@ -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); }