diff mbox series

[v2,6/7] telemetry: support set init threads name

Message ID 1618650588-34268-7-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted
Delegated to: Thomas Monjalon
Headers show
Series support set thread name | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Min Hu (Connor) April 17, 2021, 9:09 a.m. UTC
From: Chengwen Feng <fengchengwen@huawei.com>

This patch supports set init threads name which is helpful for
debugging.

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 lib/librte_telemetry/telemetry.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Bruce Richardson April 21, 2021, 10:39 a.m. UTC | #1
On Sat, Apr 17, 2021 at 05:09:47PM +0800, Min Hu (Connor) wrote:
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> This patch supports set init threads name which is helpful for
> debugging.
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
diff mbox series

Patch

diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c
index 7e08afd..8f48337 100644
--- a/lib/librte_telemetry/telemetry.c
+++ b/lib/librte_telemetry/telemetry.c
@@ -442,7 +442,7 @@  telemetry_legacy_init(void)
 		return -1;
 	pthread_create(&t_old, NULL, socket_listener, &v1_socket);
 	pthread_setaffinity_np(t_old, sizeof(*thread_cpuset), thread_cpuset);
-
+	pthread_setname_np(t_old, "telemetry-v1");
 	TMTY_LOG(DEBUG, "Legacy telemetry socket initialized ok\n");
 	return 0;
 }
@@ -471,6 +471,7 @@  telemetry_v2_init(void)
 		return -1;
 	pthread_create(&t_new, NULL, socket_listener, &v2_socket);
 	pthread_setaffinity_np(t_new, sizeof(*thread_cpuset), thread_cpuset);
+	pthread_setname_np(t_new, "telemetry-v2");
 	atexit(unlink_sockets);
 
 	return 0;