diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-report.c | 16 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 2 |
2 files changed, 5 insertions, 13 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 072ae8ad67fc..2f91094e228b 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -86,17 +86,6 @@ static int report__config(const char *var, const char *value, void *cb) | |||
86 | return perf_default_config(var, value, cb); | 86 | return perf_default_config(var, value, cb); |
87 | } | 87 | } |
88 | 88 | ||
89 | static void report__inc_stats(struct report *rep, struct hist_entry *he) | ||
90 | { | ||
91 | /* | ||
92 | * The @he is either of a newly created one or an existing one | ||
93 | * merging current sample. We only want to count a new one so | ||
94 | * checking ->nr_events being 1. | ||
95 | */ | ||
96 | if (he->stat.nr_events == 1) | ||
97 | rep->nr_entries++; | ||
98 | } | ||
99 | |||
100 | static int hist_iter__report_callback(struct hist_entry_iter *iter, | 89 | static int hist_iter__report_callback(struct hist_entry_iter *iter, |
101 | struct addr_location *al, bool single, | 90 | struct addr_location *al, bool single, |
102 | void *arg) | 91 | void *arg) |
@@ -108,8 +97,6 @@ static int hist_iter__report_callback(struct hist_entry_iter *iter, | |||
108 | struct mem_info *mi; | 97 | struct mem_info *mi; |
109 | struct branch_info *bi; | 98 | struct branch_info *bi; |
110 | 99 | ||
111 | report__inc_stats(rep, he); | ||
112 | |||
113 | if (!ui__has_annotation()) | 100 | if (!ui__has_annotation()) |
114 | return 0; | 101 | return 0; |
115 | 102 | ||
@@ -499,6 +486,9 @@ static int __cmd_report(struct report *rep) | |||
499 | 486 | ||
500 | report__warn_kptr_restrict(rep); | 487 | report__warn_kptr_restrict(rep); |
501 | 488 | ||
489 | evlist__for_each(session->evlist, pos) | ||
490 | rep->nr_entries += evsel__hists(pos)->nr_entries; | ||
491 | |||
502 | if (use_browser == 0) { | 492 | if (use_browser == 0) { |
503 | if (verbose > 3) | 493 | if (verbose > 3) |
504 | perf_session__fprintf(session, stdout); | 494 | perf_session__fprintf(session, stdout); |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 038483a24a54..e17163fcb702 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -429,6 +429,8 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
429 | if (!he) | 429 | if (!he) |
430 | return NULL; | 430 | return NULL; |
431 | 431 | ||
432 | hists->nr_entries++; | ||
433 | |||
432 | rb_link_node(&he->rb_node_in, parent, p); | 434 | rb_link_node(&he->rb_node_in, parent, p); |
433 | rb_insert_color(&he->rb_node_in, hists->entries_in); | 435 | rb_insert_color(&he->rb_node_in, hists->entries_in); |
434 | out: | 436 | out: |