Re: [PATCH v2 09/18] perf test: Add named_threads workload

From: Leo Yan

Date: Wed Jun 03 2026 - 13:43:52 EST


On Wed, Jun 03, 2026 at 05:12:59PM +0100, James Clark wrote:

[...]

> > Just curious this can be simplified to a thread function, like:
> >
> > noinline void *named_thread(void *arg)
> > {
> > char name[16];
> >
> > snprintf(name, sizeof(name), "thread%d", int(arg));
> >
> > pthread_setname_np(pthread_self(), name);
> > ...
> > return NULL;
> > }
>
> Only if you don't want to check for symbols as well. I thought if we were
> going to spawn a load of threads and look for thread names we might as well
> check that the symbols match at the same time.
>
> If all of the threads run the same function you can't do that.

Okay, if so please ignore my comment.

Thanks,
Leo