Re: perf report sort
From: Namhyung Kim
Date: Fri Aug 13 2021 - 16:17:25 EST
+ LKML and linux-perf-users
On Thu, Aug 12, 2021 at 5:20 PM Arnaldo Melo <acme@xxxxxxxxxx> wrote:
>
> On Thu, Aug 12, 2021 at 4:15 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>>
>> Hi Ian,
>>
>> On Wed, Aug 11, 2021 at 12:01 AM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>> > My suspicion is that page_fault and _dl_relocate_object have identical
>> > numbers of samples (5.56%) but sorting by the symbol (in sort_order)
>> > should solve this. I suspect providing a sort order in the test will
>> > make it robust, but I'm confused looking at the builtin-report code as
>> > it reads that this should already happen. I wondered if you had any
>> > suggestions?
>>
>> So actually the sort key doesn't sort the output. :(
>> It should be called 'group-by' rather than sort.
>
>
> I think there is value in changing this behaviour to match what Ian expected, don't you think?
>
> And also I think we should start doing this not via command line options, but via .perfconfig settings.
>
> And perhaps we can mark these kinds of settings as .perfconfig-only ones.
>
> This way we can have a 'perf config' mode that extracts these settings to share with others, or keep
> per-organization defaults.
>
> The range of preferences is huge, it is really difficult to find sane defaults that please everybody, so we probably should try to help facilitate per-community defaults.
>
> wdyt?
I agree that it's confusing especially with -F/--fields option.
If users want to change the behavior to be a real sort key
they probably need to use -F too.
Not sure what's the best way to handle it. But by providing
the config option, I guess users should be aware of the
change and use appropriate options.
>
> - Arnaldo
>
> P.S.: This discussion should really have happened in the open, please consider replying to this CCing linux-perf-users & linux-kernel while keeping as-is this response :-)
Yep, Cc-ed.
Thanks,
Namhyung
>
>>
>> The output is sorted by the overhead (= period) by default.
>>
>> There is -F/--fields option to control which fields are displayed.
>> When it's used, the -s option will behave as (real) sort keys.
>> In fact, 'perf report' (using the default sort key) is same as
>>
>> perf report -F overhead,comm,dso,sym -s overhead
>>
>> If you want to sort the output by symbol name,
>>
>> perf report -F overhead,comm,dso,sym -s sym
>>
>> Maybe we need to change the test like above.
>>
>> Thanks,
>> Namhyung
>>