diff options
| -rw-r--r-- | tools/perf/util/hist.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 07f89b66b318..699cf81ea082 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -631,9 +631,14 @@ int hist_entry__fprintf(struct hist_entry *self, struct hists *pair_hists, | |||
| 631 | u64 session_total) | 631 | u64 session_total) |
| 632 | { | 632 | { |
| 633 | char bf[512]; | 633 | char bf[512]; |
| 634 | hist_entry__snprintf(self, bf, sizeof(bf), pair_hists, | 634 | int ret; |
| 635 | show_displacement, displacement, | 635 | |
| 636 | true, session_total); | 636 | ret = hist_entry__snprintf(self, bf, sizeof(bf), pair_hists, |
| 637 | show_displacement, displacement, | ||
| 638 | true, session_total); | ||
| 639 | if (!ret) | ||
| 640 | return 0; | ||
| 641 | |||
| 637 | return fprintf(fp, "%s\n", bf); | 642 | return fprintf(fp, "%s\n", bf); |
| 638 | } | 643 | } |
| 639 | 644 | ||
| @@ -762,6 +767,7 @@ size_t hists__fprintf(struct hists *self, struct hists *pair, | |||
| 762 | print_entries: | 767 | print_entries: |
| 763 | for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) { | 768 | for (nd = rb_first(&self->entries); nd; nd = rb_next(nd)) { |
| 764 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); | 769 | struct hist_entry *h = rb_entry(nd, struct hist_entry, rb_node); |
| 770 | int cnt; | ||
| 765 | 771 | ||
| 766 | if (show_displacement) { | 772 | if (show_displacement) { |
| 767 | if (h->pair != NULL) | 773 | if (h->pair != NULL) |
| @@ -771,8 +777,13 @@ print_entries: | |||
| 771 | displacement = 0; | 777 | displacement = 0; |
| 772 | ++position; | 778 | ++position; |
| 773 | } | 779 | } |
| 774 | ret += hist_entry__fprintf(h, pair, show_displacement, | 780 | cnt = hist_entry__fprintf(h, pair, show_displacement, |
| 775 | displacement, fp, self->stats.total_period); | 781 | displacement, fp, self->stats.total_period); |
| 782 | /* Ignore those that didn't match the parent filter */ | ||
| 783 | if (!cnt) | ||
| 784 | continue; | ||
| 785 | |||
| 786 | ret += cnt; | ||
| 776 | 787 | ||
| 777 | if (symbol_conf.use_callchain) | 788 | if (symbol_conf.use_callchain) |
| 778 | ret += hist_entry__fprintf_callchain(h, fp, self->stats.total_period); | 789 | ret += hist_entry__fprintf_callchain(h, fp, self->stats.total_period); |
