Changeset b0ac06f8 in rtems
- Timestamp:
- 10/26/07 21:30:59 (16 years ago)
- Branches:
- 4.10, 4.11, 4.9, 5, master
- Children:
- 43e3429
- Parents:
- 0e87deaa
- Location:
- cpukit
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
r0e87deaa rb0ac06f8 1 2007-10-26 Glenn Humphrey <glenn.humphrey@OARcorp.com> 2 3 * libmisc/cpuuse/cpuusagereport.c, rtems/src/ratemonreportstatistics.c: 4 Cleaned up reports and fixed a bug related the printf format which 5 resulted in lack of leading zeroes and misleading magnitude. 6 * score/src/timespecdivide.c: Fixed bugs related to zero divide case. 7 1 8 2007-10-26 Joel Sherrill <joel.sherrill@OARcorp.com> 2 9 -
cpukit/libmisc/cpuuse/cpuusagereport.c
r0e87deaa rb0ac06f8 87 87 #endif 88 88 89 (*print)( context, "CPU Usage by thread\n" 89 90 #if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) 90 (*print)( context, "--- CPU Usage times are seconds:microseconds ---\n" ); 91 " ID NAME SECONDS PERCENT\n" 92 #else 93 " ID NAME TICKS PERCENT\n" 91 94 #endif 92 (*print)( context, "CPU Usage by thread\n"93 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS94 " ID NAME SECONDS PERCENT\n"95 #else96 " ID NAME TICKS PERCENT\n"97 #endif98 95 ); 99 96 … … 113 110 rtems_object_get_name( the_thread->Object.id, sizeof(name), name ); 114 111 115 (*print)( context, "0x%08" PRIx32 " %4s 112 (*print)( context, "0x%08" PRIx32 " %4s ", the_thread->Object.id, name ); 116 113 117 114 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS … … 135 132 136 133 (*print)( context, 137 "% 2" PRId32 ":%06" PRId32 " %3" PRId32 ".%02" PRId32 "\n",134 "%3" PRId32 ".%06" PRId32 " %3" PRId32 ".%03" PRId32 "\n", 138 135 ran.tv_sec, ran.tv_nsec / TOD_NANOSECONDS_PER_MICROSECOND, 139 136 ival, fval … … 145 142 ival /= 100; 146 143 (*print)( context, 147 "%8" PRId32 " 144 "%8" PRId32 " %3" PRId32 ".%02" PRId32"\n", 148 145 the_thread->ticks_executed, 149 146 ival, … … 166 163 _Watchdog_Ticks_since_boot - CPU_usage_Ticks_at_last_reset 167 164 ); 168 (*print)( context, "Total Units = %" PRId32 "\n \n", total_units );165 (*print)( context, "Total Units = %" PRId32 "\n", total_units ); 169 166 #endif 170 167 } -
cpukit/rtems/src/ratemonreportstatistics.c
r0e87deaa rb0ac06f8 30 30 #define NANOSECONDS_DIVIDER 1000 31 31 #define PERCENT_FMT "%04" PRId32 32 #define NANOSECONDS_FMT "% " PRId3232 #define NANOSECONDS_FMT "%06" PRId32 33 33 #endif 34 34 … … 56 56 57 57 (*print)( context, "Period information by period\n" ); 58 #if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) 59 (*print)( context, "--- CPU times are in seconds ---\n" ); 60 #endif 58 61 #if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) 59 (*print)( context, "--- Period times are seconds:microseconds ---\n" ); 60 #endif 61 62 #if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) 63 (*print)( context, "--- CPU Usage times are seconds:microseconds ---\n" ); 62 (*print)( context, "--- Wall times are in seconds ---\n" ); 64 63 #endif 65 64 /* … … 72 71 Uncomment the following if you are tinkering with the formatting. 73 72 Be sure to test the various cases. 74 */75 73 (*print)( context,"\ 76 74 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ 77 75 \n"); 78 (*print)( context, " ID OWNER COUNT MISSED CPU TIME " 76 */ 77 (*print)( context, " ID OWNER COUNT MISSED " 78 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS 79 " " 80 #endif 81 "CPU TIME " 79 82 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS 80 83 " " 81 84 #endif 82 85 #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS 83 " "86 " " 84 87 #endif 85 88 " WALL TIME\n" 89 ); 90 (*print)( context, " " 91 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS 92 " " 93 #endif 94 "MIN/MAX/AVG " 95 #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS 96 " " 97 #endif 98 #ifdef RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS 99 " " 100 #endif 101 " MIN/MAX/AVG\n" 86 102 ); 87 103 … … 101 117 if ( status != RTEMS_SUCCESSFUL ) 102 118 continue; 103 104 if ( the_stats.count == 0 )105 continue;106 119 107 120 name[ 0 ] = '\0'; … … 122 135 123 136 /* 137 * If the count is zero, don't print statistics 138 */ 139 140 if (the_stats.count == 0) { 141 (*print)( context, "\n" ); 142 continue; 143 } 144 145 /* 124 146 * print CPU Usage part of statistics 125 147 */ … … 134 156 ); 135 157 (*print)( context, 136 "%" PRId32 " :" NANOSECONDS_FMT "/" /* min cpu time */137 "%" PRId32 " :" NANOSECONDS_FMT "/" /* max cpu time */138 "%" PRId32 " :" NANOSECONDS_FMT " ", /* avg cpu time */158 "%" PRId32 "." NANOSECONDS_FMT "/" /* min cpu time */ 159 "%" PRId32 "." NANOSECONDS_FMT "/" /* max cpu time */ 160 "%" PRId32 "." NANOSECONDS_FMT " ", /* avg cpu time */ 139 161 the_stats.min_cpu_time.tv_sec, 140 162 the_stats.min_cpu_time.tv_nsec / NANOSECONDS_DIVIDER, … … 170 192 ); 171 193 (*print)( context, 172 "%" PRId32 " :" PERCENT_FMT "/" /* min wall time */173 "%" PRId32 " :" PERCENT_FMT "/" /* max wall time */174 "%" PRId32 " :" PERCENT_FMT "\n", /* avg wall time */194 "%" PRId32 "." NANOSECONDS_FMT "/" /* min wall time */ 195 "%" PRId32 "." NANOSECONDS_FMT "/" /* max wall time */ 196 "%" PRId32 "." NANOSECONDS_FMT "\n", /* avg wall time */ 175 197 the_stats.min_wall_time.tv_sec, 176 198 the_stats.min_wall_time.tv_nsec / NANOSECONDS_DIVIDER, -
cpukit/score/src/timespecdivide.c
r0e87deaa rb0ac06f8 43 43 right += rhs->tv_nsec; 44 44 45 if ( r hs== 0 ) {45 if ( right == 0 ) { 46 46 *ival_percentage = 0; 47 * ival_percentage = 0;47 *fval_percentage = 0; 48 48 return; 49 49 } 50 50 51 51 /* 52 * Put it back in the timespec result 52 * Put it back in the timespec result. 53 * 54 * TODO: Rounding on the last digit of the fval. 53 55 */ 54 56 55 57 answer = (left * 100000) / right; 56 58 59 *ival_percentage = answer / 1000; 57 60 *fval_percentage = answer % 1000; 58 *ival_percentage = answer / 1000;59 61 }
Note: See TracChangeset
for help on using the changeset viewer.