diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-18 21:31:49 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-18 21:31:49 +0000 |
commit | 793dd46d64ec6e0fac46395cdf53cf053366b93e (patch) | |
tree | 33ad52b4cd81cacb37143ba8550a58296b078724 /cpukit/libmisc/cpuuse/cpuusagedata.c | |
parent | 2007-07-18 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-793dd46d64ec6e0fac46395cdf53cf053366b93e.tar.bz2 |
2007-07-18 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/Makefile.am, libmisc/cpuuse/cpuusagereport.c,
libmisc/cpuuse/cpuusagereset.c: Fix bug where cpu usage calculation
was always using uptime not time since last cpu usage reset when
using nanoseconds granularity.
* libmisc/cpuuse/cpuusagedata.c: New file.
Diffstat (limited to 'cpukit/libmisc/cpuuse/cpuusagedata.c')
-rw-r--r-- | cpukit/libmisc/cpuuse/cpuusagedata.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cpukit/libmisc/cpuuse/cpuusagedata.c b/cpukit/libmisc/cpuuse/cpuusagedata.c new file mode 100644 index 0000000000..277d7f9c5e --- /dev/null +++ b/cpukit/libmisc/cpuuse/cpuusagedata.c @@ -0,0 +1,33 @@ +/* + * CPU Usage Reporter - Shared Data + * + * COPYRIGHT (c) 1989-2007 + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * http://www.rtems.com/license/LICENSE. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <rtems.h> + +#include <rtems/cpuuse.h> + +#if defined(RTEMS_ENABLE_NANOSECOND_RATE_MONOTONIC_STATISTICS) || \ + defined(RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS) + #include <rtems/score/timespec.h> + +#endif + +#ifdef RTEMS_ENABLE_NANOSECOND_CPU_USAGE_STATISTICS + struct timespec CPU_usage_Uptime_at_last_reset; +#else + uint32_t CPU_usage_Ticks_at_last_reset; +#endif + |