forked from Imagelibrary/rtems
2002-08-01 Joel Sherrill <joel@OARcorp.com>
* cpuuse/cpuuse.c (CPU_usage_Dump) : Corrected so it honors when an object name is raw versus being a string.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2002-08-01 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* cpuuse/cpuuse.c (CPU_usage_Dump) : Corrected so it honors when an
|
||||
object name is raw versus being a string.
|
||||
|
||||
2002-07-30 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
* stackchk/check.c: Don't reference the RTEMS allocated interrupt
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <rtems/cpuuse.h>
|
||||
|
||||
@@ -74,7 +75,10 @@ void CPU_usage_Dump( void )
|
||||
if ( !the_thread )
|
||||
continue;
|
||||
|
||||
u32_name = *(unsigned32 *)the_thread->Object.name;
|
||||
if ( information->is_string )
|
||||
u32_name = *(unsigned32 *)the_thread->Object.name;
|
||||
else
|
||||
u32_name = (unsigned32)the_thread->Object.name;
|
||||
|
||||
name[ 0 ] = (u32_name >> 24) & 0xff;
|
||||
name[ 1 ] = (u32_name >> 16) & 0xff;
|
||||
@@ -82,6 +86,11 @@ void CPU_usage_Dump( void )
|
||||
name[ 3 ] = (u32_name >> 0) & 0xff;
|
||||
name[ 4 ] = '\0';
|
||||
|
||||
if ( !isprint(name[0]) ) name[0] = '*';
|
||||
if ( !isprint(name[1]) ) name[1] = '*';
|
||||
if ( !isprint(name[2]) ) name[2] = '*';
|
||||
if ( !isprint(name[3]) ) name[3] = '*';
|
||||
|
||||
#if defined(unix) || ( CPU_HARDWARE_FP == TRUE )
|
||||
printf( "0x%08x %4s %8d %5.3f\n",
|
||||
the_thread->Object.id,
|
||||
|
||||
Reference in New Issue
Block a user