lkml.org 
[lkml]   [2013]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 05/13] perf hists: Resort hist entries using group members for output
Date
Hi Arnaldo,

On Tue, 15 Jan 2013 15:29:15 -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jan 15, 2013 at 04:31:49PM +0900, Namhyung Kim escreveu:
>> From: Namhyung Kim <namhyung.kim@lge.com>
>>
>> When event group is enabled, sorting hist entries on periods for output
>> should consider groups members' period also. To do that, build period
>> table using link/pair information and compare the table.
[snip]
>> +static int hist_entry__sort_on_period(struct hist_entry *a,
>> + struct hist_entry *b)
>> +{
>> + int ret;
>> + int i, nr_members;
>> + struct perf_evsel *evsel;
>> + struct hist_entry *pair;
>> + u64 *periods_a, *periods_b;
>> +
>> + ret = period_cmp(a->stat.period, b->stat.period);
>> + if (ret || !symbol_conf.event_group)
>
> Why do we need to call period_cmp() when symbol_conf.event_group is
> false?
>
> I see, confusing neverthless :-\

In this function @a and @b are entries of group leaders and should be
compared first - other group members are compared only if periods of
leader entries are same.

For non-group events or when event group view is disabled, this function
will be called for every events as if they're leaders.


>
>> + return ret;
>
> I would expect two functions, one for sorting on period and another for
> not sorting on period, i.e. don't call a function called
> 'sort_on_period' when _not_ sorting on period.

Sorry, I can't understand.

This 'sort_on_period' function is called during the (final) output
resorting and it's unconditional. IOW hist entries should be sorted by
their period to be shown accordingly in the output.

Am I missing something?

Thanks,
Namhyung


\
 
 \ /
  Last update: 2013-01-16 12:21    [W:0.062 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site