From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492AbcHPOuE (ORCPT ); Tue, 16 Aug 2016 10:50:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51664 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752809AbcHPOuD (ORCPT ); Tue, 16 Aug 2016 10:50:03 -0400 Date: Tue, 16 Aug 2016 16:50:01 +0200 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Jiri Olsa , Linux Kernel Mailing List Subject: Re: RFC: callchain showing same entry as hist_entry Message-ID: <20160816145001.GA25879@krava> References: <20160816143628.GG20972@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160816143628.GG20972@kernel.org> User-Agent: Mutt/1.6.2 (2016-07-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 16 Aug 2016 14:50:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 16, 2016 at 11:36:28AM -0300, Arnaldo Carvalho de Melo wrote: > Hi Namhyung, Jiri, > > please take a look at the patch below, and Ack if possible, it > is a problem introduced in: > > cfaa154b2335 ("perf tools: Get rid of obsolete hist_entry__sort_list") > > That is not equivalent to the code that was there and results in having > the same entry as the first entry for the callchain as in the > hist_entry, which is annoying and doesn't match the original intent of > that 'continue' branch, as described in the comment right above it. > > Now looking at doing the same for the TUI... yep, seems ok.. no sort_order -> no first entry jirka > > - Arnaldo > > diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c > index 9b65f4a6b35a..46a083e59ce9 100644 > --- a/tools/perf/ui/stdio/hist.c > +++ b/tools/perf/ui/stdio/hist.c > @@ -207,7 +207,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, > * displayed twice. > */ > if (!i++ && field_order == NULL && > - sort_order && !prefixcmp(sort_order, "sym")) > + (sort_order == NULL || !prefixcmp(sort_order, "sym"))) > continue; > if (!printed) { > ret += callchain__fprintf_left_margin(fp, left_margin);