summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-05-28 07:12:18 +0200
committerJiri Olsa <jolsa@kernel.org>2014-06-01 14:34:55 +0200
commit1844dbcbe78503e0f4a8996d69da725d5e7a5177 (patch)
treee1858b5bd3c1fb9a2638d366a9e1c790e5e654b6 /tools/perf/builtin-top.c
parentMerge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/... (diff)
downloadlinux-1844dbcbe78503e0f4a8996d69da725d5e7a5177.tar.xz
linux-1844dbcbe78503e0f4a8996d69da725d5e7a5177.zip
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/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c5
1 files changed, 1 insertions, 4 deletions
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,
if (he == NULL)
return NULL;
- hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE);
- if (!he->filtered)
- evsel->hists.stats.nr_non_filtered_samples++;
-
+ hists__inc_nr_samples(&evsel->hists, he->filtered);
return he;
}