summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-08-02 00:43:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-08-02 00:43:44 +0000
commitca5fe675bc1f7582ae1116c19c990053fd441286 (patch)
tree6041b3ee493122a8787df11441d312015617d087
parent8378eaecb1ec761ecc50e86366a8f5b8286bfacb (diff)
downloadrtems-ca5fe675bc1f7582ae1116c19c990053fd441286.tar.bz2
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.
-rw-r--r--c/src/libmisc/ChangeLog5
-rw-r--r--c/src/libmisc/cpuuse/cpuuse.c11
-rw-r--r--cpukit/libmisc/ChangeLog5
-rw-r--r--cpukit/libmisc/cpuuse/cpuuse.c11
4 files changed, 30 insertions, 2 deletions
diff --git a/c/src/libmisc/ChangeLog b/c/src/libmisc/ChangeLog
index a8ff87e9d3..464feca69f 100644
--- a/c/src/libmisc/ChangeLog
+++ b/c/src/libmisc/ChangeLog
@@ -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
diff --git a/c/src/libmisc/cpuuse/cpuuse.c b/c/src/libmisc/cpuuse/cpuuse.c
index 833681f4a0..c984b39751 100644
--- a/c/src/libmisc/cpuuse/cpuuse.c
+++ b/c/src/libmisc/cpuuse/cpuuse.c
@@ -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,
diff --git a/cpukit/libmisc/ChangeLog b/cpukit/libmisc/ChangeLog
index a8ff87e9d3..464feca69f 100644
--- a/cpukit/libmisc/ChangeLog
+++ b/cpukit/libmisc/ChangeLog
@@ -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
diff --git a/cpukit/libmisc/cpuuse/cpuuse.c b/cpukit/libmisc/cpuuse/cpuuse.c
index 833681f4a0..c984b39751 100644
--- a/cpukit/libmisc/cpuuse/cpuuse.c
+++ b/cpukit/libmisc/cpuuse/cpuuse.c
@@ -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,