From 954bf9d2f681c1ac0eccf22a1431abd54e211f79 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 12 Mar 2010 12:46:48 -0300 Subject: [PATCH] --- yaml --- r: 191083 b: refs/heads/master c: 3997d3776a6e89586e76a0ef355bfbbd8a76966c h: refs/heads/master i: 191081: e051dd3dadc689e8cf12f813b7e80638dca16f3c 191079: 188a8ebf7486bbd5676c5c10adb3f0abd2708c75 v: v3 --- [refs] | 2 +- trunk/tools/perf/util/hist.c | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/[refs] b/[refs] index c3b339370ddf..180182cbc2be 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cb7afb7092bc502b890f0a897ffd67c2b078d347 +refs/heads/master: 3997d3776a6e89586e76a0ef355bfbbd8a76966c diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index d43be344a889..1a4e8376d843 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -532,23 +532,23 @@ size_t hist_entry__fprintf(struct hist_entry *self, ret += se->print(fp, self, se->width ? *se->width : 0); } - ret += fprintf(fp, "\n"); - - if (symbol_conf.use_callchain) { - int left_margin = 0; + return ret + fprintf(fp, "\n"); +} - if (sort__first_dimension == SORT_COMM) { - se = list_first_entry(&hist_entry__sort_list, typeof(*se), - list); - left_margin = se->width ? *se->width : 0; - left_margin -= thread__comm_len(self->thread); - } +static size_t hist_entry__fprintf_callchain(struct hist_entry *self, FILE *fp, + u64 session_total) +{ + int left_margin = 0; - ret += hist_entry_callchain__fprintf(fp, self, session_total, - left_margin); + if (sort__first_dimension == SORT_COMM) { + struct sort_entry *se = list_first_entry(&hist_entry__sort_list, + typeof(*se), list); + left_margin = se->width ? *se->width : 0; + left_margin -= thread__comm_len(self->thread); } - return ret; + return hist_entry_callchain__fprintf(fp, self, session_total, + left_margin); } size_t perf_session__fprintf_hists(struct rb_root *hists, @@ -655,6 +655,10 @@ size_t perf_session__fprintf_hists(struct rb_root *hists, } ret += hist_entry__fprintf(h, pair, show_displacement, displacement, fp, session_total); + + if (symbol_conf.use_callchain) + ret += hist_entry__fprintf_callchain(h, fp, session_total); + if (h->map == NULL && verbose > 1) { __map_groups__fprintf_maps(&h->thread->mg, MAP__FUNCTION, fp);