Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1319075 > unrolled thread

[PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

Started byNamhyung Kim <namhyung@kernel.org>
First post2016-01-27 16:50 +0100
Last post2016-02-03 11:30 +0100
Articles 15 on this page of 35 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
    [PATCH 07/10] perf hists browser: Fix dump to show correct callchain style Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      [tip:perf/core] perf hists browser:   Fix dump to show correct callchain style tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [PATCH 09/10] perf hists browser: Fix percent display in callchains Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      [tip:perf/core] perf hists browser:   Fix percent display in callchains tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [PATCH 04/10] perf report: Get rid of hist_entry__callchain_fprintf() Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      [tip:perf/core] perf report:   Get rid of hist_entry__callchain_fprintf() tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [PATCH 01/10] perf hists: Fix min callchain hits calculation Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      [tip:perf/core] perf hists: Fix min callchain hits calculation tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [PATCH 03/10] perf report: Apply --percent-limit to callchains also Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-01 21:20 +0100
        Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Namhyung Kim <namhyung@kernel.org> - 2016-02-02 14:10 +0100
          Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-02 15:00 +0100
            Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Namhyung Kim <namhyung@kernel.org> - 2016-02-02 15:20 +0100
              Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-02 15:30 +0100
                Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Namhyung Kim <namhyung@kernel.org> - 2016-02-02 15:40 +0100
                  Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-02-02 16:00 +0100
                    Re: [PATCH 03/10] perf report: Apply --percent-limit to callchains  also Namhyung Kim <namhyung@kernel.org> - 2016-02-02 16:10 +0100
      [tip:perf/core] perf report:   Apply --percent-limit to callchains also tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [PATCH 06/10] perf report: Fix percent display in callchains on --stdio Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      [tip:perf/core] perf report:   Fix percent display in callchains on --stdio tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100
    [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005% Namhyung Kim <namhyung@kernel.org> - 2016-01-27 16:50 +0100
      Re: [RFC/PATCH 10/10] perf tools: Change default calchain percent  limit to 0.005% Andi Kleen <andi@firstfloor.org> - 2016-01-27 17:10 +0100
        Re: [RFC/PATCH 10/10] perf tools: Change default calchain percent  limit to 0.005% Namhyung Kim <namhyung@kernel.org> - 2016-01-28 00:40 +0100
    Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Jiri Olsa <jolsa@redhat.com> - 2016-01-28 09:20 +0100
      Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Namhyung Kim <namhyung@gmail.com> - 2016-01-28 09:50 +0100
    Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Jiri Olsa <jolsa@redhat.com> - 2016-01-28 09:20 +0100
      Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Namhyung Kim <namhyung@kernel.org> - 2016-01-28 11:20 +0100
        Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Namhyung Kim <namhyung@kernel.org> - 2016-01-28 11:20 +0100
          Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Jiri Olsa <jolsa@redhat.com> - 2016-01-28 13:20 +0100
            Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Namhyung Kim <namhyung@kernel.org> - 2016-01-28 13:30 +0100
              Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Jiri Olsa <jolsa@redhat.com> - 2016-01-28 21:00 +0100
                Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains  (v2) Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-01-29 22:10 +0100
                  Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2) Namhyung Kim <namhyung@kernel.org> - 2016-01-30 15:00 +0100
              [tip:perf/core] perf report: Don'  t show blank lines if entry has no callchain tip-bot for Namhyung Kim <tipbot@zytor.com> - 2016-02-03 11:30 +0100

Page 2 of 2 — ← Prev page 1 [2]


#1325171 — [tip:perf/core] perf report: Fix percent display in callchains on --stdio

Fromtip-bot for Namhyung Kim <tipbot@zytor.com>
Date2016-02-03 11:30 +0100
Subject[tip:perf/core] perf report: Fix percent display in callchains on --stdio
Message-ID<qY2Re-H6-47@gated-at.bofh.it>
In reply to#1319087
Commit-ID:  7ed5d6e28a0a1a54f554b0ab9c38a6061e7cac9e
Gitweb:     http://git.kernel.org/tip/7ed5d6e28a0a1a54f554b0ab9c38a6061e7cac9e
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 28 Jan 2016 00:40:53 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 1 Feb 2016 17:41:32 -0300

perf report: Fix percent display in callchains on --stdio

When there's only a single callchain, perf doesn't print its percentage
in front of the symbols.  This is because it assumes that the percentage
is same as parents.  But if a percent limit is applied, it's possible
that there are actually a couple of child nodes but only one of them is
shown.  In this case it should display the percent to prevent
misunderstanding of its percentage is same as the parent's.

For example, let's see the following callchain.

  $ perf report -s comm --percent-limit 0.01 --stdio
  ...
     9.95%  swapper
            |
            |--7.57%--intel_idle
            |          cpuidle_enter_state
            |          cpuidle_enter
            |          call_cpuidle
            |          cpu_startup_entry
            |          |
            |          |--4.89%--start_secondary
            |          |
            |           --2.68%--rest_init
            |                     start_kernel
            |                     x86_64_start_reservations
            |                     x86_64_start_kernel
	    |
	    |--0.15%--__schedule
	    |          |
	    |          |--0.13%--schedule
	    |          |          schedule_preempt_disable
	    |          |          cpu_startup_entry
            |          |          |
            |          |          |--0.09%--start_secondary
            |          |          |
            |          |           --0.04%--rest_init
            |          |                     start_kernel
            |          |                     x86_64_start_reservations
            |          |                     x86_64_start_kernel
            |          |
            |           --0.01%--schedule_preempt_disabled
            |                     cpu_startup_entry
  ...

Current code omits the percent if 'intel_idle' becomes the only node
when percent limit is set to 0.5%, its percent is not 9.95% but users
will assume it incorrectly.

Before:

  $ perf report --percent-limit 0.5 --stdio
  ...
     9.95%  swapper
            |
            ---intel_idle
               cpuidle_enter_state
               cpuidle_enter
               call_cpuidle
               cpu_startup_entry
               |
               |--4.89%--start_secondary
               |
                --2.68%--rest_init
                          start_kernel
                          x86_64_start_reservations
                          x86_64_start_kernel

After:

  $ perf report --percent-limit 0.5 --stdio
  ...
     9.95%  swapper
            |
             --7.57%--intel_idle
                       cpuidle_enter_state
                       cpuidle_enter
                       call_cpuidle
                       cpu_startup_entry
                       |
                       |--4.89%--start_secondary
                       |
                        --2.68%--rest_init
                                  start_kernel
                                  x86_64_start_reservations
                                  x86_64_start_kernel

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1453909257-26015-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/stdio/hist.c | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 96188ea..76ff46b 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -165,6 +165,25 @@ static size_t __callchain__fprintf_graph(FILE *fp, struct rb_root *root,
 	return ret;
 }
 
+/*
+ * If have one single callchain root, don't bother printing
+ * its percentage (100 % in fractal mode and the same percentage
+ * than the hist in graph mode). This also avoid one level of column.
+ *
+ * However when percent-limit applied, it's possible that single callchain
+ * node have different (non-100% in fractal mode) percentage.
+ */
+static bool need_percent_display(struct rb_node *node, u64 parent_samples)
+{
+	struct callchain_node *cnode;
+
+	if (rb_next(node))
+		return true;
+
+	cnode = rb_entry(node, struct callchain_node, rb_node);
+	return callchain_cumul_hits(cnode) != parent_samples;
+}
+
 static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
 				       u64 total_samples, u64 parent_samples,
 				       int left_margin)
