From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759413AbcAUNEg (ORCPT ); Thu, 21 Jan 2016 08:04:36 -0500 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34682 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759071AbcAUNEe (ORCPT ); Thu, 21 Jan 2016 08:04:34 -0500 Date: Thu, 21 Jan 2016 22:03:35 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Stephane Eranian , Andi Kleen , Wang Nan Subject: Re: [PATCH 02/17] perf hists: Resort hist entries with hierarchy Message-ID: <20160121130335.GC13893@danjae.kornet> References: <1452960197-5323-1-git-send-email-namhyung@kernel.org> <1452960197-5323-3-git-send-email-namhyung@kernel.org> <20160121114149.GF13547@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160121114149.GF13547@krava.brq.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2016 at 12:41:49PM +0100, Jiri Olsa wrote: > On Sun, Jan 17, 2016 at 01:03:02AM +0900, Namhyung Kim wrote: > > SNIP > > > + min_callchain_hits, > > + &callchain_param); > > + } > > +} > > + > > static void __hists__insert_output_entry(struct rb_root *entries, > > struct hist_entry *he, > > u64 min_callchain_hits, > > @@ -1288,6 +1356,17 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog) > > > > min_callchain_hits = hists->stats.total_period * (callchain_param.min_percent / 100); > > > > + hists__reset_stats(hists); > > + hists__reset_col_len(hists); > > + > > + if (symbol_conf.report_hierarchy) { > > + return hists__hierarchy_output_resort(hists, prog, > > + &hists->entries_collapsed, > > is the 'in-root' always hists->entries_collapsed in here? > > should you use the 'root' var from the condition below? The symbol_conf.report_hierarchy imples sort__need_collapse since it needs to build the hierarchy during 'collapse' stage. So yes, it's always hists->entries_collapsed. Thanks, Namhyung > > > + &hists->entries, > > + min_callchain_hits, > > + use_callchain); > > + } > > + > > if (sort__need_collapse) > > root = &hists->entries_collapsed; > > else > > @@ -1296,9 +1375,6 @@ void hists__output_resort(struct hists *hists, struct ui_progress *prog) > > next = rb_first(root); > > hists->entries = RB_ROOT; > > > > - hists__reset_stats(hists); > > - hists__reset_col_len(hists); > > - > > while (next) { > > n = rb_entry(next, struct hist_entry, rb_node_in); > > next = rb_next(&n->rb_node_in); > > -- > > 2.6.4 > >