From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966536AbcA1M0D (ORCPT ); Thu, 28 Jan 2016 07:26:03 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34998 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964868AbcA1MZ7 (ORCPT ); Thu, 28 Jan 2016 07:25:59 -0500 Date: Thu, 28 Jan 2016 21:24:54 +0900 From: Namhyung Kim To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , Andi Kleen , David Ahern , Frederic Weisbecker , Wang Nan Subject: Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Message-ID: <20160128122454.GA27446@danjae.kornet> References: <1453909257-26015-1-git-send-email-namhyung@kernel.org> <20160128081611.GC2322@krava.brq.redhat.com> <20160128121245.GA17708@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160128121245.GA17708@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 28, 2016 at 01:12:45PM +0100, Jiri Olsa wrote: > On Thu, Jan 28, 2016 at 07:16:43PM +0900, Namhyung Kim wrote: > > On Thu, Jan 28, 2016 at 7:14 PM, Namhyung Kim wrote: > > > On Thu, Jan 28, 2016 at 5:16 PM, Jiri Olsa wrote: > > >> On Thu, Jan 28, 2016 at 12:40:47AM +0900, Namhyung Kim wrote: > > >>> Hello, > > >>> > > >>> This patchset tries to implement percent limit to callchains which was > > >>> requested by Andi Kleen. For some reason, limiting callchains by > > >>> (overhead) percentage didn't work well. This patch fixes it and make > > >>> --percent-limit also works for callchains as well as hist entries. > > >>> > > >>> * Changes from v1) > > >>> - fix insertion path instead of changing all UI code > > >>> - show percent value even on single path (if needed) > > >>> - change default callchain percent limit > > >>> > > >>> This is available on 'perf/callchain-limit-v2' branch in my tree: > > >>> > > >>> git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git > > >>> > > >>> Any comments are welcome, > > >>> > > >>> Thanks, > > >>> Namhyung > > >>> *** BLURB HERE *** > > >>> > > >>> Namhyung Kim (10): > > >>> perf hists: Fix min callchain hits calculation > > >>> perf hists: Update hists' total period when adding entries > > >>> perf report: Apply --percent-limit to callchains also > > >>> perf report: Get rid of hist_entry__callchain_fprintf() > > >>> perf tools: Pass parent_samples to __callchain__fprintf_graph() > > >>> perf report: Fix percent display in callchains on --stdio > > >>> perf hists browser: Fix dump to show correct callchain style > > >>> perf hists browser: Pass parent_total to callchain print functions > > >>> perf hists browser: Fix percent display in callchains > > >>> perf tools: Change default calchain percent limit to 0.005% > > >> > > >> also I see extra fo entries with callchain filtered out in stdio mode > > >> > > >> jirka > > >> > > >> > > >> --- > > >> 8.41% yes libc-2.21.so [.] fputs_unlocked > > >> | > > >> ---fputs_unlocked > > >> | > > >> |--5.67%--0x757074756f206472 > > >> | > > >> --2.74%--0x3ba8e0 > > >> 0x21e000 > > >> > > >> 2.47% yes yes [.] fputs_unlocked@plt > > >> | > > >> ---fputs_unlocked@plt > > >> 0x3ba8e0 > > >> 0x21e000 > > >> > > >> 0.12% yes [kernel.vmlinux] [k] vfs_write > > >> > > >> 0.09% yes libc-2.21.so [.] _IO_do_write@@GLIBC_2.2.5 > > >> > > >> 0.08% yes [kernel.vmlinux] [k] entry_SYSCALL_64 > > >> > > >> 0.07% yes [kernel.vmlinux] [k] fsnotify > > >> > > >> 0.06% yes [kernel.vmlinux] [k] sys_write > > >> > > > > > > I guess it's same for other UI outputs too. > > > > > > The default limit of hist entries is 0 so it basically shows all > > > entries. But default callchain limit is 0.5% so hist entries under > > > 0.5% won't show callchains. > > > > Btw, I changed it to 0.005% in this patchset. Did you apply all the > > patches and run 'perf report' with default value? > > yep, I had it and then reverted ;-) but I made typo > in the previous email.. what I meant was: > > also I see extra LINE for entries... ;-) Ah, so you meant the blank lines.. The fix would be like following >>From 62ac44405797275aed35acb38cfe3d1afa6b709c Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Thu, 28 Jan 2016 21:18:53 +0900 Subject: [PATCH 11/10] perf report: Don't show blank lines if entry has no callchain When all callchains of a hist entry is percent-limited, do not add a blank line at the end. It makes the entry look like it doesn't have callchains. Reported-by: Jiri Olsa Signed-off-by: Namhyung Kim --- tools/perf/ui/stdio/hist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 76ff46becac8..691e52ce7510 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c @@ -233,7 +233,10 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root, ret += __callchain__fprintf_graph(fp, root, total_samples, 1, 1, left_margin); - ret += fprintf(fp, "\n"); + if (ret) { + /* do not add a blank line if it printed nothing */ + ret += fprintf(fp, "\n"); + } return ret; } -- 2.6.4