All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] examples/helloworld: add output of core id and socket id
@ 2017-05-17 13:49 Wei Dai
  2017-05-17 14:16 ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Wei Dai @ 2017-05-17 13:49 UTC (permalink / raw)
  To: bruce.richardson, john.mcnamara; +Cc: dev, Wei Dai

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 <wei.dai@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/helloworld: add output of core id and socket id
  2017-05-17 13:49 [PATCH] examples/helloworld: add output of core id and socket id Wei Dai
@ 2017-05-17 14:16 ` Ferruh Yigit
  2017-05-17 14:29   ` Dai, Wei
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2017-05-17 14:16 UTC (permalink / raw)
  To: Wei Dai, bruce.richardson, john.mcnamara; +Cc: dev

On 5/17/2017 2:49 PM, Wei Dai wrote:
> 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 <wei.dai@intel.com>
> ---
>  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",

It is hard to understand difference from "core" and "core_id", what do
you think using "lcore" and "core" respectively in the message?

> +		lcore_id, lcore_config[lcore_id].core_id,
> +		lcore_config[lcore_id].socket_id);
>  	return 0;
>  }
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/helloworld: add output of core id and socket id
  2017-05-17 14:16 ` Ferruh Yigit
@ 2017-05-17 14:29   ` Dai, Wei
  2017-05-17 14:29     ` Ferruh Yigit
  0 siblings, 1 reply; 4+ messages in thread
From: Dai, Wei @ 2017-05-17 14:29 UTC (permalink / raw)
  To: Yigit, Ferruh, Richardson, Bruce, Mcnamara, John; +Cc: dev

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, May 17, 2017 10:16 PM
> To: Dai, Wei <wei.dai@intel.com>; Richardson, Bruce
> <bruce.richardson@intel.com>; Mcnamara, John <john.mcnamara@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] examples/helloworld: add output of core id and
> socket id
> 
> On 5/17/2017 2:49 PM, Wei Dai wrote:
> > 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 <wei.dai@intel.com>
> > ---
> >  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",
> 
> It is hard to understand difference from "core" and "core_id", what do you
> think using "lcore" and "core" respectively in the message?
Yes, it is still a bit confused.
I should change it to printf("hello from lcore_id = %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;
> >  }
> >
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] examples/helloworld: add output of core id and socket id
  2017-05-17 14:29   ` Dai, Wei
@ 2017-05-17 14:29     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-05-17 14:29 UTC (permalink / raw)
  To: Dai, Wei, Richardson, Bruce, Mcnamara, John; +Cc: dev

On 5/17/2017 3:29 PM, Dai, Wei wrote:
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Wednesday, May 17, 2017 10:16 PM
>> To: Dai, Wei <wei.dai@intel.com>; Richardson, Bruce
>> <bruce.richardson@intel.com>; Mcnamara, John <john.mcnamara@intel.com>
>> Cc: dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] examples/helloworld: add output of core id and
>> socket id
>>
>> On 5/17/2017 2:49 PM, Wei Dai wrote:
>>> 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 <wei.dai@intel.com>
>>> ---
>>>  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",
>>
>> It is hard to understand difference from "core" and "core_id", what do you
>> think using "lcore" and "core" respectively in the message?
> Yes, it is still a bit confused.
> I should change it to printf("hello from lcore_id = %2u at core_id = %2u on socket_id = %2u\n",

+1

> 
>>
>>> +		lcore_id, lcore_config[lcore_id].core_id,
>>> +		lcore_config[lcore_id].socket_id);
>>>  	return 0;
>>>  }
>>>
>>>
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-17 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17 13:49 [PATCH] examples/helloworld: add output of core id and socket id Wei Dai
2017-05-17 14:16 ` Ferruh Yigit
2017-05-17 14:29   ` Dai, Wei
2017-05-17 14:29     ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.