Changeset bf89c76 in rtems


Ignore:
Timestamp:
Nov 17, 2006, 10:55:51 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
d056acd0
Parents:
336227d
Message:

2006-11-17 Joel Sherrill <joel@…>

  • libmisc/rtmonuse/rtmonuse.c: Do not use float for calculations.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r336227d rbf89c76  
     12006-11-17      Joel Sherrill <joel@OARcorp.com>
     2
     3        * libmisc/rtmonuse/rtmonuse.c: Do not use float for calculations.
     4
    152006-11-17      Joel Sherrill <joel@OARcorp.com>
    26
  • cpukit/libmisc/rtmonuse/rtmonuse.c

    r336227d rbf89c76  
    136136  char                    name[5];
    137137  uint32_t                api_index;
     138  uint32_t                ival_cpu, fval_cpu;
     139  uint32_t                ival_wall, fval_wall;
    138140  Objects_Information    *information;
    139141
     
    143145  }
    144146
    145   fprintf(stdout, "Period information by period\n" );
    146   fprintf(stdout, "   ID      OWNER   PERIODS  MISSED    CPU TIME    WALL TIME\n" );
     147  fprintf(stdout,
     148    "Period information by period\n"
     149   "   ID      OWNER   PERIODS  MISSED    CPU TIME    WALL TIME\n"
     150  );
    147151
    148152  /*
     
    193197
    194198
     199    ival_cpu = the_usage->total_cpu_time * 100 / the_usage->count;
     200    fval_cpu = ival_cpu % 100;
     201    ival_cpu /= 100;
     202    ival_wall = the_usage->total_wall_time * 100 / the_usage->count;
     203    fval_wall = ival_wall % 100;
     204    ival_wall /= 100;
    195205    fprintf(stdout,
    196       "0x%08" PRIx32 "  %4s   %6" PRId32 "   %3" PRId32 "       %" PRId32
    197          "/%" PRId32 "/%5.2f    %" PRId32 "/%" PRId32 "/%3.2f\n",
     206      "0x%08" PRIx32 "  %4s   %6" PRId32 "   %3" PRId32 "       "
     207         "%" PRId32 "/%" PRId32 "/%" PRId32 ".%02" PRId32 "    "
     208         "%" PRId32 "/%" PRId32 "/%" PRId32 ".%02" PRId32 "\n",
    198209      the_usage->id,
    199210      name,
    200211      the_usage->count,
    201212      the_usage->missed_count,
     213
    202214      the_usage->min_cpu_time,
    203215      the_usage->max_cpu_time,
    204       (double) the_usage->total_cpu_time / (double) the_usage->count,
     216      ival_cpu, fval_cpu,
     217      /* (double) the_usage->total_cpu_time / (double) the_usage->count, */
     218
    205219      the_usage->min_wall_time,
    206220      the_usage->max_wall_time,
    207       (double) the_usage->total_wall_time / (double) the_usage->count
     221      ival_wall, fval_wall
     222      /* (double) the_usage->total_wall_time / (double) the_usage->count */
    208223    );
    209224  }
Note: See TracChangeset for help on using the changeset viewer.