forked from Imagelibrary/rtems
Eliminated printing from switch extension.
This commit is contained in:
@@ -1,24 +1,34 @@
|
|||||||
*** TEST 4 ***
|
*** CPU USAGE LIBRARY TEST ***
|
||||||
TA1 - 09:15:00 12/31/1988
|
|
||||||
TA1 - rtems_task_suspend - on Task 2
|
TA1 - rtems_task_suspend - on Task 2
|
||||||
TA1 - rtems_task_suspend - on Task 3
|
TA1 - rtems_task_suspend - on Task 3
|
||||||
TA1 - killing time
|
TA1 - killing time
|
||||||
TA1 - rtems_task_resume - on Task 2
|
TA1 - rtems_task_resume - on Task 2
|
||||||
TA1 - rtems_task_resume - on Task 3
|
TA1 - rtems_task_resume - on Task 3
|
||||||
TA2 - 09:15:03 12/31/1988
|
|
||||||
TA3 - 09:15:04 12/31/1988
|
|
||||||
TA1 - 09:15:05 12/31/1988
|
|
||||||
TA2 - 09:15:06 12/31/1988
|
|
||||||
TA3 - 09:15:07 12/31/1988
|
|
||||||
TA1 - 09:15:08 12/31/1988
|
|
||||||
TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
|
TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
|
||||||
TA1 - 09:15:09 12/31/1988
|
|
||||||
TA1 - 09:15:10 12/31/1988
|
TA1 - 09:15:10 12/31/1988
|
||||||
TA1 - 09:15:11 12/31/1988
|
TA1 - 09:15:11 12/31/1988
|
||||||
TA1 - 09:15:12 12/31/1988
|
TA1 - 09:15:12 12/31/1988
|
||||||
TA1 - 09:15:13 12/31/1988
|
TA1 - 09:15:13 12/31/1988
|
||||||
TA1 - 09:15:14 12/31/1988
|
TA1 - 09:15:14 12/31/1988
|
||||||
|
TA1 - 09:15:15 12/31/1988
|
||||||
TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
|
TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
|
||||||
TA2 - 09:15:15 12/31/1988
|
TA1 - 09:15:00 12/31/1988
|
||||||
TA3 - 09:15:16 12/31/1988
|
TA2 - 09:15:04 12/31/1988
|
||||||
*** END OF TEST 4 ***
|
TA3 - 09:15:05 12/31/1988
|
||||||
|
TA1 - 09:15:06 12/31/1988
|
||||||
|
TA2 - 09:15:07 12/31/1988
|
||||||
|
TA3 - 09:15:08 12/31/1988
|
||||||
|
TA1 - 09:15:09 12/31/1988
|
||||||
|
TA2 - 09:15:16 12/31/1988
|
||||||
|
CPU Usage by thread
|
||||||
|
ID NAME TICKS PERCENT
|
||||||
|
0x04010001 IDLE 0 0.000
|
||||||
|
0x08010002 TA1 1203 0.748
|
||||||
|
0x08010003 TA2 204 0.127
|
||||||
|
0x08010004 TA3 202 0.126
|
||||||
|
|
||||||
|
Ticks since last reset = 1601
|
||||||
|
|
||||||
|
Total Units = 1609
|
||||||
|
*** END OF CPU USAGE LIBRARY TEST ***
|
||||||
|
NOTE: Actual time per task will vary but there should be no IDLE time.
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ void Task_switch(
|
|||||||
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
|
||||||
|
|
||||||
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
|
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1
|
||||||
|
#define CONFIGURE_MAXIMUM_TASKS 4
|
||||||
#define CONFIGURE_TICKS_PER_TIMESLICE 100
|
#define CONFIGURE_TICKS_PER_TIMESLICE 100
|
||||||
|
|
||||||
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
|
||||||
@@ -63,4 +64,18 @@ TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */
|
|||||||
/* array of task run counts */
|
/* array of task run counts */
|
||||||
TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ];
|
TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keep track of task switches
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct taskSwitchLog {
|
||||||
|
int taskIndex;
|
||||||
|
rtems_time_of_day when;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct taskSwitchLog taskSwitchLog[];
|
||||||
|
extern int taskSwitchLogIndex;
|
||||||
|
volatile extern int testsFinished;
|
||||||
|
|
||||||
|
|
||||||
/* end of include file */
|
/* end of include file */
|
||||||
|
|||||||
@@ -20,9 +20,28 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
|
#include <rtems/cpuuse.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
showTaskSwitches (void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
int switches = taskSwitchLogIndex;
|
||||||
|
|
||||||
|
for (i = 0 ; i < switches ; i++) {
|
||||||
|
put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE );
|
||||||
|
print_time( "- ", &taskSwitchLog[i].when, "\n" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rtems_task Task_2(
|
rtems_task Task_2(
|
||||||
rtems_task_argument argument
|
rtems_task_argument argument
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
while( FOREVER );
|
while ( !testsFinished );
|
||||||
|
|
||||||
|
showTaskSwitches ();
|
||||||
|
CPU_usage_Dump();
|
||||||
|
puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
|
||||||
|
exit( 0 );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,9 @@
|
|||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include <rtems/cpuuse.h>
|
struct taskSwitchLog taskSwitchLog[1000];
|
||||||
|
int taskSwitchLogIndex;
|
||||||
|
volatile int testsFinished;;
|
||||||
|
|
||||||
rtems_extension Task_switch(
|
rtems_extension Task_switch(
|
||||||
rtems_tcb *unused,
|
rtems_tcb *unused,
|
||||||
@@ -45,14 +47,15 @@ rtems_extension Task_switch(
|
|||||||
fatal_directive_status_with_level( status, RTEMS_SUCCESSFUL,
|
fatal_directive_status_with_level( status, RTEMS_SUCCESSFUL,
|
||||||
"rtems_clock_get", 1 );
|
"rtems_clock_get", 1 );
|
||||||
|
|
||||||
put_name( Task_name[ index ], FALSE );
|
if (taskSwitchLogIndex <
|
||||||
print_time( "- ", &time, "\n" );
|
(sizeof taskSwitchLog / sizeof taskSwitchLog[0])) {
|
||||||
|
taskSwitchLog[taskSwitchLogIndex].taskIndex = index;
|
||||||
if ( time.second >= 16 ) {
|
taskSwitchLog[taskSwitchLogIndex].when = time;
|
||||||
CPU_usage_Dump();
|
taskSwitchLogIndex++;
|
||||||
puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
|
|
||||||
exit( 0 );
|
|
||||||
}
|
}
|
||||||
|
if ( time.second >= 16 )
|
||||||
|
testsFinished = 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user