[PATCH] tools/perf: Fix aggr_printout to display cpu field irrespective of core value
Athira Rajeev
atrajeev at linux.vnet.ibm.com
Fri Oct 7 01:37:36 AEDT 2022
> On 06-Oct-2022, at 7:33 PM, Arnaldo Carvalho de Melo <acme at kernel.org> wrote:
>
> Em Thu, Oct 06, 2022 at 06:16:14PM +0530, Athira Rajeev escreveu:
>>
>>
>>> On 05-Oct-2022, at 6:05 PM, Arnaldo Carvalho de Melo <acme at kernel.org> wrote:
>>>
>>> Em Wed, Oct 05, 2022 at 09:28:52AM -0300, Arnaldo Carvalho de Melo escreveu:
>>>> Em Wed, Oct 05, 2022 at 10:23:39AM +0530, Athira Rajeev escreveu:
>>>>> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
>>>>> index b82844cb0ce7..cf28020798ec 100644
>>>>> --- a/tools/perf/util/stat-display.c
>>>>> +++ b/tools/perf/util/stat-display.c
>>>>> @@ -168,7 +168,7 @@ static void aggr_printout(struct perf_stat_config *config,
>>>>> id.socket,
>>>>> id.die,
>>>>> id.core);
>>>>> - } else if (id.core > -1) {
>>>>> + } else if (id.cpu.cpu > -1) {
>>>>> fprintf(config->output, "\"cpu\" : \"%d\", ",
>>>>> id.cpu.cpu);
>>>>> }
>>>>> @@ -179,7 +179,7 @@ static void aggr_printout(struct perf_stat_config *config,
>>>>> id.die,
>>>>> config->csv_output ? 0 : -3,
>>>>> id.core, config->csv_sep);
>>>>> - } else if (id.core > -1) {
>>>>> + } else if (id.cpu.cpu > -1) {
>>>>> fprintf(config->output, "CPU%*d%s",
>>>>> config->csv_output ? 0 : -7,
>>>>> id.cpu.cpu, config->csv_sep);
>>>>> --
>>>>> If it is confusing, shall I send it as a separate patch along with Tested-by from Ian ?
>>>>
>>>> I'll have to do this by hand, tried pointing b4 to this message and it
>>>> picked the old one, also tried to save the message and apply by hand,
>>>> its mangled.
>>>
>>> This is what I have now, will force push later, please triple check :-)
>>
>>
>> Sorry for all the confusion Arnaldo. Hereafter, I will resubmit the patch to avoid this.
>> In below patch which you shared, code change is correct. But commit message is different.
>> So to avoid further confusion, I went ahead and posted a separate patch in the mailing list with:
>>
>> subject: [PATCH] tools/perf: Fix cpu check to use id.cpu.cpu in aggr_printout
>> Patch link: https://lore.kernel.org/lkml/20221006114225.66303-1-atrajeev@linux.vnet.ibm.com/T/#u
>>
>> Please pick the separately send patch.
>
> Ok, will do.
Thanks Arnaldo.
>
> - Arnaldo
More information about the Linuxppc-dev
mailing list