[dpdk-dev,v2,2/2] vhost: add fdset-event thread name
Checks
Commit Message
From: Tonghao Zhang <xiangxia.m.yue@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@gmail.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
---
lib/librte_vhost/socket.c | 9 +++++++++
1 file changed, 9 insertions(+)
Comments
On 03/23/2018 03:18 AM, xiangxia.m.yue@gmail.com wrote:
> From: Tonghao Zhang <xiangxia.m.yue@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@gmail.com>
> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
> ---
> lib/librte_vhost/socket.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Applied to dpdk-next-virtio/master
Thanks,
Maxime
@@ -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 -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");
+ }
}
}