aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/hist.c')
-rw-r--r--tools/perf/util/hist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index f0794913d575..18cf8b321608 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -50,7 +50,8 @@ struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists,
50 p = &(*p)->rb_right; 50 p = &(*p)->rb_right;
51 } 51 }
52 52
53 he = malloc(sizeof(*he)); 53 he = malloc(sizeof(*he) + (symbol_conf.use_callchain ?
54 sizeof(struct callchain_node) : 0));
54 if (!he) 55 if (!he)
55 return NULL; 56 return NULL;
56 *he = entry; 57 *he = entry;
@@ -168,7 +169,7 @@ static void perf_session__insert_output_hist_entry(struct rb_root *root,
168 struct hist_entry *iter; 169 struct hist_entry *iter;
169 170
170 if (symbol_conf.use_callchain) 171 if (symbol_conf.use_callchain)
171 callchain_param.sort(&he->sorted_chain, &he->callchain, 172 callchain_param.sort(&he->sorted_chain, he->callchain,
172 min_callchain_hits, &callchain_param); 173 min_callchain_hits, &callchain_param);
173 174
174 while (*p != NULL) { 175 while (*p != NULL) {