[dpdk-dev] [PATCH 2/2] vhost: add fdset-event thread name
xiangxia.m.yue at gmail.com
xiangxia.m.yue at gmail.com
Thu Mar 22 13:39:58 CET 2018
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
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 <xiangxia.m.yue at gmail.com>
---
lib/librte_vhost/socket.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index 8ca01df..93175ba 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -820,6 +820,7 @@ struct vhost_device_ops const *
{
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);
@@ -835,6 +836,14 @@ struct vhost_device_ops const *
RTE_LOG(ERR, VHOST_CONFIG,
"failed to create fdset handling thread");
return ret;
+ } 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");
+ }
}
}
--
1.8.3.1
More information about the dev
mailing list