Lines Matching full:usage

38 	if (!cpu->usage->track_usage) {  in sched_cpu_update_usage()
43 cpu->usage->total += cycles; in sched_cpu_update_usage()
46 cpu->usage->current += cycles; in sched_cpu_update_usage()
48 if (cpu->usage->longest < cpu->usage->current) { in sched_cpu_update_usage()
49 cpu->usage->longest = cpu->usage->current; in sched_cpu_update_usage()
52 cpu->usage->current = 0; in sched_cpu_update_usage()
53 cpu->usage->num_windows++; in sched_cpu_update_usage()
63 thread->base.usage.total += cycles; in sched_thread_update_usage()
66 thread->base.usage.current += cycles; in sched_thread_update_usage()
68 if (thread->base.usage.longest < thread->base.usage.current) { in sched_thread_update_usage()
69 thread->base.usage.longest = thread->base.usage.current; in sched_thread_update_usage()
83 if (thread->base.usage.track_usage) { in z_sched_usage_start()
84 thread->base.usage.num_windows++; in z_sched_usage_start()
85 thread->base.usage.current = 0; in z_sched_usage_start()
110 if (cpu->current->base.usage.track_usage) { in z_sched_usage_stop()
142 if (cpu->current->base.usage.track_usage) { in z_sched_cpu_usage()
151 stats->total_cycles = cpu->usage->total; in z_sched_cpu_usage()
153 stats->current_cycles = cpu->usage->current; in z_sched_cpu_usage()
154 stats->peak_cycles = cpu->usage->longest; in z_sched_cpu_usage()
156 if (cpu->usage->num_windows == 0) { in z_sched_cpu_usage()
160 cpu->usage->num_windows; in z_sched_cpu_usage()
165 _kernel.cpus[cpu_id].idle_thread->base.usage.total; in z_sched_cpu_usage()
194 if (thread->base.usage.track_usage) { in z_sched_thread_usage()
203 stats->execution_cycles = thread->base.usage.total; in z_sched_thread_usage()
204 stats->total_cycles = thread->base.usage.total; in z_sched_thread_usage()
206 /* Copy-out the thread's usage stats */ in z_sched_thread_usage()
209 stats->current_cycles = thread->base.usage.current; in z_sched_thread_usage()
210 stats->peak_cycles = thread->base.usage.longest; in z_sched_thread_usage()
212 if (thread->base.usage.num_windows == 0) { in z_sched_thread_usage()
216 thread->base.usage.num_windows; in z_sched_thread_usage()
238 if (!thread->base.usage.track_usage) { in k_thread_runtime_stats_enable()
239 thread->base.usage.track_usage = true; in k_thread_runtime_stats_enable()
240 thread->base.usage.num_windows++; in k_thread_runtime_stats_enable()
241 thread->base.usage.current = 0; in k_thread_runtime_stats_enable()
260 if (thread->base.usage.track_usage) { in k_thread_runtime_stats_disable()
261 thread->base.usage.track_usage = false; in k_thread_runtime_stats_disable()
284 if (_current_cpu->usage->track_usage) { in k_sys_runtime_stats_enable()
287 * Usage tracking is already enabled on the current CPU in k_sys_runtime_stats_enable()
301 _kernel.cpus[i].usage->track_usage = true; in k_sys_runtime_stats_enable()
303 _kernel.cpus[i].usage->num_windows++; in k_sys_runtime_stats_enable()
304 _kernel.cpus[i].usage->current = 0; in k_sys_runtime_stats_enable()
318 if (!_current_cpu->usage->track_usage) { in k_sys_runtime_stats_disable()
321 * Usage tracking is already disabled on the current CPU in k_sys_runtime_stats_disable()
339 cpu->usage->track_usage = false; in k_sys_runtime_stats_disable()
383 stats->num_windows = (thread->base.usage.track_usage) ? 1U : 0U; in z_thread_stats_reset()