shell: report thread runtime stats
Updates the kernel service to display the extended thread runtime stats when the following shell command is issued. kernel threads Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
4eb1dd02cc
commit
68c9845b41
1 changed files with 12 additions and 5 deletions
|
@ -103,17 +103,24 @@ static void shell_tdata_dump(const struct k_thread *cthread, void *user_data)
|
||||||
* so it won't increase RAM/ROM usage too much on 32-bit
|
* so it won't increase RAM/ROM usage too much on 32-bit
|
||||||
* targets.
|
* targets.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_64BIT
|
|
||||||
shell_print(shell, "\tTotal execution cycles: %" PRIu64 " (%u %%)",
|
|
||||||
(uint64_t)rt_stats_thread.execution_cycles,
|
|
||||||
pcnt);
|
|
||||||
#else
|
|
||||||
shell_print(shell, "\tTotal execution cycles: %u (%u %%)",
|
shell_print(shell, "\tTotal execution cycles: %u (%u %%)",
|
||||||
(uint32_t)rt_stats_thread.execution_cycles,
|
(uint32_t)rt_stats_thread.execution_cycles,
|
||||||
pcnt);
|
pcnt);
|
||||||
|
#ifdef CONFIG_SCHED_THREAD_USAGE_ANALYSIS
|
||||||
|
shell_print(shell, "\tCurrent execution cycles: %u",
|
||||||
|
(uint32_t)rt_stats_thread.current_cycles);
|
||||||
|
shell_print(shell, "\tPeak execution cycles: %u",
|
||||||
|
(uint32_t)rt_stats_thread.peak_cycles);
|
||||||
|
shell_print(shell, "\tAverage execution cycles: %u",
|
||||||
|
(uint32_t)rt_stats_thread.average_cycles);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
shell_print(shell, "\tTotal execution cycles: ? (? %%)");
|
shell_print(shell, "\tTotal execution cycles: ? (? %%)");
|
||||||
|
#ifdef CONFIG_SCHED_THREAD_USAGE_ANALYSIS
|
||||||
|
shell_print(shell, "\tCurrent execution cycles: ?");
|
||||||
|
shell_print(shell, "\tPeak execution cycles: ?");
|
||||||
|
shell_print(shell, "\tAverage execution cycles: ?");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue