From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Dai Subject: [PATCH] examples/helloworld: add output of core id and socket id Date: Wed, 17 May 2017 21:49:56 +0800 Message-ID: <1495028996-55146-1-git-send-email-wei.dai@intel.com> Cc: dev@dpdk.org, Wei Dai To: bruce.richardson@intel.com, john.mcnamara@intel.com Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id CD9422C2F for ; Wed, 17 May 2017 15:50:27 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Adding output of core id and socket id of each lcore/pthread can help to understand their relationship. And this can also help to examine the usage of the EAL lcore settings like -c, -l and --lcore . Signed-off-by: Wei Dai --- examples/helloworld/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c index 8b7a2de..fdd8818 100644 --- a/examples/helloworld/main.c +++ b/examples/helloworld/main.c @@ -50,7 +50,9 @@ lcore_hello(__attribute__((unused)) void *arg) { unsigned lcore_id; lcore_id = rte_lcore_id(); - printf("hello from core %u\n", lcore_id); + printf("hello from core %2u at core_id = %2u on socket_id = %2u\n", + lcore_id, lcore_config[lcore_id].core_id, + lcore_config[lcore_id].socket_id); return 0; } -- 2.7.4