Re: [PATCH 7/9] perf annotate: Display the branch counter histogram

Liang, Kan
2024-08-06T21:37:06Z

Hi Andi,

On 2024-08-06 10:42 a.m., Liang, Kan wrote:
>
>
> On 2024-08-02 5:09 p.m., Andi Kleen wrote:
>>> Display the branch counter histogram in the annotation view.
>>>
>>> Press 'B' to display the branch counter's abbreviation list as well.
>>>
>>> Samples: 1M of events 'anon group { branch-instructions:ppp, branch-misses }',
>>> 4000 Hz, Event count (approx.):
>>> f3 /home/sdp/test/tchain_edit [Percent: local period]
>>
>> Can we output the abbreviation mappings here in the header too?
>> Otherwise it will be hard to use.
>
> If so, the 'B' will be redundant. I will remove the 'B' and move the
> abbreviation mappings in the header.
>

Actually, the output here is in the TUI mode, not --stdio mode.

There is only one single title line for the TUI mode.
It's filled out quickly. As you can see in the example, the number of
the "Event count (approx.)" is missed as well. The abbreviation mappings
will never get a chance to be output.

For the TUI mode, usually shortcut keys are used to display aux
information. The 'B' in this patch follows the existing behavior.

For the --stdio mode, perf should print out the abbreviation mappings in
the header. I think the --stdio mode is the one used by other tools to
parse the result, right? The previous patch 6 (--stdio mode) does show
everything in the header.

Is there a use-case in the TUI mode that has difficulties utilizing the
shortcut 'B'? If yes, could you please elaborate?

Thanks,
Kan