Re: [PATCH 01/14] perf diff: Use internal rb tree forhists__precompute

From: Arnaldo Carvalho de Melo
Date: Fri May 24 2013 - 09:45:32 EST


Em Thu, Dec 13, 2012 at 02:08:59PM +0100, Jiri Olsa escreveu:

> diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c

> while (next != NULL) {
> - struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node);
> - struct hist_entry *pair = hist_entry__next_pair(he);
> + struct hist_entry *he, *pair;
>
> - next = rb_next(&he->rb_node);
> + he = rb_entry(next, struct hist_entry, rb_node_in);
> + pair = hist_entry__next_pair(he);
> +
> + next = rb_next(&he->rb_node_in);


To ease review please try to make the patch as minimal as possible, i.e.
the above could be done as:

- struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node);
+ struct hist_entry *he = rb_entry(next, struct hist_entry, rb_node_in);
struct hist_entry *pair = hist_entry__next_pair(he);

- next = rb_next(&he->rb_node);
+ next = rb_next(&he->rb_node_in);

See how we can more quickly see what happened? I.e. just replacing
'rb_node' with 'rb_node_in' :-)

- Arnaldo
--
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/