lkml.org 
[lkml]   [2012]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/14] perf hists: Resort hist entries using group members for output
On Mon, Dec 17, 2012 at 03:38:57PM +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>

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)
> + return ret;
> +
> + evsel = hists_to_evsel(a->hists);
> + nr_members = evsel->nr_members;
> + if (nr_members <= 1)
> + return ret;
> +
> + periods_a = zalloc(sizeof(periods_a) * nr_members);
> + periods_b = zalloc(sizeof(periods_b) * nr_members);

alloca might be more convenient, but not necessary I guess

but as this place would be changed if (when) I send the
patch for linking hist_entries via array.. I'm ok ;-)

Acked-by: Jiri Olsa <jolsa@redhat.com>


\
 
 \ /
  Last update: 2012-12-18 17:01    [W:0.224 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site