lkml.org 
[lkml]   [2013]   [May]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/14] perf diff: Use internal rb tree for hists__precompute
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


\
 
 \ /
  Last update: 2013-05-24 16:21    [W:0.093 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site