Messages in this thread | | | Date | Tue, 18 Dec 2012 16:39:23 +0100 | From | Jiri Olsa <> | Subject | Re: [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>
| |