@@ -178,13 +197,8 @@ static size_t callchain__fprintf_graph(FILE *fp, struct rb_root *root,
 	int ret = 0;
 	char bf[1024];
 
-	/*
-	 * If have one single callchain root, don't bother printing
-	 * its percentage (100 % in fractal mode and the same percentage
-	 * than the hist in graph mode). This also avoid one level of column.
-	 */
 	node = rb_first(root);
-	if (node && !rb_next(node)) {
+	if (node && !need_percent_display(node, parent_samples)) {
 		cnode = rb_entry(node, struct callchain_node, rb_node);
 		list_for_each_entry(chain, &cnode->val, list) {
 			/*

[toc] | [prev] | [next] | [standalone]


#1319088 — [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-27 16:50 +0100
Subject[RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%
Message-ID<qVAw4-5GW-55@gated-at.bofh.it>
In reply to#1319075
The current default limit of 0.5% is (mostly) for 'fractal' mode which
calculates the percentage relatively.  As we changed the default
callchain mode to 'graph', the existing limit is too high IMHO.
Normally there're many entries under 0.5% overhead, it'd be supprising
that they don't show callchains.

Cc: Taeung Song <treeze.taeung@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/Documentation/perf-report.txt | 2 +-
 tools/perf/builtin-report.c              | 2 +-
 tools/perf/builtin-top.c                 | 2 +-
 tools/perf/util/util.c                   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 8a301f6afb37..1591b45c79e5 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -209,7 +209,7 @@ OPTIONS
 	- none: disable call chain display.
 
 	threshold is a percentage value which specifies a minimum percent to be
-	included in the output call graph.  Default is 0.5 (%).
+	included in the output call graph.  Default is 0.005 (%).
 
 	print_limit is only applied when stdio interface is used.  It's to limit
 	number of call graph entries in a single hist entry.  Note that it needs
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 72ed0b46d5a1..ba6eba5f5d69 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -643,7 +643,7 @@ parse_percent_limit(const struct option *opt, const char *str,
 	return 0;
 }
 
-#define CALLCHAIN_DEFAULT_OPT  "graph,0.5,caller,function,percent"
+#define CALLCHAIN_DEFAULT_OPT  "graph,0.005,caller,function,percent"
 
 const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
 				     CALLCHAIN_REPORT_HELP
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index bf01cbb0ef23..1b471135ae2d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1086,7 +1086,7 @@ parse_percent_limit(const struct option *opt, const char *arg,
 }
 
 const char top_callchain_help[] = CALLCHAIN_RECORD_HELP CALLCHAIN_REPORT_HELP
-	"\n\t\t\t\tDefault: fp,graph,0.5,caller,function";
+	"\n\t\t\t\tDefault: fp,graph,0.005,caller,function";
 
 int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
 {
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 7a2da7ef556e..25ae6989c89d 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -20,7 +20,7 @@
 
 struct callchain_param	callchain_param = {
 	.mode	= CHAIN_GRAPH_ABS,
-	.min_percent = 0.5,
+	.min_percent = 0.005,
 	.order  = ORDER_CALLEE,
 	.key	= CCKEY_FUNCTION,
 	.value	= CCVAL_PERCENT,
-- 
2.6.4

[toc] | [prev] | [next] | [standalone]


#1319112 — Re: [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%

FromAndi Kleen <andi@firstfloor.org>
Date2016-01-27 17:10 +0100
SubjectRe: [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%
Message-ID<qVAPo-65V-29@gated-at.bofh.it>
In reply to#1319088
On Thu, Jan 28, 2016 at 12:40:57AM +0900, Namhyung Kim wrote:
> The current default limit of 0.5% is (mostly) for 'fractal' mode which
> calculates the percentage relatively.  As we changed the default
> callchain mode to 'graph', the existing limit is too high IMHO.
> Normally there're many entries under 0.5% overhead, it'd be supprising
> that they don't show callchains.

It's too small imho. On more complex workloads with a lot of user space
code we often end up with default perf report --stdio callgraph output of several
hundred KB, and most of it is useless as it is only very small.

-Andi

[toc] | [prev] | [next] | [standalone]


#1320141 — Re: [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-28 00:40 +0100
SubjectRe: [RFC/PATCH 10/10] perf tools: Change default calchain percent limit to 0.005%
Message-ID<qVHQR-2QG-1@gated-at.bofh.it>
In reply to#1319112
Hi Andi,

On Wed, 2016-01-27 at 17:06 +0100, Andi Kleen wrote:
> On Thu, Jan 28, 2016 at 12:40:57AM +0900, Namhyung Kim wrote:
> > The current default limit of 0.5% is (mostly) for 'fractal' mode
> > which
> > calculates the percentage relatively.  As we changed the default
> > callchain mode to 'graph', the existing limit is too high IMHO.
> > Normally there're many entries under 0.5% overhead, it'd be
> > supprising
> > that they don't show callchains.
> 
> It's too small imho. On more complex workloads with a lot of user
> space
> code we often end up with default perf report --stdio callgraph output
> of several
> hundred KB, and most of it is useless as it is only very small.

Do you think it's better to keep current default?  Or do you suggest
different value?

Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1320378 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromJiri Olsa <jolsa@redhat.com>
Date2016-01-28 09:20 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qVPY6-AA-7@gated-at.bofh.it>
In reply to#1319075
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%

heya,
do I get it right that:

'perf report' display all entries, but only callchains above default limit

'perf report --percent-limit X' display only entries above limit X plus
only callchains above limit X


thanks,
jirka

[toc] | [prev] | [next] | [standalone]


#1320430

FromNamhyung Kim <namhyung@gmail.com>
Date2016-01-28 09:50 +0100
Message-ID<qVQr8-MW-21@gated-at.bofh.it>
In reply to#1320378
On January 28, 2016 5:14:39 PM GMT+09:00, Jiri Olsa <jolsa@redhat.com> 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%
>
>heya,
>do I get it right that:
>
>'perf report' display all entries, but only callchains above default
>limit
>
>'perf report --percent-limit X' display only entries above limit X plus
>only callchains above limit X
>
>
>thanks,
>jirka

Yes, actually there're two limits and they have different defaults. The --percent-limit sets both limits while -g only sets callchain limit.

Thanks
Namhyung
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

[toc] | [prev] | [next] | [standalone]


#1320381 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromJiri Olsa <jolsa@redhat.com>
Date2016-01-28 09:20 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qVPY7-AA-17@gated-at.bofh.it>
In reply to#1319075
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                     

[toc] | [prev] | [next] | [standalone]


#1320506

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-28 11:20 +0100
Message-ID<qVRQd-1UP-3@gated-at.bofh.it>
In reply to#1320381
On Thu, Jan 28, 2016 at 5:16 PM, Jiri Olsa <jolsa@redhat.com> 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.

Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1320513

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-28 11:20 +0100
Message-ID<qVRQe-1UP-19@gated-at.bofh.it>
In reply to#1320506
On Thu, Jan 28, 2016 at 7:14 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> On Thu, Jan 28, 2016 at 5:16 PM, Jiri Olsa <jolsa@redhat.com> 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?

Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1320617 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromJiri Olsa <jolsa@redhat.com>
Date2016-01-28 13:20 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qVTIm-3eg-9@gated-at.bofh.it>
In reply to#1320513
On Thu, Jan 28, 2016 at 07:16:43PM +0900, Namhyung Kim wrote:
> On Thu, Jan 28, 2016 at 7:14 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> > On Thu, Jan 28, 2016 at 5:16 PM, Jiri Olsa <jolsa@redhat.com> 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...  ;-)

thanks,
jirka

[toc] | [prev] | [next] | [standalone]


#1320621 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-28 13:30 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qVTS2-3iP-25@gated-at.bofh.it>
In reply to#1320617
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 <namhyung@kernel.org> wrote:
> > > On Thu, Jan 28, 2016 at 5:16 PM, Jiri Olsa <jolsa@redhat.com> 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 <namhyung@kernel.org>
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 <jolsa@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 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

[toc] | [prev] | [next] | [standalone]


#1320998 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromJiri Olsa <jolsa@redhat.com>
Date2016-01-28 21:00 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qW0Tx-8hX-21@gated-at.bofh.it>
In reply to#1320621
On Thu, Jan 28, 2016 at 09:24:54PM +0900, Namhyung Kim wrote:

SNIP

> > > > 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

yep, tested.. works ;-)

thanks,
jirka

[toc] | [prev] | [next] | [standalone]


#1322071 — Re: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-01-29 22:10 +0100
SubjectRe: [PATCHSET 00/10] perf tools: Apply percent-limit to callchains (v2)
Message-ID<qWosP-BF-17@gated-at.bofh.it>
In reply to#1320998
Em Thu, Jan 28, 2016 at 08:52:25PM +0100, Jiri Olsa escreveu:
> On Thu, Jan 28, 2016 at 09:24:54PM +0900, Namhyung Kim wrote:
> 
> SNIP
> 
> > > > > 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
> 
> yep, tested.. works ;-)

Namhyung, can I try to process this patchkit just by reading these
commends and making the adjustments? Or is there something outstanding
that warrants you to push a v2?

- Arnaldo

[toc] | [prev] | [next] | [standalone]


#1322365

FromNamhyung Kim <namhyung@kernel.org>
Date2016-01-30 15:00 +0100
Message-ID<qWEef-3Qn-9@gated-at.bofh.it>
In reply to#1322071
Hi Arnaldo,

On Sat, Jan 30, 2016 at 6:00 AM, Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
> Em Thu, Jan 28, 2016 at 08:52:25PM +0100, Jiri Olsa escreveu:
>> On Thu, Jan 28, 2016 at 09:24:54PM +0900, Namhyung Kim wrote:
>>
>> SNIP
>>
>> > > > > 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
>>
>> yep, tested.. works ;-)
>
> Namhyung, can I try to process this patchkit just by reading these
> commends and making the adjustments? Or is there something outstanding
> that warrants you to push a v2?

It'd great for me if you process this (v1).  I cannot work on the v2
for a couple of days..

Thanks,
Namhyung

[toc] | [prev] | [next] | [standalone]


#1325157 — [tip:perf/core] perf report: Don' t show blank lines if entry has no callchain

Fromtip-bot for Namhyung Kim <tipbot@zytor.com>
Date2016-02-03 11:30 +0100
Subject[tip:perf/core] perf report: Don' t show blank lines if entry has no callchain
Message-ID<qY2Rd-H6-15@gated-at.bofh.it>
In reply to#1320621
Commit-ID:  3848c23b19e07188bfa15e3d9a2ac27692f2ff3c
Gitweb:     http://git.kernel.org/tip/3848c23b19e07188bfa15e3d9a2ac27692f2ff3c
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 28 Jan 2016 21:24:54 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 1 Feb 2016 17:51:09 -0300

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-and-Tested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20160128122454.GA27446@danjae.kornet
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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 76ff46b..691e52c 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;
 }

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web