forked from Imagelibrary/rtems
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.
This commit is contained in:
33
cpukit/libmisc/cpuuse/cpuusagedata.c
Normal file
33
cpukit/libmisc/cpuuse/cpuusagedata.c
Normal file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user