Changeset baef6771 in rtems
- Timestamp:
- Sep 15, 2011, 2:34:21 PM (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 82db8e56
- Parents:
- e41cec3
- Location:
- cpukit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/ChangeLog
re41cec3 rbaef6771 1 2011-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 1 8 2011-09-14 Sebastian Huber <sebastian.huber@embedded-brains.de> 2 9 -
cpukit/libmisc/cpuuse/cpuusagedata.c
re41cec3 rbaef6771 16 16 #endif 17 17 18 #include <rtems.h>19 18 #include <rtems/cpuuse.h> 20 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__21 #include <rtems/score/timespec.h>22 #endif23 19 24 20 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 25 struct timespecCPU_usage_Uptime_at_last_reset;21 Timestamp_Control CPU_usage_Uptime_at_last_reset; 26 22 #else 27 23 uint32_t CPU_usage_Ticks_at_last_reset; -
cpukit/libmisc/cpuuse/cpuusagereport.c
re41cec3 rbaef6771 16 16 #endif 17 17 18 #include <rtems.h>19 20 18 #include <string.h> 21 19 #include <stdlib.h> … … 25 23 26 24 #include <rtems/cpuuse.h> 27 #include <rtems/bspIo.h>28 29 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__30 #include <rtems/score/timestamp.h>31 #endif32 33 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__34 extern Timestamp_Control CPU_usage_Uptime_at_last_reset;35 #else36 extern uint32_t CPU_usage_Ticks_at_last_reset;37 #endif38 25 39 26 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ … … 78 65 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 79 66 Timestamp_Control uptime, total, ran, uptime_at_last_reset; 67 uint32_t seconds, nanoseconds; 80 68 #else 81 69 uint32_t total_units = 0; … … 172 160 */ 173 161 162 seconds = _Timestamp_Get_seconds( &ran ); 163 nanoseconds = _Timestamp_Get_nanoseconds( &ran ) / 164 TOD_NANOSECONDS_PER_MICROSECOND; 174 165 (*print)( context, 175 166 "%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, 179 168 ival, fval 180 169 ); … … 205 194 206 195 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 196 seconds = _Timestamp_Get_seconds( &total ); 197 nanoseconds = _Timestamp_Get_nanoseconds( &total ) / 198 TOD_NANOSECONDS_PER_MICROSECOND; 207 199 (*print)( 208 200 context, … … 210 202 " TIME SINCE LAST CPU USAGE RESET IN SECONDS: %7" PRIu32 ".%06" PRIu32 "\n" 211 203 "-------------------------------------------------------------------------------\n", 212 _Timestamp_Get_seconds( &total ), 213 _Timestamp_Get_nanoseconds( &total ) / TOD_NANOSECONDS_PER_MICROSECOND 204 seconds, nanoseconds 214 205 ); 215 206 #else -
cpukit/libmisc/cpuuse/cpuusagereset.c
re41cec3 rbaef6771 15 15 #include "config.h" 16 16 #endif 17 18 #include <rtems.h>19 #include <rtems/score/timestamp.h>20 17 21 18 #include <stdlib.h> … … 37 34 38 35 /* 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 #else44 extern uint32_t CPU_usage_Ticks_at_last_reset;45 #endif46 47 /*48 36 * rtems_cpu_usage_reset 49 37 */ -
cpukit/libmisc/cpuuse/cpuuse.h
re41cec3 rbaef6771 20 20 #define __RTEMS_CPUUSE_h 21 21 22 #include <rtems.h> 22 23 #include <rtems/bspIo.h> 24 25 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 26 #include <rtems/score/timestamp.h> 27 #endif 23 28 24 29 #ifdef __cplusplus 25 30 extern "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; 26 37 #endif 27 38
Note: See TracChangeset
for help on using the changeset viewer.