Skip to content

[lwp]list_process can print tid #8991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 31, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions components/lwp/lwp_pid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,12 +1219,12 @@ long list_process(void)

maxlen = RT_NAME_MAX;
#ifdef RT_USING_SMP
rt_kprintf("%-*.s %-*.s %-*.s cpu pri status sp stack size max used left tick error\n", 4, "PID", maxlen, "CMD", maxlen, item_title);
object_split(4);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");
rt_kprintf("%-*.s %-*.s %-*.s %-*.s cpu pri status sp stack size max used left tick error\n", 4, "PID", 4, "TID", maxlen, "CMD", maxlen, item_title);
object_split(4);rt_kprintf(" ");object_split(4);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");
rt_kprintf( "--- --- ------- ---------- ---------- ------ ---------- ---\n");
#else
rt_kprintf("%-*.s %-*.s %-*.s pri status sp stack size max used left tick error\n", 4, "PID", maxlen, "CMD", maxlen, item_title);
object_split(4);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");
rt_kprintf("%-*.s %-*.s %-*.s %-*.s pri status sp stack size max used left tick error\n", 4, "PID", 4, "TID", maxlen, "CMD", maxlen, item_title);
object_split(4);rt_kprintf(" ");object_split(4);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");object_split(maxlen);rt_kprintf(" ");
rt_kprintf( "--- ------- ---------- ---------- ------ ---------- ---\n");
#endif /*RT_USING_SMP*/

Expand Down Expand Up @@ -1257,7 +1257,7 @@ long list_process(void)

if (th.lwp == RT_NULL)
{
rt_kprintf(" %-*.*s ", maxlen, RT_NAME_MAX, "kernel");
rt_kprintf(" %-*.*s ",maxlen, RT_NAME_MAX, "kernel");
print_thread_info(&th, maxlen);
}
}
Expand All @@ -1276,7 +1276,7 @@ long list_process(void)
for (node = list->next; node != list; node = node->next)
{
thread = rt_list_entry(node, struct rt_thread, sibling);
rt_kprintf("%4d %-*.*s ", lwp_to_pid(lwp), maxlen, RT_NAME_MAX, lwp->cmd);
rt_kprintf("%4d %4d %-*.*s ", lwp_to_pid(lwp), thread->tid,maxlen, RT_NAME_MAX, lwp->cmd);
print_thread_info(thread, maxlen);
}
}
Expand Down
Loading