Skip to content

Commit 0f9fa75

Browse files
Jyri Sarhalgirdwood
authored andcommitted
schedule: dp: Set thread name with component ID
Name DP threads using k_thread_name_set() with the component ID in hex. This makes it easier to identify DP threads in debug tools and Zephyr shell thread listings. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent c1aced4 commit 0f9fa75

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/schedule/zephyr_dp_schedule_application.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <stdbool.h>
2424
#include <stdint.h>
25+
#include <stdio.h>
2526

2627
#include "zephyr_dp_schedule.h"
2728

@@ -410,6 +411,15 @@ void scheduler_dp_internal_free(struct task *task)
410411
mod_free(pdata->mod, container_of(task, struct scheduler_dp_task_memory, task));
411412
}
412413

414+
static void scheduler_dp_thread_name_set(k_tid_t thread_id, struct processing_module *mod)
415+
{
416+
char name[CONFIG_THREAD_MAX_NAME_LEN];
417+
418+
snprintf(name, sizeof(name), "DP:%#x", mod->dev->ipc_config.id);
419+
420+
k_thread_name_set(thread_id, name);
421+
}
422+
413423
/* Called only in IPC context */
414424
int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
415425
const struct task_ops *ops, struct processing_module *mod,
@@ -493,6 +503,7 @@ int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid,
493503
pdata->thread_id = k_thread_create(pdata->thread, p_stack,
494504
stack_size, dp_thread_fn, ptask, NULL, NULL,
495505
CONFIG_DP_THREAD_PRIORITY, ptask->flags, K_FOREVER);
506+
scheduler_dp_thread_name_set(pdata->thread_id, mod);
496507

497508
unsigned int pidx;
498509
size_t size;

0 commit comments

Comments
 (0)