[ovs-dev] [threads 23/28] util: Make subprogram_name thread-specific.

Ben Pfaff blp at nicira.com
Fri Jul 12 00:16:33 UTC 2013


On Thu, Jul 11, 2013 at 09:40:57AM -0400, Ed Maste wrote:
> On 10 July 2013 19:04, Ben Pfaff <blp at nicira.com> wrote:
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> 
> > +void
> > +set_subprogram_name(const char *name)
> > +{
> > +    free(subprogram_name_set(xstrdup(name)));
> > +}
> 
> How about calling (through appropriate abstraction) pthread_setname_np
> (Linux) or pthread_set_name_np (FreeBSD)?  The thread names will then
> appear in gdb or lldb, and in top(1) (on FreeBSD at least).

I didn't know about those functions.  Thanks, I'll look into it.



More information about the dev mailing list