diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-05-28 01:12:18 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-06-01 08:34:55 -0400 |
commit | 1844dbcbe78503e0f4a8996d69da725d5e7a5177 (patch) | |
tree | e1858b5bd3c1fb9a2638d366a9e1c790e5e654b6 /tools/perf/tests | |
parent | e450f90e8c7d0bf70519223c1b848446ae63f313 (diff) |
perf tools: Introduce hists__inc_nr_samples()
There're some duplicate code for counting number of samples. Add
hists__inc_nr_samples() and reuse it.
Suggested-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1401335910-16832-2-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/hists_filter.c | 4 |
1 files changed, 1 insertions, 3 deletions
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 | ||