diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2002-07-01 22:19:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2002-07-01 22:19:33 +0000 |
commit | 63977bb4d3d7dc0d556d63a386ac74c21ec4ebd3 (patch) | |
tree | 4c3a4ea9678d027e769f0e5ab2d3a48f5c52b625 /c/src/libmisc/cpuuse | |
parent | 2002-07-01 Joel Sherrill <joel@OARcorp.com> (diff) | |
download | rtems-63977bb4d3d7dc0d556d63a386ac74c21ec4ebd3.tar.bz2 |
2002-07-01 Joel Sherrill <joel@OARcorp.com>
* capture/capture-cli.c, cpuuse/cpuuse.c, monitor/mon-monitor.c,
monitor/mon-object.c, monitor/monitor.h: Corrected use of
_Objects_Information_table now that it is a two dimensional
array based upon API and class. In addition, in the monitor,
corrected an error which occured when a target has 64 bit pointers.
Diffstat (limited to 'c/src/libmisc/cpuuse')
-rw-r--r-- | c/src/libmisc/cpuuse/cpuuse.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/c/src/libmisc/cpuuse/cpuuse.c b/c/src/libmisc/cpuuse/cpuuse.c index 66c006e3d3..833681f4a0 100644 --- a/c/src/libmisc/cpuuse/cpuuse.c +++ b/c/src/libmisc/cpuuse/cpuuse.c @@ -31,18 +31,20 @@ unsigned32 CPU_usage_Ticks_at_last_reset; void CPU_usage_Dump( void ) { unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; Objects_Information *information; unsigned32 u32_name; char name[5]; unsigned32 total_units = 0; - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1 ; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; @@ -59,11 +61,13 @@ void CPU_usage_Dump( void ) printf( " ID NAME TICKS\n" ); #endif - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1 ; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; @@ -113,17 +117,19 @@ void CPU_usage_Dump( void ) void CPU_usage_Reset( void ) { unsigned32 i; - unsigned32 class_index; + unsigned32 api_index; Thread_Control *the_thread; Objects_Information *information; CPU_usage_Ticks_at_last_reset = _Watchdog_Ticks_since_boot; - for ( class_index = OBJECTS_CLASSES_FIRST ; - class_index <= OBJECTS_CLASSES_LAST ; - class_index++ ) { - information = _Objects_Information_table[ class_index ]; - if ( information && information->is_thread ) { + for ( api_index = 1 ; + api_index <= OBJECTS_APIS_LAST ; + api_index++ ) { + if ( !_Objects_Information_table[ api_index ] ) + continue; + information = _Objects_Information_table[ api_index ][ 1 ]; + if ( information ) { for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; |