From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Stephane Eranian <eranian@google.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 09/10] perf callchain: Append callchains only when requested
Date: Mon, 22 Dec 2014 12:30:08 -0300 [thread overview]
Message-ID: <1419262209-9464-10-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1419262209-9464-1-git-send-email-acme@kernel.org>
From: Namhyung Kim <namhyung@kernel.org>
The perf report --children can be called with callchain disabled so no
need to append callchains. Actually the root of callchain tree is not
initialized properly in this case.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1419223455-4362-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/hist.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index bd4a2cd73236..30ff2cb92884 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -300,7 +300,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template,
size_t callchain_size = 0;
struct hist_entry *he;
- if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain)
+ if (symbol_conf.use_callchain)
callchain_size = sizeof(struct callchain_root);
he = zalloc(sizeof(*he) + callchain_size);
@@ -735,7 +735,7 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter,
iter->he = he;
he_cache[iter->curr++] = he;
- callchain_append(he->callchain, &callchain_cursor, sample->period);
+ hist_entry__append_callchain(he, sample);
/*
* We need to re-initialize the cursor since callchain_append()
@@ -808,7 +808,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter,
iter->he = he;
he_cache[iter->curr++] = he;
- callchain_append(he->callchain, &cursor, sample->period);
+ if (symbol_conf.use_callchain)
+ callchain_append(he->callchain, &cursor, sample->period);
return 0;
}
--
1.9.3
next prev parent reply other threads:[~2014-12-22 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-22 15:29 [GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 01/10] perf mem: Enable sampling loads and stores simultaneously Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 02/10] perf mem: Move the mem_operations global to struct perf_mem Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 03/10] perf tools: Remove EOL whitespaces Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 04/10] perf hists: Rename hist_entry__free to __delete Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 05/10] perf hists: Introduce function for deleting/removing hist_entry Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 06/10] perf report: Get rid of report__inc_stat() Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 07/10] perf report: Show progress bar for output resorting Arnaldo Carvalho de Melo
2014-12-22 15:30 ` [PATCH 08/10] perf ui/tui: Print backtrace symbols when segfault occurs Arnaldo Carvalho de Melo
2014-12-22 15:30 ` Arnaldo Carvalho de Melo [this message]
2014-12-22 15:30 ` [PATCH 10/10] perf tools: Remove some unused functions from color.c Arnaldo Carvalho de Melo
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=1419262209-9464-10-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).