kernel: update k_thread_state_str() API
When threads are in more than one state at a time, k_thread_state_str() returns a string that lists each of its states delimited by a '+'. This in turn necessitates a change to the API that includes both a pointer to the buffer to use for the string and the size of the buffer. Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This commit is contained in:
parent
fef6e46f01
commit
a30cf39975
6 changed files with 103 additions and 43 deletions
|
@ -62,6 +62,7 @@ static void shell_tdata_dump(const struct k_thread *cthread, void *user_data)
|
|||
size_t size = thread->stack_info.size;
|
||||
const char *tname;
|
||||
int ret;
|
||||
char state_str[32];
|
||||
|
||||
#ifdef CONFIG_THREAD_RUNTIME_STATS
|
||||
k_thread_runtime_stats_t rt_stats_thread;
|
||||
|
@ -79,7 +80,8 @@ static void shell_tdata_dump(const struct k_thread *cthread, void *user_data)
|
|||
thread->base.user_options,
|
||||
thread->base.prio,
|
||||
(int64_t)thread->base.timeout.dticks);
|
||||
shell_print(shell, "\tstate: %s, entry: %p", k_thread_state_str(thread),
|
||||
shell_print(shell, "\tstate: %s, entry: %p",
|
||||
k_thread_state_str(thread, state_str, sizeof(state_str)),
|
||||
thread->entry.pEntry);
|
||||
|
||||
#ifdef CONFIG_THREAD_RUNTIME_STATS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue