lkml.org 
[lkml]   [2016]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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;
> +}
> +

\
 
 \ /
  Last update: 2016-09-19 09:48    [W:0.098 / U:0.956 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site