Re: [PATCH 00/12] perf annotate: Add support for event group view (v2)

From: Namhyung Kim
Date: Mon Mar 11 2013 - 23:21:45 EST

Hi Arnaldo,

On Mon, 11 Mar 2013 17:53:16 -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Mar 05, 2013 at 02:53:20PM +0900, Namhyung Kim escreveu:
>> This patchset implements event group view on perf annotate. It's
>> basically a rebased version and major difference to prior version is
>> the GTK annotation browser support.
>> Here goes an example:
>> $ perf annotate --group --stdio
>> crtstuff.c:0
>> 8.08 2.40 5.29 : 387dc0aa50: mov %rdi,%rdx
> I applied this series minus the TUI enabling one, as it is not working,
> so right now my perf/core has --group --stdio and --group --gtk working,
> please take a look at --group --tui.

Thanks, I took a look at the TUI code and found some missing pieces and
bugs. Those code were in the original version but seems to get lost
during the cherry-picking and I tested wrong version. :(

> I need to go thru this more thoroughly, as at least one thing caught my
> attention, in some cases ->nr_pcnt is used and in others
> evsel->nr_members, do we need both?

Probably not. I was thought keeping an array and its length together is
better. But it's rather a waste to save the same information to every
date structure so I move it to the struct annotate_browser->nr_events.

For evsel->nr_members, current code sets it only for grouping is enabled
so the individual events will have value of 0. Also it's not pass the
evsel to every function need it. But if you think it should really be
fixed that way I can make the change to pass and use evsel->nr_members.

Anyway, below is a fixed version that could survived my testing.