diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-12-21 23:44:14 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-12-23 10:06:39 -0500 |
commit | 82aa019e0098a1e0801df94345c0297448323126 (patch) | |
tree | 4ccd3e65a7384348dd0345d924644d870c571fc3 /tools/perf/util | |
parent | b11bc8e28f4829f693ef6c0178fe1811386ac828 (diff) |
perf callchain: Append callchains only when requested
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>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/hist.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 1cc6ea4b7065..0ced178ce306 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -304,7 +304,7 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template, | |||
304 | size_t callchain_size = 0; | 304 | size_t callchain_size = 0; |
305 | struct hist_entry *he; | 305 | struct hist_entry *he; |
306 | 306 | ||
307 | if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) | 307 | if (symbol_conf.use_callchain) |
308 | callchain_size = sizeof(struct callchain_root); | 308 | callchain_size = sizeof(struct callchain_root); |
309 | 309 | ||
310 | he = zalloc(sizeof(*he) + callchain_size); | 310 | he = zalloc(sizeof(*he) + callchain_size); |
@@ -737,7 +737,7 @@ iter_add_single_cumulative_entry(struct hist_entry_iter *iter, | |||
737 | iter->he = he; | 737 | iter->he = he; |
738 | he_cache[iter->curr++] = he; | 738 | he_cache[iter->curr++] = he; |
739 | 739 | ||
740 | callchain_append(he->callchain, &callchain_cursor, sample->period); | 740 | hist_entry__append_callchain(he, sample); |
741 | 741 | ||
742 | /* | 742 | /* |
743 | * We need to re-initialize the cursor since callchain_append() | 743 | * We need to re-initialize the cursor since callchain_append() |
@@ -810,7 +810,8 @@ iter_add_next_cumulative_entry(struct hist_entry_iter *iter, | |||
810 | iter->he = he; | 810 | iter->he = he; |
811 | he_cache[iter->curr++] = he; | 811 | he_cache[iter->curr++] = he; |
812 | 812 | ||
813 | callchain_append(he->callchain, &cursor, sample->period); | 813 | if (symbol_conf.use_callchain) |
814 | callchain_append(he->callchain, &cursor, sample->period); | ||
814 | return 0; | 815 | return 0; |
815 | } | 816 | } |
816 | 817 | ||