diff options
| -rw-r--r-- | tools/perf/util/hist.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index d43be344a889..1a4e8376d843 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -532,23 +532,23 @@ size_t hist_entry__fprintf(struct hist_entry *self, | |||
| 532 | ret += se->print(fp, self, se->width ? *se->width : 0); | 532 | ret += se->print(fp, self, se->width ? *se->width : 0); |
| 533 | } | 533 | } |
| 534 | 534 | ||
| 535 | ret += fprintf(fp, "\n"); | 535 | return ret + fprintf(fp, "\n"); |
| 536 | 536 | } | |
| 537 | if (symbol_conf.use_callchain) { | ||
| 538 | int left_margin = 0; | ||
| 539 | 537 | ||
| 540 | if (sort__first_dimension == SORT_COMM) { | 538 | static size_t hist_entry__fprintf_callchain(struct hist_entry *self, FILE *fp, |
| 541 | se = list_first_entry(&hist_entry__sort_list, typeof(*se), | 539 | u64 session_total) |
| 542 | list); | 540 | { |
| 543 | left_margin = se->width ? *se->width : 0; | 541 | int left_margin = 0; |
| 544 | left_margin -= thread__comm_len(self->thread); | ||
| 545 | } | ||
| 546 | 542 | ||
| 547 | ret += hist_entry_callchain__fprintf(fp, self, session_total, | 543 | if (sort__first_dimension == SORT_COMM) { |
| 548 | left_margin); | 544 | struct sort_entry *se = list_first_entry(&hist_entry__sort_list, |
| 545 | typeof(*se), list); | ||
| 546 | left_margin = se->width ? *se->width : 0; | ||
| 547 | left_margin -= thread__comm_len(self->thread); | ||
| 549 | } | 548 | } |
| 550 | 549 | ||
| 551 | return ret; | 550 | return hist_entry_callchain__fprintf(fp, self, session_total, |
| 551 | left_margin); | ||
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | size_t perf_session__fprintf_hists(struct rb_root *hists, | 554 | size_t perf_session__fprintf_hists(struct rb_root *hists, |
| @@ -655,6 +655,10 @@ print_entries: | |||
| 655 | } | 655 | } |
| 656 | ret += hist_entry__fprintf(h, pair, show_displacement, | 656 | ret += hist_entry__fprintf(h, pair, show_displacement, |
| 657 | displacement, fp, session_total); | 657 | displacement, fp, session_total); |
| 658 | |||
| 659 | if (symbol_conf.use_callchain) | ||
| 660 | ret += hist_entry__fprintf_callchain(h, fp, session_total); | ||
| 661 | |||
| 658 | if (h->map == NULL && verbose > 1) { | 662 | if (h->map == NULL && verbose > 1) { |
| 659 | __map_groups__fprintf_maps(&h->thread->mg, | 663 | __map_groups__fprintf_maps(&h->thread->mg, |
| 660 | MAP__FUNCTION, fp); | 664 | MAP__FUNCTION, fp); |
