summaryrefslogtreecommitdiff
path: root/tools/perf/tests
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-05-28 05:12:18 (GMT)
committerJiri Olsa <jolsa@kernel.org>2014-06-01 12:34:55 (GMT)
commit1844dbcbe78503e0f4a8996d69da725d5e7a5177 (patch)
treee1858b5bd3c1fb9a2638d366a9e1c790e5e654b6 /tools/perf/tests
parente450f90e8c7d0bf70519223c1b848446ae63f313 (diff)
downloadlinux-1844dbcbe78503e0f4a8996d69da725d5e7a5177.tar.xz
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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index c5ba924..0a71ef4 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)
fake_samples[i].map = al.map;
fake_samples[i].sym = al.sym;
- hists__inc_nr_events(he->hists, PERF_RECORD_SAMPLE);
- if (!he->filtered)
- he->hists->stats.nr_non_filtered_samples++;
+ hists__inc_nr_samples(he->hists, he->filtered);
}
}