Files
rtems/testsuites/libtests/cpuuse/task2.c
Joel Sherrill 016a926def 2002-08-01 Joel Sherrill <joel@OARcorp.com>
* Per PR47 add support for buffered test output.  This involved
	adding defines to redirect output to a buffer and dump it when
	full, at "test pause", and at exit.  To avoid problems when redefining
	exit(), all tests were modified to call rtems_test_exit().
	Some tests, notable psxtests, had to be modified to include
	the standard test macro .h file (pmacros.h or tmacros.h) to
	enable this support.
	* cpuuse/task2.c, malloctest/task1.c, putenvtest/init.c,
	rtmonuse/task1.c, termios/init.c: Modified.
2002-08-02 00:55:27 +00:00

48 lines
976 B
C

/* Task_2
*
* This routine serves as a test task. It is just a CPU bound task
* requiring timesliced operation.
*
* Input parameters:
* argument - task argument
*
* Output parameters: NONE
*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.OARcorp.com/rtems/license.html.
*
* $Id$
*/
#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_argument argument
)
{
while ( !testsFinished );
showTaskSwitches ();
CPU_usage_Dump();
puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
rtems_test_exit( 0 );
}