From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753240AbcHPTVo (ORCPT ); Tue, 16 Aug 2016 15:21:44 -0400 Received: from mail.kernel.org ([198.145.29.136]:45910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751584AbcHPTVm (ORCPT ); Tue, 16 Aug 2016 15:21:42 -0400 Date: Tue, 16 Aug 2016 16:21:31 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Linux Kernel Mailing List Subject: Re: RFC: callchain showing same entry as hist_entry Message-ID: <20160816192131.GO20972@kernel.org> References: <20160816143628.GG20972@kernel.org> <20160816145511.GA11382@danjae.aot.lge.com> <20160816150803.GI20972@kernel.org> <20160816152355.GC11382@danjae.aot.lge.com> <20160816153143.GJ20972@kernel.org> <20160816153244.GK20972@kernel.org> <20160816154118.GE11382@danjae.aot.lge.com> <20160816154657.GL20972@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160816154657.GL20972@kernel.org> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Aug 16, 2016 at 12:46:57PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Wed, Aug 17, 2016 at 12:41:18AM +0900, Namhyung Kim escreveu: > > Hmm.. if so, wouldn't it be better skipping the first callchain entry > > when the user-given sort key contains "sym" too (not only when it > > starts with 'sym')? > > Probably, I think, whatever causes the mentioned duplication. And do > that at all the UIs, hence the suggestion for a callchain__first_node() > or more suitably named routine where such logic would live, to be > used for all the callchain rendering interfaces. So, it is not possible to have that callchain__first_node() one, since we're dealing with one of the "list" entries, that are in each "node", etc, we need to do that test when printing the first entry, how about this one instead? commit 83b98f4da0068a4aefe49554351f33944dfd03d1 Author: Arnaldo Carvalho de Melo Date: Tue Aug 16 11:36:50 2016 -0300 perf callchain: Do not repeat the hist_entry symbol as the 1st callchain entry We were getting: 2.62% [k] __d_lookup_rcu | ---__d_lookup_rcu | --2.52%--lookup_fast | --2.50%--walk_component Noticed the __d_lookup_rcu dup, elide that first entry if "sym" is in the sort order, as in the current default sort order: 2.62% [k] __d_lookup_rcu | --2.52%--lookup_fast | --2.50%--walk_component This is for --stdio, TUI being investigated. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/r/20160816143628.GG20972@kernel.org Signed-off-by: Arnaldo Carvalho de Melo diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 9b65f4a6b35a..a894e35bb4d4 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c @@ -206,8 +206,7 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, * the symbol. No need to print it otherwise it appears as * displayed twice. */ - if (!i++ && field_order == NULL && - sort_order && !prefixcmp(sort_order, "sym")) + if (!i++ && field_order == NULL && perf_hpp_list.sym) continue; if (!printed) { ret += callchain__fprintf_left_margin(fp, left_margin);