From dbe11c711bf636ee8e70bdae822ed42f7cc2150c Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 2 Apr 2010 09:50:42 -0300 Subject: [PATCH] --- yaml --- r: 191169 b: refs/heads/master c: b9fb93047756c5e4129dfda7591612de61b0e877 h: refs/heads/master i: 191167: 14eb9abe70b32690c7dcc3438fa6eb87b4b3b60a v: v3 --- [refs] | 2 +- trunk/tools/perf/builtin-report.c | 4 ++-- trunk/tools/perf/util/hist.c | 5 +++-- trunk/tools/perf/util/sort.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 6969e8673afd..a9a8274e2650 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 71cf8b8ff7d6a79af086be9e4c72628da9d62d58 +refs/heads/master: b9fb93047756c5e4129dfda7591612de61b0e877 diff --git a/trunk/tools/perf/builtin-report.c b/trunk/tools/perf/builtin-report.c index 381918515a5c..1fb13e5fd1f9 100644 --- a/trunk/tools/perf/builtin-report.c +++ b/trunk/tools/perf/builtin-report.c @@ -110,8 +110,8 @@ static int perf_session__add_hist_entry(struct perf_session *self, if (symbol_conf.use_callchain) { if (!hit) - callchain_init(&he->callchain); - err = append_chain(&he->callchain, data->callchain, syms); + callchain_init(he->callchain); + err = append_chain(he->callchain, data->callchain, syms); free(syms); if (err) diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index f0794913d575..18cf8b321608 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -50,7 +50,8 @@ struct hist_entry *__perf_session__add_hist_entry(struct rb_root *hists, p = &(*p)->rb_right; } - he = malloc(sizeof(*he)); + he = malloc(sizeof(*he) + (symbol_conf.use_callchain ? + sizeof(struct callchain_node) : 0)); if (!he) return NULL; *he = entry; @@ -168,7 +169,7 @@ static void perf_session__insert_output_hist_entry(struct rb_root *root, struct hist_entry *iter; if (symbol_conf.use_callchain) - callchain_param.sort(&he->sorted_chain, &he->callchain, + callchain_param.sort(&he->sorted_chain, he->callchain, min_callchain_hits, &callchain_param); while (*p != NULL) { diff --git a/trunk/tools/perf/util/sort.h b/trunk/tools/perf/util/sort.h index 439ec5fa0f5f..5bf2b744e7b2 100644 --- a/trunk/tools/perf/util/sort.h +++ b/trunk/tools/perf/util/sort.h @@ -49,12 +49,12 @@ struct hist_entry { u64 ip; char level; struct symbol *parent; - struct callchain_node callchain; union { unsigned long position; struct hist_entry *pair; struct rb_root sorted_chain; }; + struct callchain_node callchain[0]; }; enum sort_type {