Skip to content

Commit 73ab727

Browse files
fyin1wenlingz
authored andcommitted
dm: set correct thread name
When issue happen, we could identify which thread is impacted. This could help stability issue debugging. Tracked-On: #2037 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Yu Wang <yu1.wang@intel.com>
1 parent cb31381 commit 73ab727

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

devicemodel/core/monitor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static void start_intr_storm_monitor(struct vmctx *ctx)
175175
printf("failed %s %d\n", __func__, __LINE__);
176176
intr_storm_monitor_pid = 0;
177177
}
178+
pthread_setname_np(intr_storm_monitor_pid, "storm_monitor");
178179

179180
printf("start monitor interrupt data...\n");
180181
}

devicemodel/hw/platform/tpm/tpm_crb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ int init_tpm_crb(struct vmctx *ctx)
504504
WPRINTF("Failed init request thread!\n");
505505
goto fail_thread;
506506
}
507+
pthread_setname_np(tpm_vdev->request_thread, "tpm_crb_deli");
507508

508509
return 0;
509510

devicemodel/hw/platform/usb_pmapper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,8 @@ usb_dev_sys_init(usb_dev_sys_cb conn_cb, usb_dev_sys_cb disconn_cb,
12501250
native_disconn_handle);
12511251
goto errout;
12521252
}
1253+
pthread_setname_np(g_ctx.thread, "usb_dev_sys");
1254+
12531255
return 0;
12541256

12551257
errout:

tools/acrn-manager/acrn_mngr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ static int create_new_server(const char *name)
340340
pdebug();
341341
goto listen_err;
342342
}
343+
pthread_setname_np(mfd->listen_thread, "mngr_listen");
343344

344345
/* create a poll_thread */
345346
mfd->polling = 1;
@@ -348,6 +349,7 @@ static int create_new_server(const char *name)
348349
pdebug();
349350
goto poll_err;
350351
}
352+
pthread_setname_np(mfd->poll_thread, "mngr_pull");
351353

352354
mfd->desc = mfd->fd;
353355
/* add this to mngr_fd_head */

0 commit comments

Comments
 (0)