mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
cpuload: change cpuload type to clock_t
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
+3
-3
@@ -240,7 +240,7 @@ extern const struct tasklist_s g_tasklisttable[NUM_TASK_STATES];
|
||||
* 'denominator' for all CPU load calculations.
|
||||
*/
|
||||
|
||||
extern volatile uint32_t g_cpuload_total;
|
||||
extern volatile clock_t g_cpuload_total;
|
||||
#endif
|
||||
|
||||
/* Declared in sched_lock.c *************************************************/
|
||||
@@ -399,8 +399,8 @@ int nxsched_pause_cpu(FAR struct tcb_s *tcb);
|
||||
|
||||
#if defined(CONFIG_SCHED_CPULOAD_SYSCLK) || \
|
||||
defined (CONFIG_SCHED_CPULOAD_CRITMONITOR)
|
||||
void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, uint32_t ticks);
|
||||
void nxsched_process_cpuload_ticks(uint32_t ticks);
|
||||
void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, clock_t ticks);
|
||||
void nxsched_process_cpuload_ticks(clock_t ticks);
|
||||
#define nxsched_process_cpuload() nxsched_process_cpuload_ticks(1)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
* each would have a load of 25% of the total.
|
||||
*/
|
||||
|
||||
volatile uint32_t g_cpuload_total;
|
||||
volatile clock_t g_cpuload_total;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -97,7 +97,7 @@ volatile uint32_t g_cpuload_total;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, uint32_t ticks)
|
||||
void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, clock_t ticks)
|
||||
{
|
||||
tcb->ticks += ticks;
|
||||
g_cpuload_total += ticks;
|
||||
@@ -147,7 +147,7 @@ void nxsched_process_taskload_ticks(FAR struct tcb_s *tcb, uint32_t ticks)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void nxsched_process_cpuload_ticks(uint32_t ticks)
|
||||
void nxsched_process_cpuload_ticks(clock_t ticks)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user