Changeset 661e0e63 in rtems
- Timestamp:
- 06/15/16 09:18:10 (7 years ago)
- Branches:
- 5, master
- Children:
- 57c676c6
- Parents:
- 917884c
- git-author:
- Sebastian Huber <sebastian.huber@…> (06/15/16 09:18:10)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/15/16 09:21:04)
- Location:
- testsuites/psxtests/psx12
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
testsuites/psxtests/psx12/init.c
r917884c r661e0e63 23 23 const char rtems_test_name[] = "PSX 12"; 24 24 25 #define SS_REPL_PERIOD_US 200000 26 27 #define SS_INIT_BUDGET_US 100000 25 #define SS_REPL_PERIOD_NS 200000000 26 27 #define SS_INIT_BUDGET_NS 100000000 28 29 #define SS_REPL_PERIOD_MS ( SS_REPL_PERIOD_NS / 1000000 ) 28 30 29 31 #define SS_PRIO_LOW 1 … … 36 38 uint64_t start; 37 39 struct { 38 uint 64_t high;39 uint 64_t low;40 uint32_t high; 41 uint32_t low; 40 42 } samples[ SS_SAMPLE_PERIODS ]; 41 43 } test_context; … … 75 77 } 76 78 77 static uint64_t delta( test_context *ctx ) 78 { 79 return now() - ctx->start; 79 static uint32_t delta_in_ms( test_context *ctx ) 80 { 81 uint32_t d; 82 83 d = (uint32_t) ( now() - ctx->start ); 84 return ( d + 499 ) / 1000; 80 85 } 81 86 … … 89 94 for ( i = 0 ; i < SS_SAMPLE_PERIODS ; ++i ) { 90 95 wait_for_prio( SS_PRIO_LOW ); 91 ctx->samples[ i ].high = delta ( ctx );96 ctx->samples[ i ].high = delta_in_ms( ctx ); 92 97 wait_for_prio( SS_PRIO_HIGH ); 93 ctx->samples[ i ].low = delta ( ctx );98 ctx->samples[ i ].low = delta_in_ms( ctx ); 94 99 } 95 100 … … 165 170 166 171 schedparam.sched_ss_repl_period.tv_sec = 0; 167 schedparam.sched_ss_repl_period.tv_nsec = SS_REPL_PERIOD_ US * 1000;172 schedparam.sched_ss_repl_period.tv_nsec = SS_REPL_PERIOD_NS; 168 173 schedparam.sched_ss_init_budget.tv_sec = 0; 169 schedparam.sched_ss_init_budget.tv_nsec = SS_INIT_BUDGET_ US * 1000;174 schedparam.sched_ss_init_budget.tv_nsec = SS_INIT_BUDGET_NS; 170 175 171 176 schedparam.sched_priority = SS_PRIO_HIGH; … … 182 187 183 188 schedparam.sched_ss_repl_period.tv_sec = 0; 184 schedparam.sched_ss_repl_period.tv_nsec = SS_REPL_PERIOD_ US * 1000;189 schedparam.sched_ss_repl_period.tv_nsec = SS_REPL_PERIOD_NS; 185 190 schedparam.sched_ss_init_budget.tv_sec = 0; 186 schedparam.sched_ss_init_budget.tv_nsec = SS_INIT_BUDGET_ US * 1000;191 schedparam.sched_ss_init_budget.tv_nsec = SS_INIT_BUDGET_NS; 187 192 188 193 schedparam.sched_priority = SS_PRIO_HIGH; … … 206 211 207 212 for ( i = 0 ; i < SS_SAMPLE_PERIODS ; ++i ) { 208 printf( "[%zu] H % 6" PRIu64 "us\n", i, ctx->samples[ i ].high );209 printf( "[%zu] L % 6" PRIu64 "us\n", i, ctx->samples[ i ].low );210 rtems_test_assert( ctx->samples[ i ].low / SS_REPL_PERIOD_ US == i + 1 );213 printf( "[%zu] H %3" PRIu32 "ms\n", i, ctx->samples[ i ].high ); 214 printf( "[%zu] L %3" PRIu32 "ms\n", i, ctx->samples[ i ].low ); 215 rtems_test_assert( ctx->samples[ i ].low / SS_REPL_PERIOD_MS == i + 1 ); 211 216 } 212 217 -
testsuites/psxtests/psx12/psx12.scn
r917884c r661e0e63 9 9 Init: pthread_create - SUCCESSFUL 10 10 Sporadic Server: exitting 11 [0] H 99902us12 [0] L 200 008us13 [1] H 2 89908us14 [1] L 400 009us15 [2] H 4 89903us16 [2] L 600 009us11 [0] H 100ms 12 [0] L 200ms 13 [1] H 290ms 14 [1] L 400ms 15 [2] H 490ms 16 [2] L 600ms 17 17 *** END OF TEST PSX 12 ***
Note: See TracChangeset
for help on using the changeset viewer.