diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-annotate.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-sched.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 5 | ||||
-rw-r--r-- | tools/perf/tests/hists_filter.c | 4 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 7 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 |
7 files changed, 13 insertions, 12 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index d30d2c2e2a7a..bf52461a88bd 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -70,7 +70,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, | |||
70 | return -ENOMEM; | 70 | return -ENOMEM; |
71 | 71 | ||
72 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | 72 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); |
73 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 73 | hists__inc_nr_samples(&evsel->hists, true); |
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index bc0eec1ce4be..4a3b84dd4f41 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -92,9 +92,7 @@ static void report__inc_stats(struct report *rep, struct hist_entry *he) | |||
92 | * counted in perf_session_deliver_event(). The dump_trace | 92 | * counted in perf_session_deliver_event(). The dump_trace |
93 | * requires this info is ready before going to the output tree. | 93 | * requires this info is ready before going to the output tree. |
94 | */ | 94 | */ |
95 | hists__inc_nr_events(he->hists, PERF_RECORD_SAMPLE); | 95 | hists__inc_nr_samples(he->hists, he->filtered); |
96 | if (!he->filtered) | ||
97 | he->hists->stats.nr_non_filtered_samples++; | ||
98 | } | 96 | } |
99 | 97 | ||
100 | static int report__add_mem_hist_entry(struct report *rep, struct addr_location *al, | 98 | static int report__add_mem_hist_entry(struct report *rep, struct addr_location *al, |
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index d7176830b9b2..c38d06c04775 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1428,7 +1428,7 @@ static int perf_sched__process_tracepoint_sample(struct perf_tool *tool __maybe_ | |||
1428 | int err = 0; | 1428 | int err = 0; |
1429 | 1429 | ||
1430 | evsel->hists.stats.total_period += sample->period; | 1430 | evsel->hists.stats.total_period += sample->period; |
1431 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 1431 | hists__inc_nr_samples(&evsel->hists, true); |
1432 | 1432 | ||
1433 | if (evsel->handler != NULL) { | 1433 | if (evsel->handler != NULL) { |
1434 | tracepoint_handler f = evsel->handler; | 1434 | tracepoint_handler f = evsel->handler; |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5b389ce4cd15..51309264d210 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -252,10 +252,7 @@ static struct hist_entry *perf_evsel__add_hist_entry(struct perf_evsel *evsel, | |||
252 | if (he == NULL) | 252 | if (he == NULL) |
253 | return NULL; | 253 | return NULL; |
254 | 254 | ||
255 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 255 | hists__inc_nr_samples(&evsel->hists, he->filtered); |
256 | if (!he->filtered) | ||
257 | evsel->hists.stats.nr_non_filtered_samples++; | ||
258 | |||
259 | return he; | 256 | return he; |
260 | } | 257 | } |
261 | 258 | ||
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c index c5ba924a3581..0a71ef4b9158 100644 --- a/tools/perf/tests/hists_filter.c +++ b/tools/perf/tests/hists_filter.c | |||
@@ -85,9 +85,7 @@ static int add_hist_entries(struct perf_evlist *evlist, struct machine *machine) | |||
85 | fake_samples[i].map = al.map; | 85 | fake_samples[i].map = al.map; |
86 | fake_samples[i].sym = al.sym; | 86 | fake_samples[i].sym = al.sym; |
87 | 87 | ||
88 | hists__inc_nr_events(he->hists, PERF_RECORD_SAMPLE); | 88 | hists__inc_nr_samples(he->hists, he->filtered); |
89 | if (!he->filtered) | ||
90 | he->hists->stats.nr_non_filtered_samples++; | ||
91 | } | 89 | } |
92 | } | 90 | } |
93 | 91 | ||
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index b262b44b7a65..5943ba60f193 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -800,6 +800,13 @@ void hists__inc_nr_events(struct hists *hists, u32 type) | |||
800 | events_stats__inc(&hists->stats, type); | 800 | events_stats__inc(&hists->stats, type); |
801 | } | 801 | } |
802 | 802 | ||
803 | void hists__inc_nr_samples(struct hists *hists, bool filtered) | ||
804 | { | ||
805 | events_stats__inc(&hists->stats, PERF_RECORD_SAMPLE); | ||
806 | if (!filtered) | ||
807 | hists->stats.nr_non_filtered_samples++; | ||
808 | } | ||
809 | |||
803 | static struct hist_entry *hists__add_dummy_entry(struct hists *hists, | 810 | static struct hist_entry *hists__add_dummy_entry(struct hists *hists, |
804 | struct hist_entry *pair) | 811 | struct hist_entry *pair) |
805 | { | 812 | { |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index a8418d19808d..03ae1dbb1b15 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -119,6 +119,7 @@ u64 hists__total_period(struct hists *hists); | |||
119 | void hists__reset_stats(struct hists *hists); | 119 | void hists__reset_stats(struct hists *hists); |
120 | void hists__inc_stats(struct hists *hists, struct hist_entry *h); | 120 | void hists__inc_stats(struct hists *hists, struct hist_entry *h); |
121 | void hists__inc_nr_events(struct hists *hists, u32 type); | 121 | void hists__inc_nr_events(struct hists *hists, u32 type); |
122 | void hists__inc_nr_samples(struct hists *hists, bool filtered); | ||
122 | void events_stats__inc(struct events_stats *stats, u32 type); | 123 | void events_stats__inc(struct events_stats *stats, u32 type); |
123 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); | 124 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); |
124 | 125 | ||