From: Tonghao Zhang Date: Fri, 23 Mar 2018 02:18:51 +0000 (-0700) Subject: vhost: add fdset-event thread name X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=ce5bd5fcae432c63bfe777d9c509e2cb2f1fce1a;p=dpdk.git vhost: add fdset-event thread name This patch adds the name for vhost fdset thread. It can help us to know whether the thread is running. Signed-off-by: Tonghao Zhang Reviewed-by: Jianfeng Tan --- diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 5e24230c02..8bc8228bba 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -841,6 +841,7 @@ rte_vhost_driver_start(const char *path) { struct vhost_user_socket *vsocket; static pthread_t fdset_tid; + char thread_name[RTE_MAX_THREAD_NAME_LEN]; pthread_mutex_lock(&vhost_user.mutex); vsocket = find_vhost_user_socket(path); @@ -856,6 +857,14 @@ rte_vhost_driver_start(const char *path) RTE_LOG(ERR, VHOST_CONFIG, "failed to create fdset handling thread"); return -1; + } else { + snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, + "vhost-events"); + + if (rte_thread_setname(fdset_tid, thread_name)) { + RTE_LOG(DEBUG, VHOST_CONFIG, + "failed to set vhost-event thread name"); + } } }