From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753992Ab2LETcy (ORCPT ); Wed, 5 Dec 2012 14:32:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58153 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753772Ab2LETcu (ORCPT ); Wed, 5 Dec 2012 14:32:50 -0500 Date: Wed, 5 Dec 2012 20:15:47 +0100 From: Jiri Olsa To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Paul Mackerras , Ingo Molnar , LKML , Namhyung Kim , Stephane Eranian Subject: Re: [PATCH 2/3] perf hists: Link hist entries before inserting to an output tree Message-ID: <20121205191547.GC1037@krava.brq.redhat.com> References: <1354690603-31364-1-git-send-email-namhyung@kernel.org> <1354690603-31364-3-git-send-email-namhyung@kernel.org> <20121205190646.GB1037@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121205190646.GB1037@krava.brq.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2012 at 08:06:46PM +0100, Jiri Olsa wrote: > On Wed, Dec 05, 2012 at 03:56:42PM +0900, Namhyung Kim wrote: > > From: Namhyung Kim > > > > 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..? hum, the point of the displacement is to show how far is the matching entry in baseline wrt report output -> after hists__output_resort.. that goes in opposite way of what we try do to in here. Anyone else in favour of removing 'Displ.' column? ;-) jirka