##// END OF EJS Templates
Fixed again CPU usage measurement...
Fixed again CPU usage measurement Previous fix was still wrong, now we call all the time rtems_cpu_usage_reset to only get stats since last measurement. All previous versions were also wrong since they use to send cpu usage with 100=100% instead of 255=100%.

File last commit:

r381:a9b894b0ab6a 3.2.0.19 No PWD scrub with...
r381:a9b894b0ab6a 3.2.0.19 No PWD scrub with...
Show More
lfr_cpu_usage_report.h
38 lines | 797 B | text/x-c | CLexer
/ header / lfr_cpu_usage_report.h
#ifndef LFR_CPU_USAGE_REPORT_H
#define LFR_CPU_USAGE_REPORT_H
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <inttypes.h>
#include <rtems/cpuuse.h>
#include <rtems/bspIo.h>
#ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
#include <rtems/score/timestamp.h>
#endif
#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;
#endif
unsigned char lfr_rtems_cpu_usage_report( void );
#define CONST_10 10
#define CONST_100 100
#define CONST_255 255
#define CONST_1000 1000
#define CONST_100000 100000
#endif // LFR_CPU_USAGE_REPORT_H