[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160919074824.GA26906@krava>
Date: Mon, 19 Sep 2016 09:48:24 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 1/7] perf hist: Introduce hists__match_hierarchy()
On Tue, Sep 13, 2016 at 04:45:46PM +0900, Namhyung Kim wrote:
SNIP
> +static struct hist_entry *hists__find_hierarchy_entry(struct rb_root *root,
> + struct hist_entry *he)
> +{
> + struct rb_node *n = root->rb_node;
> +
> + while (n) {
> + struct hist_entry *iter;
> + struct perf_hpp_fmt *fmt;
> + int64_t cmp = 0;
> +
> + iter = rb_entry(n, struct hist_entry, rb_node_in);
> + perf_hpp_list__for_each_sort_list(he->hpp_list, fmt) {
> + cmp = fmt->collapse(fmt, iter, he);
> + if (cmp)
> + break;
> + }
could you call hist_entry__collapse in here instead of above code?
thanks,
jirka
> +
> + if (cmp < 0)
> + n = n->rb_left;
> + else if (cmp > 0)
> + n = n->rb_right;
> + else
> + return iter;
> + }
> +
> + return NULL;
> +}
> +
Powered by blists - more mailing lists