From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F7634247A; Tue, 24 Jan 2023 19:02:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A7BC42D37; Tue, 24 Jan 2023 19:02:42 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id ACCEC40A89 for ; Tue, 24 Jan 2023 19:02:38 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 0657520E34CB; Tue, 24 Jan 2023 10:02:37 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0657520E34CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1674583358; bh=Ts6NDenqRvm7ePZMbZeV+K+dn2zalCeuMs72+s2dwjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nmtP0Ki51hAdz7pcAUEMwP5CBVy+XVB438PSQGZDO+IlhEmC2uveicHk5opBYUP4v iezZWFkLScx/9OaS4JCn4WPHOf7M0tI5dqnMIrZo5MLPYdWWvRSVJoO9u3r3w8J/yD p9JwqVOSZedvgZOBNLMVURFpWuGgAzJqQCpJrUa0= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, jerinjacobk@gmail.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v9 3/4] eal: set thread name on Windows worker threads Date: Tue, 24 Jan 2023 10:02:30 -0800 Message-Id: <1674583351-15292-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1674583351-15292-1-git-send-email-roretzla@linux.microsoft.com> References: <1670439617-9054-1-git-send-email-roretzla@linux.microsoft.com> <1674583351-15292-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Bring Windows EAL worker thread initialization in line with linux & freebsd by setting the worker thread name using the new platform agnostic rte_thread_set_name API. Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup --- lib/eal/windows/eal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index b9f95ed..e7d405b 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -282,6 +282,7 @@ enum rte_proc_type_t enum rte_iova_mode iova_mode; int ret; char cpuset[RTE_CPU_AFFINITY_STR_LEN]; + char thread_name[RTE_MAX_THREAD_NAME_LEN]; eal_log_init(NULL, 0); @@ -437,6 +438,12 @@ enum rte_proc_type_t if (rte_thread_create(&lcore_config[i].thread_id, NULL, eal_thread_loop, (void *)(uintptr_t)i) != 0) rte_panic("Cannot create thread\n"); + + /* Set thread name for aid in debugging. */ + snprintf(thread_name, sizeof(thread_name), + "rte-worker-%d", i); + rte_thread_set_name(lcore_config[i].thread_id, thread_name); + ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id, &lcore_config[i].cpuset); if (ret != 0) -- 1.8.3.1