mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 07:25:26 +08:00
score: Delete Thread_CPU_usage_t
This type is superfluous since all operations with it are done via the _Timestamp_*() functions.
This commit is contained in:
@@ -62,7 +62,7 @@ typedef struct
|
||||
volatile uint32_t poll_rate_usecs;
|
||||
volatile uint32_t show;
|
||||
rtems_cpu_usage_plugin plugin;
|
||||
Thread_CPU_usage_t zero;
|
||||
Timestamp_Control zero;
|
||||
Timestamp_Control uptime;
|
||||
Timestamp_Control last_uptime;
|
||||
Timestamp_Control period;
|
||||
@@ -71,9 +71,9 @@ typedef struct
|
||||
int task_size; /* The size of the arrays */
|
||||
Thread_Control** tasks; /* List of tasks in this sample. */
|
||||
Thread_Control** last_tasks; /* List of tasks in the last sample. */
|
||||
Thread_CPU_usage_t* usage; /* Usage of task's in this sample. */
|
||||
Thread_CPU_usage_t* last_usage; /* Usage of task's in the last sample. */
|
||||
Thread_CPU_usage_t* current_usage; /* Current usage for this sample. */
|
||||
Timestamp_Control* usage; /* Usage of task's in this sample. */
|
||||
Timestamp_Control* last_usage; /* Usage of task's in the last sample. */
|
||||
Timestamp_Control* current_usage; /* Current usage for this sample. */
|
||||
Timestamp_Control total; /* Total run run, should equal the uptime. */
|
||||
Timestamp_Control idle; /* Time spent in idle. */
|
||||
Timestamp_Control current; /* Current time run in this period. */
|
||||
@@ -218,8 +218,8 @@ static void
|
||||
task_usage(Thread_Control* thread, void* arg)
|
||||
{
|
||||
rtems_cpu_usage_data* data = (rtems_cpu_usage_data*) arg;
|
||||
Thread_CPU_usage_t usage = thread->cpu_time_used;
|
||||
Thread_CPU_usage_t current = data->zero;
|
||||
Timestamp_Control usage = thread->cpu_time_used;
|
||||
Timestamp_Control current = data->zero;
|
||||
int j;
|
||||
|
||||
data->stack_size += thread->Start.Initial_stack.size;
|
||||
@@ -333,7 +333,7 @@ rtems_cpuusage_top_thread (rtems_task_argument arg)
|
||||
rtems_iterate_over_all_threads_2(task_counter, data);
|
||||
|
||||
tasks_size = sizeof(Thread_Control*) * (data->task_count + 1);
|
||||
usage_size = sizeof(Thread_CPU_usage_t) * (data->task_count + 1);
|
||||
usage_size = sizeof(Timestamp_Control) * (data->task_count + 1);
|
||||
|
||||
if (data->task_count > data->task_size)
|
||||
{
|
||||
|
||||
@@ -156,11 +156,11 @@ typedef struct {
|
||||
uint32_t missed_count;
|
||||
|
||||
/** This field contains the least amount of CPU time used in a period. */
|
||||
Thread_CPU_usage_t min_cpu_time;
|
||||
Timestamp_Control min_cpu_time;
|
||||
/** This field contains the highest amount of CPU time used in a period. */
|
||||
Thread_CPU_usage_t max_cpu_time;
|
||||
Timestamp_Control max_cpu_time;
|
||||
/** This field contains the total amount of wall time used in a period. */
|
||||
Thread_CPU_usage_t total_cpu_time;
|
||||
Timestamp_Control total_cpu_time;
|
||||
|
||||
/** This field contains the least amount of wall time used in a period. */
|
||||
Rate_monotonic_Period_time_t min_wall_time;
|
||||
@@ -226,7 +226,7 @@ typedef struct {
|
||||
* the period was initiated. It is used to compute the period's
|
||||
* statistics.
|
||||
*/
|
||||
Thread_CPU_usage_t cpu_usage_period_initiated;
|
||||
Timestamp_Control cpu_usage_period_initiated;
|
||||
|
||||
/**
|
||||
* This field contains the wall time value when the period
|
||||
|
||||
@@ -161,7 +161,7 @@ void _Rate_monotonic_Timeout(
|
||||
bool _Rate_monotonic_Get_status(
|
||||
Rate_monotonic_Control *the_period,
|
||||
Rate_monotonic_Period_time_t *wall_since_last_period,
|
||||
Thread_CPU_usage_t *cpu_since_last_period
|
||||
Timestamp_Control *cpu_since_last_period
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -31,7 +31,7 @@ rtems_status_code rtems_rate_monotonic_get_status(
|
||||
rtems_rate_monotonic_period_status *status
|
||||
)
|
||||
{
|
||||
Thread_CPU_usage_t executed;
|
||||
Timestamp_Control executed;
|
||||
Objects_Locations location;
|
||||
Rate_monotonic_Period_time_t since_last_period;
|
||||
Rate_monotonic_Control *the_period;
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
bool _Rate_monotonic_Get_status(
|
||||
Rate_monotonic_Control *the_period,
|
||||
Rate_monotonic_Period_time_t *wall_since_last_period,
|
||||
Thread_CPU_usage_t *cpu_since_last_period
|
||||
Timestamp_Control *cpu_since_last_period
|
||||
)
|
||||
{
|
||||
Timestamp_Control uptime;
|
||||
Thread_Control *owning_thread = the_period->owner;
|
||||
Thread_CPU_usage_t used;
|
||||
Timestamp_Control used;
|
||||
|
||||
/*
|
||||
* Determine elapsed wall time since period initiated.
|
||||
@@ -49,7 +49,7 @@ bool _Rate_monotonic_Get_status(
|
||||
|
||||
if (owning_thread == _Thread_Executing) {
|
||||
|
||||
Thread_CPU_usage_t ran;
|
||||
Timestamp_Control ran;
|
||||
|
||||
/* How much time time since last context switch */
|
||||
_Timestamp_Subtract(
|
||||
@@ -120,7 +120,7 @@ static void _Rate_monotonic_Update_statistics(
|
||||
Rate_monotonic_Control *the_period
|
||||
)
|
||||
{
|
||||
Thread_CPU_usage_t executed;
|
||||
Timestamp_Control executed;
|
||||
Rate_monotonic_Period_time_t since_last_period;
|
||||
Rate_monotonic_Statistics *stats;
|
||||
bool valid_status;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <rtems/score/stack.h>
|
||||
#include <rtems/score/states.h>
|
||||
#include <rtems/score/threadq.h>
|
||||
#include <rtems/score/timestamp.h>
|
||||
#include <rtems/score/watchdog.h>
|
||||
|
||||
#if defined(RTEMS_SMP)
|
||||
@@ -82,14 +83,6 @@ extern "C" {
|
||||
#define RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The user can define this at configure time and go back to ticks
|
||||
* resolution.
|
||||
*/
|
||||
#include <rtems/score/timestamp.h>
|
||||
|
||||
typedef Timestamp_Control Thread_CPU_usage_t;
|
||||
|
||||
/*
|
||||
* Only provided for backward compatiblity to not break application
|
||||
* configurations.
|
||||
@@ -807,7 +800,7 @@ struct _Thread_Control {
|
||||
/** This field is the amount of CPU time consumed by this thread
|
||||
* since it was created.
|
||||
*/
|
||||
Thread_CPU_usage_t cpu_time_used;
|
||||
Timestamp_Control cpu_time_used;
|
||||
|
||||
/** This field contains information about the starting state of
|
||||
* this thread.
|
||||
|
||||
Reference in New Issue
Block a user