diff options
author | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2009-12-02 18:15:16 +0000 |
---|---|---|
committer | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2009-12-02 18:15:16 +0000 |
commit | c6f7e060eaeb951a86dc640855e88c6f8260a347 (patch) | |
tree | 7d6ef3b0be5fec6206861601980974b5749baa04 /cpukit/libmisc/cpuuse | |
parent | 2009-12-02 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-c6f7e060eaeb951a86dc640855e88c6f8260a347.tar.bz2 |
2009-12-02 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* configure.ac, libcsupport/src/__times.c,
libmisc/cpuuse/cpuusagedata.c, libmisc/cpuuse/cpuusagereport.c,
libmisc/cpuuse/cpuusagereset.c, rtems/include/rtems/rtems/ratemon.h,
rtems/include/rtems/rtems/types.h, rtems/src/ratemongetstatistics.c,
rtems/src/ratemongetstatus.c, rtems/src/ratemonperiod.c,
rtems/src/ratemonreportstatistics.c,
score/include/rtems/score/thread.h, score/src/threaddispatch.c,
score/src/threadinitialize.c, score/src/threadtickletimeslice.c:
Changed the configuration of statistics granularity to use just one
define.
Diffstat (limited to 'cpukit/libmisc/cpuuse')
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagedata.c | 9 | ||||
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagereport.c | 16 | ||||
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagereset.c | 7 |
3 files changed, 13 insertions, 19 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagedata.c b/cpukit/libmisc/cpuuse/cpuusagedata.c index 277d7f9c5e..8a09bacc8a 100644 --- a/cpukit/libmisc/cpuuse/cpuusagedata.c +++ b/cpukit/libmisc/cpuuse/cpuusagedata.c @@ -16,18 +16,13 @@ #endif #include <rtems.h> - #include <rtems/cpuuse.h> - -#if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) || \ - defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) +#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ #include <rtems/score/timespec.h> - #endif -#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS +#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec CPU_usage_Uptime_at_last_reset; #else uint32_t CPU_usage_Ticks_at_last_reset; #endif - diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c index 6d916e1cc0..84ee21fc07 100644 --- a/cpukit/libmisc/cpuuse/cpuusagereport.c +++ b/cpukit/libmisc/cpuuse/cpuusagereport.c @@ -27,11 +27,11 @@ #include <rtems/cpuuse.h> #include <rtems/bspIo.h> -#if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) +#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ #include <rtems/score/timestamp.h> #endif -#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS +#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ extern Timestamp_Control CPU_usage_Uptime_at_last_reset; #else extern uint32_t CPU_usage_Ticks_at_last_reset; @@ -53,7 +53,7 @@ void rtems_cpu_usage_report_with_plugin( Objects_Information *information; char name[13]; uint32_t ival, fval; - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime, total, ran; #else uint32_t total_units = 0; @@ -67,7 +67,7 @@ void rtems_cpu_usage_report_with_plugin( * the number of "ticks" we gave credit for to give the user a rough * guideline as to what each number means proportionally. */ - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( &CPU_usage_Uptime_at_last_reset, &uptime, &total ); #else @@ -91,7 +91,7 @@ void rtems_cpu_usage_report_with_plugin( "-------------------------------------------------------------------------------\n" " CPU USAGE BY THREAD\n" "------------+----------------------------------------+---------------+---------\n" - #if defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " ID | NAME | SECONDS | PERCENT\n" #else " ID | NAME | TICKS | PERCENT\n" @@ -121,7 +121,7 @@ void rtems_cpu_usage_report_with_plugin( name ); - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ /* * If this is the currently executing thread, account for time * since the last context switch. @@ -152,7 +152,7 @@ void rtems_cpu_usage_report_with_plugin( uint64_t ival_64; ival_64 = the_thread->cpu_time_used; - ival_64 *= 10000; + ival_64 *= 100000; ival = ival_64 / total_units; } else { ival = 0; @@ -171,7 +171,7 @@ void rtems_cpu_usage_report_with_plugin( } } - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "------------+----------------------------------------+---------------+---------\n" diff --git a/cpukit/libmisc/cpuuse/cpuusagereset.c b/cpukit/libmisc/cpuuse/cpuusagereset.c index 233631dda2..80c041e3fe 100644 --- a/cpukit/libmisc/cpuuse/cpuusagereset.c +++ b/cpukit/libmisc/cpuuse/cpuusagereset.c @@ -28,18 +28,17 @@ static void CPU_usage_Per_thread_handler( Thread_Control *the_thread ) { - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); #else the_thread->cpu_time_used = 0; #endif } - /* * External data that is shared by cpu usage code but not declared in .h files. */ -#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS +#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ extern Timestamp_Control CPU_usage_Uptime_at_last_reset; #else extern uint32_t CPU_usage_Ticks_at_last_reset; @@ -50,7 +49,7 @@ static void CPU_usage_Per_thread_handler( */ void rtems_cpu_usage_reset( void ) { - #ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &CPU_usage_Uptime_at_last_reset ); _Thread_Time_of_last_context_switch = CPU_usage_Uptime_at_last_reset; #else |