lkml.org 
[lkml]   [2012]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] perf hists: Link hist entries before inserting to an output tree
On Wed, Dec 05, 2012 at 03:56:42PM +0900, Namhyung Kim wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>

SNIP

> - struct rb_node *next = rb_first(&hists->entries);
> + struct rb_root *root;
> + struct rb_node *next;
> +
> + if (sort__need_collapse)
> + root = &hists->entries_collapsed;
> + else
> + root = hists->entries_in;
>
> + next = rb_first(root);
> while (next != NULL) {
> - 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);
>
> - next = rb_next(&he->rb_node);
> + next = rb_next(&he->rb_node_in);
> if (!hist_entry__next_pair(he)) {
> - rb_erase(&he->rb_node, &hists->entries);
> + rb_erase(&he->rb_node_in, root);
> hist_entry__free(he);
> }
> }
> @@ -481,6 +459,11 @@ static void hists__process(struct hists *old, struct hists *new)
> else
> hists__link(new, old);
>
> + hists__output_resort(new);
> +
> + if (show_displacement)
> + hists__compute_position(new);
> +

Computing the position after hists__link screws up the position data,
because we likely have new entries in.

However, I wonder if anyone is actualy using displacement info..?

jirka


\
 
 \ /
  Last update: 2012-12-05 22:01    [W:0.086 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site