Ignore:
Timestamp:
Sep 15, 2011, 2:34:21 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
82db8e56
Parents:
e41cec3
Message:

2011-09-15 Sebastian Huber <sebastian.huber@…>

  • cpukit/libmisc/cpuuse/cpuuse.h, cpukit/libmisc/cpuuse/cpuusagedata.c, cpukit/libmisc/cpuuse/cpuusagereport.c, cpukit/libmisc/cpuuse/cpuusagereset.c: Fixed timestamp usage.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/cpuuse/cpuusagereport.c

    re41cec3 rbaef6771  
    1616#endif
    1717
    18 #include <rtems.h>
    19 
    2018#include <string.h>
    2119#include <stdlib.h>
     
    2523
    2624#include <rtems/cpuuse.h>
    27 #include <rtems/bspIo.h>
    28 
    29 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    30   #include <rtems/score/timestamp.h>
    31 #endif
    32 
    33 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    34   extern Timestamp_Control  CPU_usage_Uptime_at_last_reset;
    35 #else
    36   extern uint32_t           CPU_usage_Ticks_at_last_reset;
    37 #endif
    3825
    3926#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
     
    7865  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    7966    Timestamp_Control  uptime, total, ran, uptime_at_last_reset;
     67    uint32_t seconds, nanoseconds;
    8068  #else
    8169    uint32_t           total_units = 0;
     
    172160           */
    173161
     162          seconds = _Timestamp_Get_seconds( &ran );
     163          nanoseconds = _Timestamp_Get_nanoseconds( &ran ) /
     164            TOD_NANOSECONDS_PER_MICROSECOND;
    174165          (*print)( context,
    175166            "%7" PRIu32 ".%06" PRIu32 " |%4" PRIu32 ".%03" PRIu32 "\n",
    176             _Timestamp_Get_seconds( &ran ),
    177             _Timestamp_Get_nanoseconds( &ran ) /
    178                TOD_NANOSECONDS_PER_MICROSECOND,
     167            seconds, nanoseconds,
    179168            ival, fval
    180169          );
     
    205194
    206195  #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
     196    seconds = _Timestamp_Get_seconds( &total );
     197    nanoseconds = _Timestamp_Get_nanoseconds( &total ) /
     198      TOD_NANOSECONDS_PER_MICROSECOND;
    207199    (*print)(
    208200       context,
     
    210202       " TIME SINCE LAST CPU USAGE RESET IN SECONDS:                    %7" PRIu32 ".%06" PRIu32 "\n"
    211203       "-------------------------------------------------------------------------------\n",
    212        _Timestamp_Get_seconds( &total ),
    213        _Timestamp_Get_nanoseconds( &total ) / TOD_NANOSECONDS_PER_MICROSECOND
     204       seconds, nanoseconds
    214205    );
    215206  #else
Note: See TracChangeset for help on using the changeset viewer.