DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal/linux: truncate thread name
Date: Fri, 10 Jul 2020 14:44:24 +0200	[thread overview]
Message-ID: <CAJFAV8wxh_LTyvyBJCT+ZAaL5s9GUzhNy+0rPmEx3+uaaQbD+Q@mail.gmail.com> (raw)
In-Reply-To: <3387414.ACgpzotbJP@thomas>

On Fri, Jul 10, 2020 at 2:41 PM Thomas Monjalon <thomas@monjalon.net> 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


  reply	other threads:[~2020-07-10 12:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10  9:45 David Marchand
2020-07-10 12:41 ` Thomas Monjalon
2020-07-10 12:44   ` David Marchand [this message]
2020-07-11 13:47   ` David Marchand

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=CAJFAV8wxh_LTyvyBJCT+ZAaL5s9GUzhNy+0rPmEx3+uaaQbD+Q@mail.gmail.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).