mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@kernel.org>, Paul Mackerras <paulus@samba.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Namhyung Kim <namhyung@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Andi Kleen <andi@firstfloor.org>, Arun Sharma <asharma@fb.com>,
	Rodrigo Campos <rodrigo@sdfg.com.ar>
Subject: [PATCH 22/26] perf ui/stdio: Fix invalid percentage value of cumulated hist entries
Date: Fri, 23 May 2014 19:04:19 +0900	[thread overview]
Message-ID: <1400839463-21933-23-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1400839463-21933-1-git-send-email-namhyung@kernel.org>

On stdio, there's a problem that it shows invalid values for
callchains in cumulated hist entries.  It's because it only cares
about the self period.  But with --children behavior, we always add
callchain info to the cumulated entries so it should use the value in
that case.

Before:

  # Children      Self  Command      Shared Object            Symbol
  # ........  ........  .......  .................  ................
  #
      61.22%     0.32%  swapper  [kernel.kallsyms]      [k] cpu_idle
                    |
                    --- cpu_idle
                       |
                       |--16530.76%-- start_secondary
                       |
                       |--2758.70%-- rest_init
                       |          start_kernel
                       |          x86_64_start_reservations
                       |          x86_64_start_kernel
                        --6837850969203030.00%-- [...]

After:

  # Children      Self  Command      Shared Object            Symbol
  # ........  ........  .......  .................  ................
  #
      61.22%     0.32%  swapper  [kernel.kallsyms]      [k] cpu_idle
                    |
                    --- cpu_idle
                       |
                       |--85.70%-- start_secondary
                       |
                        --14.30%-- rest_init
                                  start_kernel
                                  x86_64_start_reservations
                                  x86_64_start_kernel

Cc: Arun Sharma <asharma@fb.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/stdio/hist.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 475d2f5c7e16..90122abd3721 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -271,7 +271,9 @@ static size_t hist_entry_callchain__fprintf(struct hist_entry *he,
 {
 	switch (callchain_param.mode) {
 	case CHAIN_GRAPH_REL:
-		return callchain__fprintf_graph(fp, &he->sorted_chain, he->stat.period,
+		return callchain__fprintf_graph(fp, &he->sorted_chain,
+						symbol_conf.cumulate_callchain ?
+						he->stat_acc->period : he->stat.period,
 						left_margin);
 		break;
 	case CHAIN_GRAPH_ABS:
-- 
1.9.2


  parent reply	other threads:[~2014-05-23 10:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 10:03 [PATCHSET 00/26] perf tools: Add support to accumulate hist periods (v10) Namhyung Kim
2014-05-23 10:03 ` [PATCH 01/26] perf tools: Introduce struct hist_entry_iter Namhyung Kim
2014-05-26 18:27   ` Jiri Olsa
2014-05-26 18:44   ` Jiri Olsa
2014-05-28 23:46     ` Namhyung Kim
2014-05-23 10:03 ` [PATCH 02/26] perf hists: Add support for accumulated stat of hist entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 03/26] perf hists: Check if accumulated when adding a " Namhyung Kim
2014-05-23 10:04 ` [PATCH 04/26] perf hists: Accumulate hist entry stat based on the callchain Namhyung Kim
2014-05-23 10:04 ` [PATCH 05/26] perf tools: Update cpumode for each cumulative entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 06/26] perf report: Cache cumulative callchains Namhyung Kim
2014-05-23 10:04 ` [PATCH 07/26] perf callchain: Add callchain_cursor_snapshot() Namhyung Kim
2014-05-23 10:04 ` [PATCH 08/26] perf tools: Save callchain info for each cumulative entry Namhyung Kim
2014-05-23 10:04 ` [PATCH 09/26] perf ui/hist: Add support to accumulated hist stat Namhyung Kim
2014-05-23 10:04 ` [PATCH 10/26] perf ui/browser: " Namhyung Kim
2014-05-26 17:52   ` Jiri Olsa
2014-05-28 23:52     ` Namhyung Kim
2014-05-23 10:04 ` [PATCH 11/26] perf ui/gtk: " Namhyung Kim
2014-05-23 10:04 ` [PATCH 12/26] perf tools: Apply percent-limit to cumulative percentage Namhyung Kim
2014-05-26 17:57   ` Jiri Olsa
2014-05-23 10:04 ` [PATCH 13/26] perf tools: Add more hpp helper functions Namhyung Kim
2014-05-23 10:04 ` [PATCH 14/26] perf report: Add --children option Namhyung Kim
2014-05-23 10:04 ` [PATCH 15/26] perf report: Add report.children config option Namhyung Kim
2014-05-23 10:04 ` [PATCH 16/26] perf tools: Do not auto-remove Children column if --fields given Namhyung Kim
2014-05-23 10:04 ` [PATCH 17/26] perf tools: Add callback function to hist_entry_iter Namhyung Kim
2014-05-23 10:04 ` [PATCH 18/26] perf top: Convert " Namhyung Kim
2014-05-23 10:04 ` [PATCH 19/26] perf top: Add --children option Namhyung Kim
2014-05-23 10:04 ` [PATCH 20/26] perf top: Add top.children config option Namhyung Kim
2014-05-23 10:04 ` [PATCH 21/26] perf tools: Enable --children option by default Namhyung Kim
2014-05-23 10:04 ` Namhyung Kim [this message]
2014-05-23 10:04 ` [PATCH 23/26] perf ui/gtk: Fix callchain display Namhyung Kim
2014-05-23 10:04 ` [PATCH 24/26] perf tools: Reset output/sort order to default Namhyung Kim
2014-05-23 10:04 ` [PATCH 25/26] perf tests: Define and use symbolic names for fake symbols Namhyung Kim
2014-05-23 10:04 ` [PATCH 26/26] perf tests: Add a test case for cumulating callchains Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400839463-21933-23-git-send-email-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=andi@firstfloor.org \
    --cc=asharma@fb.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=rodrigo@sdfg.com.ar \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome