Lines Matching full:stats

122 void z_sched_cpu_usage(uint8_t cpu_id, struct k_thread_runtime_stats *stats)  in z_sched_cpu_usage()  argument
136 * Getting stats for the current CPU. Update both its in z_sched_cpu_usage()
137 * current thread stats and the CPU stats as the CPU's 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()
157 stats->average_cycles = 0; in z_sched_cpu_usage()
159 stats->average_cycles = stats->total_cycles / in z_sched_cpu_usage()
164 stats->idle_cycles = in z_sched_cpu_usage()
167 stats->execution_cycles = stats->total_cycles + stats->idle_cycles; in z_sched_cpu_usage()
174 struct k_thread_runtime_stats *stats) in z_sched_thread_usage() argument
188 * Getting stats for the current thread. Update both the in z_sched_thread_usage()
189 * current thread stats and its CPU stats as the CPU's 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()
213 stats->average_cycles = 0; in z_sched_thread_usage()
215 stats->average_cycles = stats->total_cycles / in z_sched_thread_usage()
221 stats->idle_cycles = 0; in z_sched_thread_usage()
296 /* Enable gathering of runtime stats on each CPU */ in k_sys_runtime_stats_enable()
347 int z_thread_stats_raw(struct k_obj_core *obj_core, void *stats) in z_thread_stats_raw() argument
352 memcpy(stats, obj_core->stats, sizeof(struct k_cycle_stats)); in z_thread_stats_raw()
358 int z_thread_stats_query(struct k_obj_core *obj_core, void *stats) in z_thread_stats_query() argument
364 z_sched_thread_usage(thread, stats); in z_thread_stats_query()
372 struct k_cycle_stats *stats; in z_thread_stats_reset() local
377 stats = obj_core->stats; in z_thread_stats_reset()
379 stats->total = 0ULL; in z_thread_stats_reset()
381 stats->current = 0ULL; in z_thread_stats_reset()
382 stats->longest = 0ULL; in z_thread_stats_reset()
383 stats->num_windows = (thread->base.usage.track_usage) ? 1U : 0U; in z_thread_stats_reset()
392 * that its stats were reset at the start of its execution in z_thread_stats_reset()
401 /* Update the current CPU stats. */ in z_thread_stats_reset()
443 int z_cpu_stats_raw(struct k_obj_core *obj_core, void *stats) in z_cpu_stats_raw() argument
448 memcpy(stats, obj_core->stats, sizeof(struct k_cycle_stats)); in z_cpu_stats_raw()
454 int z_cpu_stats_query(struct k_obj_core *obj_core, void *stats) in z_cpu_stats_query() argument
460 z_sched_cpu_usage(cpu->id, stats); in z_cpu_stats_query()
467 int z_kernel_stats_raw(struct k_obj_core *obj_core, void *stats) in z_kernel_stats_raw() argument
472 memcpy(stats, obj_core->stats, in z_kernel_stats_raw()
479 int z_kernel_stats_query(struct k_obj_core *obj_core, void *stats) in z_kernel_stats_query() argument
483 return k_thread_runtime_stats_all_get(stats); in z_kernel_stats_query()