On Tue, Apr 14, 2015 at 2:35 PM, Ravi Kerur <rkerur at gmail.com> wrote:
> > > On Tue, Apr 14, 2015 at 6:59 AM, Thomas Monjalon < > thomas.monjalon at 6wind.com> wrote: > >> Hi Ravi, >> >> 2015-04-09 12:40, Ravi Kerur: >> > --- a/lib/librte_eal/common/eal_common_thread.c >> > +++ b/lib/librte_eal/common/eal_common_thread.c >> [...] >> > +#ifdef RTE_EXEC_ENV_BSDAPP >> > +#include <pthread_np.h> >> > +#include <sys/thr.h> >> > +#else /* RTE_EXEC_ENV_BSDAPP */ >> > #include <pthread.h> >> > +#endif /* RTE_EXEC_ENV_BSDAPP */ >> [...] >> > +#ifdef RTE_EXEC_ENV_BSDAPP >> > + RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%p;cpuset=[%s%s])\n", >> > + lcore_id, thread_id, cpuset, ret == 0 ? "" : "..."); >> > +#else /* RTE_EXEC_ENV_BSDAPP */ >> > + RTE_LOG(DEBUG, EAL, "lcore %u is ready (tid=%x;cpuset=[%s%s])\n", >> > + lcore_id, (int)thread_id, cpuset, ret == 0 ? "" : "..."); >> > +#endif /* RTE_EXEC_ENV_BSDAPP */ >> >> These lines should stay in bsdapp and linuxapp directory. >> You can add a new function to eal_thread.h to format the thread id, >> so you'll be able to use %s in generic log above. >> > > Thomas, sure will make the changes. I will wait for additional comments if > any for other patches and send v6 together. > > Thanks. > > I plan to use pthread_setname_np after pthread_create and use pthread_getname_np in RTE_LOG. Both these library calls are available in BSD and Linux. Let me know if this is ok??