From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19F27A052A; Fri, 10 Jul 2020 14:44:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 01EB61DC6C; Fri, 10 Jul 2020 14:44:40 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id F11DE1DC60 for ; Fri, 10 Jul 2020 14:44:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594385078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=frE7CKsqehb8X02ANpCPHXxzXMmfHPUKoNimJGtIOKA=; b=AgeMlBd4MQdc9UT/j+sZguwGo91zyjERNWLXrbL1inVGEVXGWppLMfbqQ2i/7iIY3tZcBO +IiC3LnsHQP0maR1fwDziRIVaYINraowdKQnN1P8XdmMvPJuSt8W5VuRUGgJxyOlrM2OAY M1Gb6kyGSRUkypnlKJG0LU41AXREHp0= Received: from mail-ua1-f69.google.com (mail-ua1-f69.google.com [209.85.222.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-286-ljq2sDb_Pve-dbvSC7_fbQ-1; Fri, 10 Jul 2020 08:44:36 -0400 X-MC-Unique: ljq2sDb_Pve-dbvSC7_fbQ-1 Received: by mail-ua1-f69.google.com with SMTP id b25so2401393uaj.2 for ; Fri, 10 Jul 2020 05:44:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=frE7CKsqehb8X02ANpCPHXxzXMmfHPUKoNimJGtIOKA=; b=Snzao6GSrFzCpjpHtWNH87b54GZUCWTmDvWCA/sfDyVK+7pkcLrztECSfGhlpZZyZi 7SBZxtuCKRetJR49G74l7iMI0p/DAhsTbsILGilUNFE/MbfECV5HGUCKM51qTMbBcvEO 7YAc+JsnrWvmzItxS3AJkqi7dLwkI/s1TRIWNYY87XAkfjGKjskb6HMq6xHeXaC1SB9V 19s7Az65syUlxbrYtDIYdMCz7KEfYgJ1cu5CyYc60FfHZ9aH5RoXwtilPXe2sWN1osP+ 6L2YzRP7fy3ztw4BMSUZ6YmMoLCKvgqgiQgfmxhXCzlBTtZjF15QTfLUxbg5HqN859oM oGbw== X-Gm-Message-State: AOAM531+W4i26SAauyeK/XrZZdcZ5qVl86d5zPGQOVedjYLLfLMg+tm9 pFUNClMCs8rJHgGJQz4XGIVNnZih1StcK9VI/gvuUf4Y8N8Vs/X/fDqxa3Fc5N8dkeSAa7oL3e5 WMo5JTK2d4O6OVV8tZAQ= X-Received: by 2002:a67:26c2:: with SMTP id m185mr49865727vsm.39.1594385075902; Fri, 10 Jul 2020 05:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeOTv3sZ8PAGnzfplEwtaawyI4heqtr65Tk89pw9TE0NOLZmfdPDVE9Roq6cao4603YhD4SRRulgmwXaiZJHg= X-Received: by 2002:a67:26c2:: with SMTP id m185mr49865715vsm.39.1594385075555; Fri, 10 Jul 2020 05:44:35 -0700 (PDT) MIME-Version: 1.0 References: <20200710094551.3716-1-david.marchand@redhat.com> <3387414.ACgpzotbJP@thomas> In-Reply-To: <3387414.ACgpzotbJP@thomas> From: David Marchand Date: Fri, 10 Jul 2020 14:44:24 +0200 Message-ID: To: Thomas Monjalon Cc: dev X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] eal/linux: truncate thread name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jul 10, 2020 at 2:41 PM Thomas Monjalon wrote: > > 10/07/2020 11:45, David Marchand: > > pthread_setname_np refuses names larger than 16 bytes (\0 included). > > Rather than return an error, truncate the name to this limit in the > > rte_thread_setname helper. > [...] > > --- a/lib/librte_eal/linux/eal_thread.c > > +++ b/lib/librte_eal/linux/eal_thread.c > > @@ -153,7 +153,10 @@ int rte_thread_setname(pthread_t id, const char *name) > > int ret = ENOSYS; > > #if defined(__GLIBC__) && defined(__GLIBC_PREREQ) > > #if __GLIBC_PREREQ(2, 12) > > - ret = pthread_setname_np(id, name); > > + char truncated[16]; > > That's a pity POSIX is not defining a constant for this limit. pthread_setname "_np" :-) -- David Marchand