DPDK patches and discussions
 help / color / mirror / Atom feed
From: xiangxia.m.yue@gmail.com
To: jianfeng.tan@intel.com
Cc: dev@dpdk.org, Tonghao Zhang <xiangxia.m.yue@gmail.com>
Subject: [dpdk-dev] [PATCH 2/2] vhost: add fdset-event thread name
Date: Thu, 22 Mar 2018 05:39:58 -0700	[thread overview]
Message-ID: <1521722398-93353-2-git-send-email-xiangxia.m.yue@gmail.com> (raw)
In-Reply-To: <1521722398-93353-1-git-send-email-xiangxia.m.yue@gmail.com>

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>
---
 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

  reply	other threads:[~2018-03-22 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 12:39 [dpdk-dev] [PATCH 1/2] vhost: make sure vhost fdset-thread created successfully xiangxia.m.yue
2018-03-22 12:39 ` xiangxia.m.yue [this message]
2018-03-23  1:38   ` [dpdk-dev] [PATCH 2/2] vhost: add fdset-event thread name Tan, Jianfeng
2018-03-23  1:30 ` [dpdk-dev] [PATCH 1/2] vhost: make sure vhost fdset-thread created successfully Tan, Jianfeng
2018-03-23  1:53   ` Tonghao Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1521722398-93353-2-git-send-email-xiangxia.m.yue@gmail.com \
    --to=xiangxia.m.yue@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).