Changeset 2c8485b in rtems


Ignore:
Timestamp:
05/24/00 15:37:32 (23 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
70f1f1d9
Parents:
2fbdbd4
Message:

Eliminated printing from switch extension.

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 ***
    32TA1 - rtems_task_suspend - on Task 2
    43TA1 - rtems_task_suspend - on Task 3
     
    65TA1 - rtems_task_resume - on Task 2
    76TA1 - rtems_task_resume - on Task 3
    8 TA2 - 09:15:03   12/31/1988
    9 TA3 - 09:15:04   12/31/1988
    10 TA1 - 09:15:05   12/31/1988
    11 TA2 - 09:15:06   12/31/1988
    12 TA3 - 09:15:07   12/31/1988
    13 TA1 - 09:15:08   12/31/1988
    147TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
    15 TA1 - 09:15:09   12/31/1988
    168TA1 - 09:15:10   12/31/1988
    179TA1 - 09:15:11   12/31/1988
     
    1911TA1 - 09:15:13   12/31/1988
    2012TA1 - 09:15:14   12/31/1988
     13TA1 - 09:15:15   12/31/1988
    2114TA1 - 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 ***
     15TA1 - 09:15:00   12/31/1988
     16TA2 - 09:15:04   12/31/1988
     17TA3 - 09:15:05   12/31/1988
     18TA1 - 09:15:06   12/31/1988
     19TA2 - 09:15:07   12/31/1988
     20TA3 - 09:15:08   12/31/1988
     21TA1 - 09:15:09   12/31/1988
     22TA2 - 09:15:16   12/31/1988
     23CPU Usage by thread
     24   ID        NAME        TICKS    PERCENT
     250x04010001   IDLE           0     0.000
     260x08010002   TA1         1203     0.748
     270x08010003   TA2          204     0.127
     280x08010004   TA3          202     0.126
     29
     30Ticks since last reset = 1601
     31
     32Total Units = 1609
     33*** END OF CPU USAGE LIBRARY TEST ***
     34NOTE: Actual time per task will vary but there should be no IDLE time.
  • c/src/tests/libtests/cpuuse/system.h

    r2fbdbd4 r2c8485b  
    4545
    4646#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     1
     47#define CONFIGURE_MAXIMUM_TASKS               4
    4748#define CONFIGURE_TICKS_PER_TIMESLICE       100
    4849
     
    6364/* array of task run counts */
    6465TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; 
     66
     67/*
     68 * Keep track of task switches
     69 */
     70
     71struct taskSwitchLog {
     72  int               taskIndex;
     73  rtems_time_of_day when;
     74};
     75
     76extern struct taskSwitchLog taskSwitchLog[];
     77extern int taskSwitchLogIndex;
     78volatile extern int testsFinished;
     79
    6580 
    6681/* end of include file */
  • c/src/tests/libtests/cpuuse/task2.c

    r2fbdbd4 r2c8485b  
    2121#include "system.h"
    2222
     23#include <rtems/cpuuse.h>
     24
     25static void
     26showTaskSwitches (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
    2337rtems_task Task_2(
    2438  rtems_task_argument argument
    2539)
    2640{
    27   while( FOREVER );
     41  while ( !testsFinished );
     42
     43  showTaskSwitches ();
     44  CPU_usage_Dump();
     45  puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
     46  exit( 0 );
    2847}
  • c/src/tests/libtests/cpuuse/tswitch.c

    r2fbdbd4 r2c8485b  
    2323#include "system.h"
    2424
    25 #include <rtems/cpuuse.h>
     25struct taskSwitchLog taskSwitchLog[1000];
     26int taskSwitchLogIndex;
     27volatile int testsFinished;;
    2628
    2729rtems_extension Task_switch(
     
    4648                                         "rtems_clock_get", 1 );
    4749
    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;
    5058
    51       if ( time.second >= 16 ) {
    52         CPU_usage_Dump();
    53         puts( "*** END OF CPU USAGE LIBRARY TEST ***" );
    54         exit( 0 );
    55       }
    5659      break;
    5760
Note: See TracChangeset for help on using the changeset viewer.