From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751894AbcBURuR (ORCPT ); Sun, 21 Feb 2016 12:50:17 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35777 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751319AbcBURuO (ORCPT ); Sun, 21 Feb 2016 12:50:14 -0500 Date: Sun, 21 Feb 2016 17:36:18 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Stephane Eranian , Wang Nan Subject: Re: [PATCH v6 10/25] perf hists: Resort hist entries with hierarchy Message-ID: <20160221083617.GB32589@danjae.kornet> References: <1455631723-17345-1-git-send-email-namhyung@kernel.org> <1455631723-17345-11-git-send-email-namhyung@kernel.org> <20160220231918.GD17925@krava.homerouter.cpe> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160220231918.GD17925@krava.homerouter.cpe> 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 Sun, Feb 21, 2016 at 12:19:18AM +0100, Jiri Olsa wrote: > On Tue, Feb 16, 2016 at 11:08:28PM +0900, Namhyung Kim wrote: > > SNIP > > > @@ -1349,6 +1427,17 @@ static void output_resort(struct hists *hists, struct ui_progress *prog, > > > > min_callchain_hits = callchain_total * (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, > > + &hists->entries, > > + min_callchain_hits, > > + use_callchain); > > + } > > + > > if (sort__need_collapse) > > root = &hists->entries_collapsed; > > else > > @@ -1357,9 +1446,6 @@ static void output_resort(struct hists *hists, struct ui_progress *prog, > > next = rb_first(root); > > hists->entries = RB_ROOT; > > above line could be moved together with those 2 below > and you can then remove *root_out = RB_ROOT; line in > hists__hierarchy_output_resort Nope. The root_out should be initialized anyway since it's called recursively with child's hroot_out. Thanks, Namhyung > > > > - 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.7.1 > >