kernel: Remove idle thread cpu index on single-core devices

The idle thread got an index suffix in #23536 to make it easier to
identify different idle threads on different cores. This looks out of
place on single-core devices when the idle thread is listed next to
other kernel threads, such as main.

Remove the idle thread index on single-core platforms, and replace all
references to this format in tests and documentation.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
Trond Einar Snekvik 2022-03-25 12:46:32 +01:00 committed by Anas Nashif
commit 6224ecbfa6
3 changed files with 10 additions and 5 deletions

View file

@ -265,7 +265,7 @@ static void ztress_thread(void *data, void *prio, void *unused)
static void thread_cb(const struct k_thread *cthread, void *user_data)
{
#define GET_IDLE_TID(i, tid) do {\
if (strcmp(tname, "idle 0" STRINGIFY(i)) == 0) { \
if (strcmp(tname, (CONFIG_MP_NUM_CPUS == 1) ? "idle" : "idle 0" STRINGIFY(i)) == 0) { \
idle_tid[i] = tid; \
} \
} while (0)