diff mbox

[v3,API-NEXT,09/11] linux-generic: sysinfo: set values for cpu_arch_str

Message ID 1451385082-8364-10-git-send-email-hongbo.zhang@linaro.org
State Superseded
Headers show

Commit Message

Hongbo Zhang Dec. 29, 2015, 10:31 a.m. UTC
From: Hongbo Zhang <hongbo.zhang@linaro.org>

The values of cpu_arch_str were deleted due to codes reorganization, this
patch adds values to them again.

Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
---
 platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +
 platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +
 platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +
 3 files changed, 3 insertions(+)

Comments

Maxim Uvarov Dec. 29, 2015, 1:03 p.m. UTC | #1
On 12/29/2015 13:31, hongbo.zhang@linaro.org wrote:
> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>
> The values of cpu_arch_str were deleted due to codes reorganization, this
> patch adds values to them again.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
> ---
>   platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +
>   platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +
>   platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +
>   3 files changed, 3 insertions(+)
>
> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
> index 8b430f5..3415516 100644
> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>   	int model = 0;
>   	int count = 2;
>   
> +	strcpy(sysinfo->cpu_arch_str, "octeon");

there are bunch of other mips based socs, not only octeon.

Maxim.
>   	while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>   		if (!mhz) {
>   			pos = strstr(str, "BogoMIPS");
> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
> index 61714f8..5f4e69d 100644
> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>   	int model = 0;
>   	int count = 2;
>   
> +	strcpy(sysinfo->cpu_arch_str, "powerpc");
>   	while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>   		if (!mhz) {
>   			pos = strstr(str, "clock");
> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
> index 24187f0..02ec9ea 100644
> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
> @@ -15,6 +15,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
>   	double ghz = 0.0;
>   	int id = 0;
>   
> +	strcpy(sysinfo->cpu_arch_str, "x86");
>   	while (fgets(str, sizeof(str), file) != NULL && id < MAX_CPU_NUMBER) {
>   		pos = strstr(str, "model name");
>   		if (pos) {
Hongbo Zhang Jan. 6, 2016, 9:22 a.m. UTC | #2
On 29 December 2015 at 21:03, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
> On 12/29/2015 13:31, hongbo.zhang@linaro.org wrote:
>>
>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>>
>> The values of cpu_arch_str were deleted due to codes reorganization, this
>> patch adds values to them again.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> ---
>>   platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +
>>   platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +
>>   platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +
>>   3 files changed, 3 insertions(+)
>>
>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> index 8b430f5..3415516 100644
>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> *sysinfo)
>>         int model = 0;
>>         int count = 2;
>>   +     strcpy(sysinfo->cpu_arch_str, "octeon");
>
>
> there are bunch of other mips based socs, not only octeon.
>

The string is the original value I deleted in previous patch.
It seemed in out previous codes we treated "octeon" as "mips", I also
though this may not good.

Then "mips" or "mips64" is good value?

> Maxim.
>
>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>>                 if (!mhz) {
>>                         pos = strstr(str, "BogoMIPS");
>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> index 61714f8..5f4e69d 100644
>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> *sysinfo)
>>         int model = 0;
>>         int count = 2;
>>   +     strcpy(sysinfo->cpu_arch_str, "powerpc");
>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>>                 if (!mhz) {
>>                         pos = strstr(str, "clock");
>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> index 24187f0..02ec9ea 100644
>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> @@ -15,6 +15,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> *sysinfo)
>>         double ghz = 0.0;
>>         int id = 0;
>>   +     strcpy(sysinfo->cpu_arch_str, "x86");
>>         while (fgets(str, sizeof(str), file) != NULL && id <
>> MAX_CPU_NUMBER) {
>>                 pos = strstr(str, "model name");
>>                 if (pos) {
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
Hongbo Zhang Jan. 6, 2016, 10:18 a.m. UTC | #3
On 6 January 2016 at 17:22, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
> On 29 December 2015 at 21:03, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>> On 12/29/2015 13:31, hongbo.zhang@linaro.org wrote:
>>>
>>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>>>
>>> The values of cpu_arch_str were deleted due to codes reorganization, this
>>> patch adds values to them again.
>>>
>>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>>> ---
>>>   platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +
>>>   platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +
>>>   platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +
>>>   3 files changed, 3 insertions(+)
>>>
>>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> index 8b430f5..3415516 100644
>>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>>> *sysinfo)
>>>         int model = 0;
>>>         int count = 2;
>>>   +     strcpy(sysinfo->cpu_arch_str, "octeon");
>>
>>
>> there are bunch of other mips based socs, not only octeon.
>>
>
> The string is the original value I deleted in previous patch.
> It seemed in out previous codes we treated "octeon" as "mips", I also
> though this may not good.
>
> Then "mips" or "mips64" is good value?

Since this is under arch/mips64/ directory, so "mips64" is better?

>
>> Maxim.
>>
>>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>>>                 if (!mhz) {
>>>                         pos = strstr(str, "BogoMIPS");
>>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> index 61714f8..5f4e69d 100644
>>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>>> *sysinfo)
>>>         int model = 0;
>>>         int count = 2;
>>>   +     strcpy(sysinfo->cpu_arch_str, "powerpc");
>>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>>>                 if (!mhz) {
>>>                         pos = strstr(str, "clock");
>>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> index 24187f0..02ec9ea 100644
>>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>>> @@ -15,6 +15,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>>> *sysinfo)
>>>         double ghz = 0.0;
>>>         int id = 0;
>>>   +     strcpy(sysinfo->cpu_arch_str, "x86");
>>>         while (fgets(str, sizeof(str), file) != NULL && id <
>>> MAX_CPU_NUMBER) {
>>>                 pos = strstr(str, "model name");
>>>                 if (pos) {
>>
>>
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
Mike Holmes Jan. 6, 2016, 5:25 p.m. UTC | #4
On 6 January 2016 at 05:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:

> On 6 January 2016 at 17:22, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:

> > On 29 December 2015 at 21:03, Maxim Uvarov <maxim.uvarov@linaro.org>

> wrote:

> >> On 12/29/2015 13:31, hongbo.zhang@linaro.org wrote:

> >>>

> >>> From: Hongbo Zhang <hongbo.zhang@linaro.org>

> >>>

> >>> The values of cpu_arch_str were deleted due to codes reorganization,

> this

> >>> patch adds values to them again.

> >>>

> >>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>

> >>> ---

> >>>   platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +

> >>>   platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +

> >>>   platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +

> >>>   3 files changed, 3 insertions(+)

> >>>

> >>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> >>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> >>> index 8b430f5..3415516 100644

> >>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> >>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c

> >>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t

> >>> *sysinfo)

> >>>         int model = 0;

> >>>         int count = 2;

> >>>   +     strcpy(sysinfo->cpu_arch_str, "octeon");

> >>

> >>

> >> there are bunch of other mips based socs, not only octeon.

> >>

> >

> > The string is the original value I deleted in previous patch.

> > It seemed in out previous codes we treated "octeon" as "mips", I also

> > though this may not good.

> >

> > Then "mips" or "mips64" is good value?

>

> Since this is under arch/mips64/ directory, so "mips64" is better?

>


I think the ARCH dir needs to be processor architecture specific not SoC
specific, so that sounds right to me.


>

> >

> >> Maxim.

> >>

> >>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {

> >>>                 if (!mhz) {

> >>>                         pos = strstr(str, "BogoMIPS");

> >>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> >>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> >>> index 61714f8..5f4e69d 100644

> >>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> >>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c

> >>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t

> >>> *sysinfo)

> >>>         int model = 0;

> >>>         int count = 2;

> >>>   +     strcpy(sysinfo->cpu_arch_str, "powerpc");

> >>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {

> >>>                 if (!mhz) {

> >>>                         pos = strstr(str, "clock");

> >>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> >>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> >>> index 24187f0..02ec9ea 100644

> >>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> >>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c

> >>> @@ -15,6 +15,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t

> >>> *sysinfo)

> >>>         double ghz = 0.0;

> >>>         int id = 0;

> >>>   +     strcpy(sysinfo->cpu_arch_str, "x86");

> >>>         while (fgets(str, sizeof(str), file) != NULL && id <

> >>> MAX_CPU_NUMBER) {

> >>>                 pos = strstr(str, "model name");

> >>>                 if (pos) {

> >>

> >>

> >> _______________________________________________

> >> lng-odp mailing list

> >> lng-odp@lists.linaro.org

> >> https://lists.linaro.org/mailman/listinfo/lng-odp

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
Hongbo Zhang Jan. 7, 2016, 6:34 a.m. UTC | #5
On 7 January 2016 at 01:25, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>
> On 6 January 2016 at 05:18, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>
>> On 6 January 2016 at 17:22, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>> > On 29 December 2015 at 21:03, Maxim Uvarov <maxim.uvarov@linaro.org>
>> > wrote:
>> >> On 12/29/2015 13:31, hongbo.zhang@linaro.org wrote:
>> >>>
>> >>> From: Hongbo Zhang <hongbo.zhang@linaro.org>
>> >>>
>> >>> The values of cpu_arch_str were deleted due to codes reorganization,
>> >>> this
>> >>> patch adds values to them again.
>> >>>
>> >>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> >>> ---
>> >>>   platform/linux-generic/arch/mips64/odp_sysinfo_parse.c  | 1 +
>> >>>   platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c | 1 +
>> >>>   platform/linux-generic/arch/x86/odp_sysinfo_parse.c     | 1 +
>> >>>   3 files changed, 3 insertions(+)
>> >>>
>> >>> diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> >>> b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> >>> index 8b430f5..3415516 100644
>> >>> --- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> >>> +++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
>> >>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> >>> *sysinfo)
>> >>>         int model = 0;
>> >>>         int count = 2;
>> >>>   +     strcpy(sysinfo->cpu_arch_str, "octeon");
>> >>
>> >>
>> >> there are bunch of other mips based socs, not only octeon.
>> >>
>> >
>> > The string is the original value I deleted in previous patch.
>> > It seemed in out previous codes we treated "octeon" as "mips", I also
>> > though this may not good.
>> >
>> > Then "mips" or "mips64" is good value?
>>
>> Since this is under arch/mips64/ directory, so "mips64" is better?
>
>
> I think the ARCH dir needs to be processor architecture specific not SoC
> specific, so that sounds right to me.
>

Then I will send another iteration with this corrected.

>>
>>
>> >
>> >> Maxim.
>> >>
>> >>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>> >>>                 if (!mhz) {
>> >>>                         pos = strstr(str, "BogoMIPS");
>> >>> diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> >>> b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> >>> index 61714f8..5f4e69d 100644
>> >>> --- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> >>> +++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
>> >>> @@ -16,6 +16,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> >>> *sysinfo)
>> >>>         int model = 0;
>> >>>         int count = 2;
>> >>>   +     strcpy(sysinfo->cpu_arch_str, "powerpc");
>> >>>         while (fgets(str, sizeof(str), file) != NULL && count > 0) {
>> >>>                 if (!mhz) {
>> >>>                         pos = strstr(str, "clock");
>> >>> diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> >>> b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> >>> index 24187f0..02ec9ea 100644
>> >>> --- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> >>> +++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
>> >>> @@ -15,6 +15,7 @@ int odp_cpuinfo_parser(FILE *file, odp_system_info_t
>> >>> *sysinfo)
>> >>>         double ghz = 0.0;
>> >>>         int id = 0;
>> >>>   +     strcpy(sysinfo->cpu_arch_str, "x86");
>> >>>         while (fgets(str, sizeof(str), file) != NULL && id <
>> >>> MAX_CPU_NUMBER) {
>> >>>                 pos = strstr(str, "model name");
>> >>>                 if (pos) {
>> >>
>> >>
>> >> _______________________________________________
>> >> lng-odp mailing list
>> >> lng-odp@lists.linaro.org
>> >> https://lists.linaro.org/mailman/listinfo/lng-odp
>> _______________________________________________
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> --
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org │ Open source software for ARM SoCs
>
>
diff mbox

Patch

diff --git a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
index 8b430f5..3415516 100644
--- a/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/mips64/odp_sysinfo_parse.c
@@ -16,6 +16,7 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 	int model = 0;
 	int count = 2;
 
+	strcpy(sysinfo->cpu_arch_str, "octeon");
 	while (fgets(str, sizeof(str), file) != NULL && count > 0) {
 		if (!mhz) {
 			pos = strstr(str, "BogoMIPS");
diff --git a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
index 61714f8..5f4e69d 100644
--- a/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/powerpc/odp_sysinfo_parse.c
@@ -16,6 +16,7 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 	int model = 0;
 	int count = 2;
 
+	strcpy(sysinfo->cpu_arch_str, "powerpc");
 	while (fgets(str, sizeof(str), file) != NULL && count > 0) {
 		if (!mhz) {
 			pos = strstr(str, "clock");
diff --git a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
index 24187f0..02ec9ea 100644
--- a/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
+++ b/platform/linux-generic/arch/x86/odp_sysinfo_parse.c
@@ -15,6 +15,7 @@  int odp_cpuinfo_parser(FILE *file, odp_system_info_t *sysinfo)
 	double ghz = 0.0;
 	int id = 0;
 
+	strcpy(sysinfo->cpu_arch_str, "x86");
 	while (fgets(str, sizeof(str), file) != NULL && id < MAX_CPU_NUMBER) {
 		pos = strstr(str, "model name");
 		if (pos) {