Changeset baef6771 in rtems


Ignore:
Timestamp:
Sep 15, 2011, 2:34:21 PM (9 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.
Location:
cpukit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    re41cec3 rbaef6771  
     12011-09-15      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * cpukit/libmisc/cpuuse/cpuuse.h,
     4        cpukit/libmisc/cpuuse/cpuusagedata.c,
     5        cpukit/libmisc/cpuuse/cpuusagereport.c,
     6        cpukit/libmisc/cpuuse/cpuusagereset.c: Fixed timestamp usage.
     7
    182011-09-14      Sebastian Huber <sebastian.huber@embedded-brains.de>
    29
  • cpukit/libmisc/cpuuse/cpuusagedata.c

    re41cec3 rbaef6771  
    1616#endif
    1717
    18 #include <rtems.h>
    1918#include <rtems/cpuuse.h>
    20 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    21   #include <rtems/score/timespec.h>
    22 #endif
    2319
    2420#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    25   struct timespec    CPU_usage_Uptime_at_last_reset;
     21  Timestamp_Control  CPU_usage_Uptime_at_last_reset;
    2622#else
    2723  uint32_t           CPU_usage_Ticks_at_last_reset;
  • 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
  • cpukit/libmisc/cpuuse/cpuusagereset.c

    re41cec3 rbaef6771  
    1515#include "config.h"
    1616#endif
    17 
    18 #include <rtems.h>
    19 #include <rtems/score/timestamp.h>
    2017
    2118#include <stdlib.h>
     
    3734
    3835/*
    39  * External data that is shared by cpu usage code but not declared in .h files.
    40  */
    41 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
    42   extern Timestamp_Control CPU_usage_Uptime_at_last_reset;
    43 #else
    44   extern uint32_t   CPU_usage_Ticks_at_last_reset;
    45 #endif
    46 
    47 /*
    4836 *  rtems_cpu_usage_reset
    4937 */
  • cpukit/libmisc/cpuuse/cpuuse.h

    re41cec3 rbaef6771  
    2020#define __RTEMS_CPUUSE_h
    2121
     22#include <rtems.h>
    2223#include <rtems/bspIo.h>
     24
     25#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
     26  #include <rtems/score/timestamp.h>
     27#endif
    2328
    2429#ifdef __cplusplus
    2530extern "C" {
     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;
    2637#endif
    2738
Note: See TracChangeset for help on using the changeset viewer.