From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754128AbcC3QMv (ORCPT ); Wed, 30 Mar 2016 12:12:51 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33271 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752794AbcC3QMt (ORCPT ); Wed, 30 Mar 2016 12:12:49 -0400 Date: Thu, 31 Mar 2016 01:12:36 +0900 From: Namhyung Kim To: Arnaldo Carvalho de Melo Cc: Ingo Molnar , Peter Zijlstra , Jiri Olsa , LKML , David Ahern , Andi Kleen , Stephane Eranian , Wang Nan Subject: Re: [PATCH 2/5] perf report: Show message for percent limit on stdio Message-ID: <20160330161236.GB1557@danjae> References: <1456488800-28124-1-git-send-email-namhyung@kernel.org> <1456488800-28124-2-git-send-email-namhyung@kernel.org> <20160330141242.GC3420@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160330141242.GC3420@kernel.org> 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 Hi Arnaldo, On Wed, Mar 30, 2016 at 11:12:42AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 26, 2016 at 09:13:17PM +0900, Namhyung Kim escreveu: > > When the hierarchy mode is used, some entries might be omiited due to a > > percent limit or filter. In this case the output hierarchy is different > > than other entries. Add an informative message to users about this. > > > > For example, when 4% of percent limit is applied: > > Hi Namhyung, while replying to a message about parent sorting being > broken I noticed that the code to show a message about --percent-limit > seems to be only present on --hierachy mode, could you please consider > adding it to the non-hierarchy case? Currently the 'no entry' message is for hist entries, not for call chains. With --percent-limit option the callchains below the limit are always silently discarded. This is same for the hierarchy mode too. Thanks, Namhyung > > Thanks, > > - Arnaldo > > > > > After: > > > > # Overhead Command / Shared Object / Symbol > > # .............. .......................................... > > # > > 49.09% swapper > > 48.67% [kernel.vmlinux] > > 34.42% [k] intel_idle > > 11.51% firefox > > 8.87% libpthread-2.22.so > > 6.60% [.] __GI___libc_recvmsg > > 10.49% gnome-shell > > 4.74% libc-2.22.so > > no entry >= 4.00% > > 10.08% Xorg > > 6.11% libc-2.22.so > > 5.27% [.] __memcpy_sse2_unaligned > > 6.15% perf > > no entry >= 4.00% > > > > Suggested-by: Arnaldo Carvalho de Melo > > Signed-off-by: Namhyung Kim > > --- > > tools/perf/ui/stdio/hist.c | 17 +++++++++++++++++ > > 1 file changed, 17 insertions(+) > > > > diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c > > index 435eaaaf2f1d..b3bdfcb245f9 100644 > > --- a/tools/perf/ui/stdio/hist.c > > +++ b/tools/perf/ui/stdio/hist.c > > @@ -628,6 +628,7 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, > > bool first = true; > > size_t linesz; > > char *line = NULL; > > + unsigned indent; > > > > init_rem_hits(); > > > > @@ -704,6 +705,8 @@ print_entries: > > goto out; > > } > > > > + indent = hists__overhead_width(hists) + 4; > > + > > for (nd = rb_first(&hists->entries); nd; nd = __rb_hierarchy_next(nd, HMD_FORCE_CHILD)) { > > struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); > > float percent; > > @@ -720,6 +723,20 @@ print_entries: > > if (max_rows && ++nr_rows >= max_rows) > > break; > > > > + /* > > + * If all children are filtered out or percent-limited, > > + * display "no entry >= x.xx%" message. > > + */ > > + if (!h->leaf && !hist_entry__has_hierarchy_children(h, min_pcnt)) { > > + int nr_sort = hists->hpp_list->nr_sort_keys; > > + > > + print_hierarchy_indent(sep, nr_sort + h->depth + 1, spaces, fp); > > + fprintf(fp, "%*sno entry >= %.2f%%\n", indent, "", min_pcnt); > > + > > + if (max_rows && ++nr_rows >= max_rows) > > + break; > > + } > > + > > if (h->ms.map == NULL && verbose > 1) { > > __map_groups__fprintf_maps(h->thread->mg, > > MAP__FUNCTION, fp); > > -- > > 2.7.1