mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
* 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.
34 lines
741 B
C
34 lines
741 B
C
/*
|
|
* 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
|
|
|