diff options
| -rw-r--r-- | tools/perf/util/hist.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 68d288c975de..7b5848ce1505 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -795,6 +795,21 @@ enum hist_filter { | |||
| 795 | HIST_FILTER__THREAD, | 795 | HIST_FILTER__THREAD, |
| 796 | }; | 796 | }; |
| 797 | 797 | ||
| 798 | static void hists__remove_entry_filter(struct hists *self, struct hist_entry *h, | ||
| 799 | enum hist_filter filter) | ||
| 800 | { | ||
| 801 | h->filtered &= ~(1 << filter); | ||
| 802 | if (h->filtered) | ||
| 803 | return; | ||
| 804 | |||
| 805 | ++self->nr_entries; | ||
| 806 | self->stats.total_period += h->period; | ||
| 807 | self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events; | ||
| 808 | |||
| 809 | if (h->ms.sym && self->max_sym_namelen < h->ms.sym->namelen) | ||
| 810 | self->max_sym_namelen = h->ms.sym->namelen; | ||
| 811 | } | ||
| 812 | |||
| 798 | void hists__filter_by_dso(struct hists *self, const struct dso *dso) | 813 | void hists__filter_by_dso(struct hists *self, const struct dso *dso) |
| 799 | { | 814 | { |
| 800 | struct rb_node *nd; | 815 | struct rb_node *nd; |
| @@ -814,15 +829,7 @@ void hists__filter_by_dso(struct hists *self, const struct dso *dso) | |||
| 814 | continue; | 829 | continue; |
| 815 | } | 830 | } |
| 816 | 831 | ||
| 817 | h->filtered &= ~(1 << HIST_FILTER__DSO); | 832 | hists__remove_entry_filter(self, h, HIST_FILTER__DSO); |
| 818 | if (!h->filtered) { | ||
| 819 | ++self->nr_entries; | ||
| 820 | self->stats.total_period += h->period; | ||
| 821 | self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events; | ||
| 822 | if (h->ms.sym && | ||
| 823 | self->max_sym_namelen < h->ms.sym->namelen) | ||
| 824 | self->max_sym_namelen = h->ms.sym->namelen; | ||
| 825 | } | ||
| 826 | } | 833 | } |
| 827 | } | 834 | } |
| 828 | 835 | ||
| @@ -841,15 +848,8 @@ void hists__filter_by_thread(struct hists *self, const struct thread *thread) | |||
| 841 | h->filtered |= (1 << HIST_FILTER__THREAD); | 848 | h->filtered |= (1 << HIST_FILTER__THREAD); |
| 842 | continue; | 849 | continue; |
| 843 | } | 850 | } |
| 844 | h->filtered &= ~(1 << HIST_FILTER__THREAD); | 851 | |
| 845 | if (!h->filtered) { | 852 | hists__remove_entry_filter(self, h, HIST_FILTER__THREAD); |
| 846 | ++self->nr_entries; | ||
| 847 | self->stats.total_period += h->period; | ||
| 848 | self->stats.nr_events[PERF_RECORD_SAMPLE] += h->nr_events; | ||
| 849 | if (h->ms.sym && | ||
| 850 | self->max_sym_namelen < h->ms.sym->namelen) | ||
| 851 | self->max_sym_namelen = h->ms.sym->namelen; | ||
| 852 | } | ||
| 853 | } | 853 | } |
| 854 | } | 854 | } |
| 855 | 855 | ||
