Re: [PATCH 06/14] perf hists: Resort hist entries using groupmembers for output

From: Jiri Olsa
Date: Tue Dec 18 2012 - 10:39:21 EST


On Mon, Dec 17, 2012 at 03:38:57PM +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@xxxxxxx>

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@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/