[PATCH] set namespace prefix to threads
Bruce Richardson
bruce.richardson at intel.com
Mon Jul 17 16:09:46 CEST 2023
On Mon, Jul 03, 2023 at 01:49:55PM +0200, Thomas Monjalon wrote:
> 03/07/2023 13:38, David Marchand:
> > On Mon, Jul 3, 2023 at 1:24 PM Thomas Monjalon <thomas at monjalon.net> wrote:
> > >
> > > When looking at threads in a system, it can be confusing
> > > to find some unknown threads without a clue it is started by DPDK.
> > >
> > > Let's start all thread names with "dpdk-"
> > > and the driver name if it comes from a driver.
> > >
> > > One more constraint: the thread names are generally limited
> > > to 16 characters, including NUL character.
> >
> > Yes, and no way to discover this limit.
> >
> >
> > >
> > > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> > > ---
> > > Please review carefully, I may have missed things.
> > >
> > > Note: we should use rte_ctrl_thread_create() as much as possible.
> > >
> >
> > As for this comment, we should advertise rte_thread_create_control()
> > instead, as it is thread library agnostic.
> > Which leads me to suggest looking at rte_thread_create_control() calls too.
>
> You're right, I'll do a second pass.
>
> > > diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
> > > index 7008303e11..e201acd1c2 100644
> > > --- a/lib/eal/freebsd/eal.c
> > > +++ b/lib/eal/freebsd/eal.c
> > > @@ -843,7 +843,7 @@ rte_eal_init(int argc, char **argv)
> > >
> > > /* Set thread_name for aid in debugging. */
> > > snprintf(thread_name, sizeof(thread_name),
> > > - "rte-worker-%d", i);
> > > + "dpdk-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,
> >
> > We changed this not so long ago with 8ae946970ed3 ("eal: fix thread
> > name for high order lcores") which offered up to 4 digits for lcores.
> > With your proposal, we are back to only 3 digits, which is probably
> > enough, but I preferred to raise it.
>
> In general no need of hyphen before a number.
> I will change to dpdk-worker%d.
>
While I know that "dpdk-" is probably the clearer prefix, "rte-" is also
well-know as the standard API prefix for DPDK. Give we have a 16-char
limit, I would suggest keeping using the "rte" prefix on the basis of
brevity!
A third alternative is to just use "dp-" as prefix...
/Bruce
More information about the dev
mailing list