kernel: Update CPU runtime stats of non-idle time
Updates sched_cpu_update_usage() such that the CPU runtime stats only update the its non-idle time when the current thread is not the idle thread. This is necessary as otherwise the CPUs idle-time will be double counted in k_thread_runtime_stats.execution_cycles. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
019a1e13f4
commit
11f8f6697f
1 changed files with 3 additions and 1 deletions
|
@ -47,8 +47,10 @@ static void sched_cpu_update_usage(struct _cpu *cpu, uint32_t cycles)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (cpu->current != cpu->idle_thread) {
|
||||||
cpu->usage.total += cycles;
|
cpu->usage.total += cycles;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
#define sched_cpu_update_usage(cpu, cycles) do { } while (0)
|
#define sched_cpu_update_usage(cpu, cycles) do { } while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue