Changeset 2c8485b in rtems
- Timestamp:
- 05/24/00 15:37:32 (23 years ago)
- Children:
- 70f1f1d9
- Parents:
- 2fbdbd4
- Location:
- c/src/tests/libtests/cpuuse
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/tests/libtests/cpuuse/cpuuse.scn
r2fbdbd4 r2c8485b 1 *** TEST 4 *** 2 TA1 - 09:15:00 12/31/1988 1 *** CPU USAGE LIBRARY TEST *** 3 2 TA1 - rtems_task_suspend - on Task 2 4 3 TA1 - rtems_task_suspend - on Task 3 … … 6 5 TA1 - rtems_task_resume - on Task 2 7 6 TA1 - rtems_task_resume - on Task 3 8 TA2 - 09:15:03 12/31/19889 TA3 - 09:15:04 12/31/198810 TA1 - 09:15:05 12/31/198811 TA2 - 09:15:06 12/31/198812 TA3 - 09:15:07 12/31/198813 TA1 - 09:15:08 12/31/198814 7 TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT 15 TA1 - 09:15:09 12/31/198816 8 TA1 - 09:15:10 12/31/1988 17 9 TA1 - 09:15:11 12/31/1988 … … 19 11 TA1 - 09:15:13 12/31/1988 20 12 TA1 - 09:15:14 12/31/1988 13 TA1 - 09:15:15 12/31/1988 21 14 TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT 22 TA2 - 09:15:15 12/31/1988 23 TA3 - 09:15:16 12/31/1988 24 *** END OF TEST 4 *** 15 TA1 - 09:15:00 12/31/1988 16 TA2 - 09:15:04 12/31/1988 17 TA3 - 09:15:05 12/31/1988 18 TA1 - 09:15:06 12/31/1988 19 TA2 - 09:15:07 12/31/1988 20 TA3 - 09:15:08 12/31/1988 21 TA1 - 09:15:09 12/31/1988 22 TA2 - 09:15:16 12/31/1988 23 CPU Usage by thread 24 ID NAME TICKS PERCENT 25 0x04010001 IDLE 0 0.000 26 0x08010002 TA1 1203 0.748 27 0x08010003 TA2 204 0.127 28 0x08010004 TA3 202 0.126 29 30 Ticks since last reset = 1601 31 32 Total Units = 1609 33 *** END OF CPU USAGE LIBRARY TEST *** 34 NOTE: Actual time per task will vary but there should be no IDLE time. -
c/src/tests/libtests/cpuuse/system.h
r2fbdbd4 r2c8485b 45 45 46 46 #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 47 #define CONFIGURE_MAXIMUM_TASKS 4 47 48 #define CONFIGURE_TICKS_PER_TIMESLICE 100 48 49 … … 63 64 /* array of task run counts */ 64 65 TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; 66 67 /* 68 * Keep track of task switches 69 */ 70 71 struct taskSwitchLog { 72 int taskIndex; 73 rtems_time_of_day when; 74 }; 75 76 extern struct taskSwitchLog taskSwitchLog[]; 77 extern int taskSwitchLogIndex; 78 volatile extern int testsFinished; 79 65 80 66 81 /* end of include file */ -
c/src/tests/libtests/cpuuse/task2.c
r2fbdbd4 r2c8485b 21 21 #include "system.h" 22 22 23 #include <rtems/cpuuse.h> 24 25 static void 26 showTaskSwitches (void) 27 { 28 int i; 29 int switches = taskSwitchLogIndex; 30 31 for (i = 0 ; i < switches ; i++) { 32 put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE ); 33 print_time( "- ", &taskSwitchLog[i].when, "\n" ); 34 } 35 } 36 23 37 rtems_task Task_2( 24 38 rtems_task_argument argument 25 39 ) 26 40 { 27 while( FOREVER ); 41 while ( !testsFinished ); 42 43 showTaskSwitches (); 44 CPU_usage_Dump(); 45 puts( "*** END OF CPU USAGE LIBRARY TEST ***" ); 46 exit( 0 ); 28 47 } -
c/src/tests/libtests/cpuuse/tswitch.c
r2fbdbd4 r2c8485b 23 23 #include "system.h" 24 24 25 #include <rtems/cpuuse.h> 25 struct taskSwitchLog taskSwitchLog[1000]; 26 int taskSwitchLogIndex; 27 volatile int testsFinished;; 26 28 27 29 rtems_extension Task_switch( … … 46 48 "rtems_clock_get", 1 ); 47 49 48 put_name( Task_name[ index ], FALSE ); 49 print_time( "- ", &time, "\n" ); 50 if (taskSwitchLogIndex < 51 (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) { 52 taskSwitchLog[taskSwitchLogIndex].taskIndex = index; 53 taskSwitchLog[taskSwitchLogIndex].when = time; 54 taskSwitchLogIndex++; 55 } 56 if ( time.second >= 16 ) 57 testsFinished = 1; 50 58 51 if ( time.second >= 16 ) {52 CPU_usage_Dump();53 puts( "*** END OF CPU USAGE LIBRARY TEST ***" );54 exit( 0 );55 }56 59 break; 57 60
Note: See TracChangeset
for help on using the changeset viewer.