[dpdk-dev] [PATCH v5 1/8] Move common functions in eal_thread.c

Thomas Monjalon thomas.monjalon at 6wind.com
Tue Apr 14 15:59:28 CEST 2015


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.


More information about the dev mailing list