diff options
author | Kan Liang <kan.liang@linux.intel.com> | 2018-03-06 10:36:07 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-03-08 10:05:53 -0300 |
commit | b9bae2c841b73eac6bfed510bc24a3051754ff51 (patch) | |
tree | 8533c197b859d64024805e0f4f6b9c2e778c20db /tools/perf/tests | |
parent | 0019dc87b928380e2c85fcd8694e512079d7b580 (diff) | |
download | linux-b9bae2c841b73eac6bfed510bc24a3051754ff51.tar.bz2 |
perf mmap: Simplify perf_mmap__read_init()
It isn't necessary to pass the 'start', 'end' and 'overwrite' arguments
to perf_mmap__read_init(). The data is stored in the struct perf_mmap.
Discard the parameters.
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1520350567-80082-8-git-send-email-kan.liang@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests')
-rw-r--r-- | tools/perf/tests/backward-ring-buffer.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/bpf.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/code-reading.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/keep-tracking.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/mmap-basic.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/openat-syscall-tp-fields.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/perf-record.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/sw-clock.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/switch-tracking.c | 3 | ||||
-rw-r--r-- | tools/perf/tests/task-exit.c | 3 |
10 files changed, 10 insertions, 20 deletions
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index e0eae1053ddc..6d598cc071ae 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c @@ -33,9 +33,8 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count, for (i = 0; i < evlist->nr_mmaps; i++) { struct perf_mmap *map = &evlist->overwrite_mmap[i]; union perf_event *event; - u64 start, end; - perf_mmap__read_init(map, true, &start, &end); + perf_mmap__read_init(map); while ((event = perf_mmap__read_event(map)) != NULL) { const u32 type = event->header.type; diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index 384c20f4c902..79b54f8ddebf 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c @@ -177,10 +177,9 @@ static int do_test(struct bpf_object *obj, int (*func)(void), for (i = 0; i < evlist->nr_mmaps; i++) { union perf_event *event; struct perf_mmap *md; - u64 end, start; md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index f7919666bc2c..99936352df4f 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -410,12 +410,11 @@ static int process_events(struct machine *machine, struct perf_evlist *evlist, { union perf_event *event; struct perf_mmap *md; - u64 end, start; int i, ret; for (i = 0; i < evlist->nr_mmaps; i++) { md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index ad477b7cf238..17c46f3e6f1e 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c @@ -28,13 +28,12 @@ static int find_comm(struct perf_evlist *evlist, const char *comm) { union perf_event *event; struct perf_mmap *md; - u64 end, start; int i, found; found = 0; for (i = 0; i < evlist->nr_mmaps; i++) { md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { if (event->header.type == PERF_RECORD_COMM && diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 7790eb3303e6..bb8e6bcb0d96 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c @@ -39,7 +39,6 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse struct perf_evsel *evsels[nsyscalls], *evsel; char sbuf[STRERR_BUFSIZE]; struct perf_mmap *md; - u64 end, start; threads = thread_map__new(-1, getpid(), UINT_MAX); if (threads == NULL) { @@ -109,7 +108,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse } md = &evlist->mmap[0]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) goto out_init; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index b0be2da65da7..344dc3ac2469 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -87,10 +87,9 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest for (i = 0; i < evlist->nr_mmaps; i++) { union perf_event *event; struct perf_mmap *md; - u64 end, start; md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index 59be0942b787..34394cc05077 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c @@ -165,10 +165,9 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus for (i = 0; i < evlist->nr_mmaps; i++) { union perf_event *event; struct perf_mmap *md; - u64 end, start; md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 403f2d9cee96..f9490b237893 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c @@ -40,7 +40,6 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) struct cpu_map *cpus; struct thread_map *threads; struct perf_mmap *md; - u64 end, start; attr.sample_freq = 500; @@ -96,7 +95,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) perf_evlist__disable(evlist); md = &evlist->mmap[0]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) goto out_init; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 99839de3caee..9b5be51e5e7b 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c @@ -259,12 +259,11 @@ static int process_events(struct perf_evlist *evlist, LIST_HEAD(events); struct event_node *events_array, *node; struct perf_mmap *md; - u64 end, start; int i, ret; for (i = 0; i < evlist->nr_mmaps; i++) { md = &evlist->mmap[i]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) continue; while ((event = perf_mmap__read_event(md)) != NULL) { diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 2df0c0573e2c..e92fa6029ac7 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c @@ -48,7 +48,6 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused struct cpu_map *cpus; struct thread_map *threads; struct perf_mmap *md; - u64 end, start; signal(SIGCHLD, sig_handler); @@ -113,7 +112,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused retry: md = &evlist->mmap[0]; - if (perf_mmap__read_init(md, false, &start, &end) < 0) + if (perf_mmap__read_init(md) < 0) goto out_init; while ((event = perf_mmap__read_event(md)) != NULL) { |