diff options
author | Jiri Olsa <jolsa@kernel.org> | 2019-07-27 14:30:53 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-09-25 08:51:44 -0400 |
commit | a583053299c1e66e6202b494cbc3acd93cedc4cc (patch) | |
tree | 92f2e5753b29e1913df93abf1b57f18510a01070 | |
parent | 058bd857845a9675cfaf4bc2ca831ec7953b58f1 (diff) |
perf tools: Rename 'struct perf_mmap' to 'struct mmap'
Rename 'struct perf_evlist' to 'struct evlist', so we don't have a name
clash when we add 'struct perf_mmap' to libperf.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lore.kernel.org/lkml/20190913132355.21634-4-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/arch/x86/tests/perf-time-to-tsc.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-kvm.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-record.c | 34 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-trace.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/backward-ring-buffer.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/bpf.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/code-reading.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/keep-tracking.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/mmap-basic.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/openat-syscall-tp-fields.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/perf-record.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/sw-clock.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/switch-tracking.c | 2 | ||||
-rw-r--r-- | tools/perf/tests/task-exit.c | 2 | ||||
-rw-r--r-- | tools/perf/util/auxtrace.c | 6 | ||||
-rw-r--r-- | tools/perf/util/auxtrace.h | 8 | ||||
-rw-r--r-- | tools/perf/util/evlist.c | 14 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 4 | ||||
-rw-r--r-- | tools/perf/util/mmap.c | 54 | ||||
-rw-r--r-- | tools/perf/util/mmap.h | 32 | ||||
-rw-r--r-- | tools/perf/util/python.c | 6 |
22 files changed, 93 insertions, 93 deletions
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c index 0a4570b340fa..c83abb1ed0ff 100644 --- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c +++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c | |||
@@ -65,7 +65,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe | |||
65 | union perf_event *event; | 65 | union perf_event *event; |
66 | u64 test_tsc, comm1_tsc, comm2_tsc; | 66 | u64 test_tsc, comm1_tsc, comm2_tsc; |
67 | u64 test_time, comm1_time = 0, comm2_time = 0; | 67 | u64 test_time, comm1_time = 0, comm2_time = 0; |
68 | struct perf_mmap *md; | 68 | struct mmap *md; |
69 | 69 | ||
70 | threads = thread_map__new(-1, getpid(), UINT_MAX); | 70 | threads = thread_map__new(-1, getpid(), UINT_MAX); |
71 | CHECK_NOT_NULL__(threads); | 71 | CHECK_NOT_NULL__(threads); |
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index c4b22e1b0a40..7354b77e9137 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c | |||
@@ -750,7 +750,7 @@ static s64 perf_kvm__mmap_read_idx(struct perf_kvm_stat *kvm, int idx, | |||
750 | { | 750 | { |
751 | struct evlist *evlist = kvm->evlist; | 751 | struct evlist *evlist = kvm->evlist; |
752 | union perf_event *event; | 752 | union perf_event *event; |
753 | struct perf_mmap *md; | 753 | struct mmap *md; |
754 | u64 timestamp; | 754 | u64 timestamp; |
755 | s64 n = 0; | 755 | s64 n = 0; |
756 | int err; | 756 | int err; |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 1e1f97139f16..1528fb686f96 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -119,7 +119,7 @@ static bool switch_output_time(struct record *rec) | |||
119 | trigger_is_ready(&switch_output_trigger); | 119 | trigger_is_ready(&switch_output_trigger); |
120 | } | 120 | } |
121 | 121 | ||
122 | static int record__write(struct record *rec, struct perf_mmap *map __maybe_unused, | 122 | static int record__write(struct record *rec, struct mmap *map __maybe_unused, |
123 | void *bf, size_t size) | 123 | void *bf, size_t size) |
124 | { | 124 | { |
125 | struct perf_data_file *file = &rec->session->data->file; | 125 | struct perf_data_file *file = &rec->session->data->file; |
@@ -168,7 +168,7 @@ static int record__aio_write(struct aiocb *cblock, int trace_fd, | |||
168 | return rc; | 168 | return rc; |
169 | } | 169 | } |
170 | 170 | ||
171 | static int record__aio_complete(struct perf_mmap *md, struct aiocb *cblock) | 171 | static int record__aio_complete(struct mmap *md, struct aiocb *cblock) |
172 | { | 172 | { |
173 | void *rem_buf; | 173 | void *rem_buf; |
174 | off_t rem_off; | 174 | off_t rem_off; |
@@ -214,7 +214,7 @@ static int record__aio_complete(struct perf_mmap *md, struct aiocb *cblock) | |||
214 | return rc; | 214 | return rc; |
215 | } | 215 | } |
216 | 216 | ||
217 | static int record__aio_sync(struct perf_mmap *md, bool sync_all) | 217 | static int record__aio_sync(struct mmap *md, bool sync_all) |
218 | { | 218 | { |
219 | struct aiocb **aiocb = md->aio.aiocb; | 219 | struct aiocb **aiocb = md->aio.aiocb; |
220 | struct aiocb *cblocks = md->aio.cblocks; | 220 | struct aiocb *cblocks = md->aio.cblocks; |
@@ -255,7 +255,7 @@ struct record_aio { | |||
255 | size_t size; | 255 | size_t size; |
256 | }; | 256 | }; |
257 | 257 | ||
258 | static int record__aio_pushfn(struct perf_mmap *map, void *to, void *buf, size_t size) | 258 | static int record__aio_pushfn(struct mmap *map, void *to, void *buf, size_t size) |
259 | { | 259 | { |
260 | struct record_aio *aio = to; | 260 | struct record_aio *aio = to; |
261 | 261 | ||
@@ -300,7 +300,7 @@ static int record__aio_pushfn(struct perf_mmap *map, void *to, void *buf, size_t | |||
300 | return size; | 300 | return size; |
301 | } | 301 | } |
302 | 302 | ||
303 | static int record__aio_push(struct record *rec, struct perf_mmap *map, off_t *off) | 303 | static int record__aio_push(struct record *rec, struct mmap *map, off_t *off) |
304 | { | 304 | { |
305 | int ret, idx; | 305 | int ret, idx; |
306 | int trace_fd = rec->session->data->file.fd; | 306 | int trace_fd = rec->session->data->file.fd; |
@@ -351,13 +351,13 @@ static void record__aio_mmap_read_sync(struct record *rec) | |||
351 | { | 351 | { |
352 | int i; | 352 | int i; |
353 | struct evlist *evlist = rec->evlist; | 353 | struct evlist *evlist = rec->evlist; |
354 | struct perf_mmap *maps = evlist->mmap; | 354 | struct mmap *maps = evlist->mmap; |
355 | 355 | ||
356 | if (!record__aio_enabled(rec)) | 356 | if (!record__aio_enabled(rec)) |
357 | return; | 357 | return; |
358 | 358 | ||
359 | for (i = 0; i < evlist->nr_mmaps; i++) { | 359 | for (i = 0; i < evlist->nr_mmaps; i++) { |
360 | struct perf_mmap *map = &maps[i]; | 360 | struct mmap *map = &maps[i]; |
361 | 361 | ||
362 | if (map->base) | 362 | if (map->base) |
363 | record__aio_sync(map, true); | 363 | record__aio_sync(map, true); |
@@ -387,7 +387,7 @@ static int record__aio_parse(const struct option *opt, | |||
387 | #else /* HAVE_AIO_SUPPORT */ | 387 | #else /* HAVE_AIO_SUPPORT */ |
388 | static int nr_cblocks_max = 0; | 388 | static int nr_cblocks_max = 0; |
389 | 389 | ||
390 | static int record__aio_push(struct record *rec __maybe_unused, struct perf_mmap *map __maybe_unused, | 390 | static int record__aio_push(struct record *rec __maybe_unused, struct mmap *map __maybe_unused, |
391 | off_t *off __maybe_unused) | 391 | off_t *off __maybe_unused) |
392 | { | 392 | { |
393 | return -1; | 393 | return -1; |
@@ -482,7 +482,7 @@ static int process_synthesized_event(struct perf_tool *tool, | |||
482 | return record__write(rec, NULL, event, event->header.size); | 482 | return record__write(rec, NULL, event, event->header.size); |
483 | } | 483 | } |
484 | 484 | ||
485 | static int record__pushfn(struct perf_mmap *map, void *to, void *bf, size_t size) | 485 | static int record__pushfn(struct mmap *map, void *to, void *bf, size_t size) |
486 | { | 486 | { |
487 | struct record *rec = to; | 487 | struct record *rec = to; |
488 | 488 | ||
@@ -527,7 +527,7 @@ static void record__sig_exit(void) | |||
527 | #ifdef HAVE_AUXTRACE_SUPPORT | 527 | #ifdef HAVE_AUXTRACE_SUPPORT |
528 | 528 | ||
529 | static int record__process_auxtrace(struct perf_tool *tool, | 529 | static int record__process_auxtrace(struct perf_tool *tool, |
530 | struct perf_mmap *map, | 530 | struct mmap *map, |
531 | union perf_event *event, void *data1, | 531 | union perf_event *event, void *data1, |
532 | size_t len1, void *data2, size_t len2) | 532 | size_t len1, void *data2, size_t len2) |
533 | { | 533 | { |
@@ -565,7 +565,7 @@ static int record__process_auxtrace(struct perf_tool *tool, | |||
565 | } | 565 | } |
566 | 566 | ||
567 | static int record__auxtrace_mmap_read(struct record *rec, | 567 | static int record__auxtrace_mmap_read(struct record *rec, |
568 | struct perf_mmap *map) | 568 | struct mmap *map) |
569 | { | 569 | { |
570 | int ret; | 570 | int ret; |
571 | 571 | ||
@@ -581,7 +581,7 @@ static int record__auxtrace_mmap_read(struct record *rec, | |||
581 | } | 581 | } |
582 | 582 | ||
583 | static int record__auxtrace_mmap_read_snapshot(struct record *rec, | 583 | static int record__auxtrace_mmap_read_snapshot(struct record *rec, |
584 | struct perf_mmap *map) | 584 | struct mmap *map) |
585 | { | 585 | { |
586 | int ret; | 586 | int ret; |
587 | 587 | ||
@@ -603,7 +603,7 @@ static int record__auxtrace_read_snapshot_all(struct record *rec) | |||
603 | int rc = 0; | 603 | int rc = 0; |
604 | 604 | ||
605 | for (i = 0; i < rec->evlist->nr_mmaps; i++) { | 605 | for (i = 0; i < rec->evlist->nr_mmaps; i++) { |
606 | struct perf_mmap *map = &rec->evlist->mmap[i]; | 606 | struct mmap *map = &rec->evlist->mmap[i]; |
607 | 607 | ||
608 | if (!map->auxtrace_mmap.base) | 608 | if (!map->auxtrace_mmap.base) |
609 | continue; | 609 | continue; |
@@ -668,7 +668,7 @@ static int record__auxtrace_init(struct record *rec) | |||
668 | 668 | ||
669 | static inline | 669 | static inline |
670 | int record__auxtrace_mmap_read(struct record *rec __maybe_unused, | 670 | int record__auxtrace_mmap_read(struct record *rec __maybe_unused, |
671 | struct perf_mmap *map __maybe_unused) | 671 | struct mmap *map __maybe_unused) |
672 | { | 672 | { |
673 | return 0; | 673 | return 0; |
674 | } | 674 | } |
@@ -901,7 +901,7 @@ static struct perf_event_header finished_round_event = { | |||
901 | .type = PERF_RECORD_FINISHED_ROUND, | 901 | .type = PERF_RECORD_FINISHED_ROUND, |
902 | }; | 902 | }; |
903 | 903 | ||
904 | static void record__adjust_affinity(struct record *rec, struct perf_mmap *map) | 904 | static void record__adjust_affinity(struct record *rec, struct mmap *map) |
905 | { | 905 | { |
906 | if (rec->opts.affinity != PERF_AFFINITY_SYS && | 906 | if (rec->opts.affinity != PERF_AFFINITY_SYS && |
907 | !CPU_EQUAL(&rec->affinity_mask, &map->affinity_mask)) { | 907 | !CPU_EQUAL(&rec->affinity_mask, &map->affinity_mask)) { |
@@ -948,7 +948,7 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist, | |||
948 | u64 bytes_written = rec->bytes_written; | 948 | u64 bytes_written = rec->bytes_written; |
949 | int i; | 949 | int i; |
950 | int rc = 0; | 950 | int rc = 0; |
951 | struct perf_mmap *maps; | 951 | struct mmap *maps; |
952 | int trace_fd = rec->data.file.fd; | 952 | int trace_fd = rec->data.file.fd; |
953 | off_t off = 0; | 953 | off_t off = 0; |
954 | 954 | ||
@@ -967,7 +967,7 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist, | |||
967 | 967 | ||
968 | for (i = 0; i < evlist->nr_mmaps; i++) { | 968 | for (i = 0; i < evlist->nr_mmaps; i++) { |
969 | u64 flush = 0; | 969 | u64 flush = 0; |
970 | struct perf_mmap *map = &maps[i]; | 970 | struct mmap *map = &maps[i]; |
971 | 971 | ||
972 | if (map->base) { | 972 | if (map->base) { |
973 | record__adjust_affinity(rec, map); | 973 | record__adjust_affinity(rec, map); |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 8da3c939e6b0..834a927107c4 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -863,7 +863,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx) | |||
863 | { | 863 | { |
864 | struct record_opts *opts = &top->record_opts; | 864 | struct record_opts *opts = &top->record_opts; |
865 | struct evlist *evlist = top->evlist; | 865 | struct evlist *evlist = top->evlist; |
866 | struct perf_mmap *md; | 866 | struct mmap *md; |
867 | union perf_event *event; | 867 | union perf_event *event; |
868 | 868 | ||
869 | md = opts->overwrite ? &evlist->overwrite_mmap[idx] : &evlist->mmap[idx]; | 869 | md = opts->overwrite ? &evlist->overwrite_mmap[idx] : &evlist->mmap[idx]; |
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index a292658b4232..2f853870d68d 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -3444,7 +3444,7 @@ again: | |||
3444 | 3444 | ||
3445 | for (i = 0; i < evlist->nr_mmaps; i++) { | 3445 | for (i = 0; i < evlist->nr_mmaps; i++) { |
3446 | union perf_event *event; | 3446 | union perf_event *event; |
3447 | struct perf_mmap *md; | 3447 | struct mmap *md; |
3448 | 3448 | ||
3449 | md = &evlist->mmap[i]; | 3449 | md = &evlist->mmap[i]; |
3450 | if (perf_mmap__read_init(md) < 0) | 3450 | if (perf_mmap__read_init(md) < 0) |
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index a637a4a90760..0a046096e6f4 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c | |||
@@ -33,7 +33,7 @@ static int count_samples(struct evlist *evlist, int *sample_count, | |||
33 | int i; | 33 | int i; |
34 | 34 | ||
35 | for (i = 0; i < evlist->nr_mmaps; i++) { | 35 | for (i = 0; i < evlist->nr_mmaps; i++) { |
36 | struct perf_mmap *map = &evlist->overwrite_mmap[i]; | 36 | struct mmap *map = &evlist->overwrite_mmap[i]; |
37 | union perf_event *event; | 37 | union perf_event *event; |
38 | 38 | ||
39 | perf_mmap__read_init(map); | 39 | perf_mmap__read_init(map); |
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index fc102e4f403e..cf9776aceb82 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c | |||
@@ -180,7 +180,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void), | |||
180 | 180 | ||
181 | for (i = 0; i < evlist->nr_mmaps; i++) { | 181 | for (i = 0; i < evlist->nr_mmaps; i++) { |
182 | union perf_event *event; | 182 | union perf_event *event; |
183 | struct perf_mmap *md; | 183 | struct mmap *md; |
184 | 184 | ||
185 | md = &evlist->mmap[i]; | 185 | md = &evlist->mmap[i]; |
186 | if (perf_mmap__read_init(md) < 0) | 186 | if (perf_mmap__read_init(md) < 0) |
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c index fd02c1f1d976..df96cbb9ffe5 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c | |||
@@ -419,7 +419,7 @@ static int process_events(struct machine *machine, struct evlist *evlist, | |||
419 | struct state *state) | 419 | struct state *state) |
420 | { | 420 | { |
421 | union perf_event *event; | 421 | union perf_event *event; |
422 | struct perf_mmap *md; | 422 | struct mmap *md; |
423 | int i, ret; | 423 | int i, ret; |
424 | 424 | ||
425 | for (i = 0; i < evlist->nr_mmaps; i++) { | 425 | for (i = 0; i < evlist->nr_mmaps; i++) { |
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c index df0fd5a44e04..67a87f507bbd 100644 --- a/tools/perf/tests/keep-tracking.c +++ b/tools/perf/tests/keep-tracking.c | |||
@@ -31,7 +31,7 @@ | |||
31 | static int find_comm(struct evlist *evlist, const char *comm) | 31 | static int find_comm(struct evlist *evlist, const char *comm) |
32 | { | 32 | { |
33 | union perf_event *event; | 33 | union perf_event *event; |
34 | struct perf_mmap *md; | 34 | struct mmap *md; |
35 | int i, found; | 35 | int i, found; |
36 | 36 | ||
37 | found = 0; | 37 | found = 0; |
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c index 042757629e90..accca3d78fa3 100644 --- a/tools/perf/tests/mmap-basic.c +++ b/tools/perf/tests/mmap-basic.c | |||
@@ -42,7 +42,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse | |||
42 | expected_nr_events[nsyscalls], i, j; | 42 | expected_nr_events[nsyscalls], i, j; |
43 | struct evsel *evsels[nsyscalls], *evsel; | 43 | struct evsel *evsels[nsyscalls], *evsel; |
44 | char sbuf[STRERR_BUFSIZE]; | 44 | char sbuf[STRERR_BUFSIZE]; |
45 | struct perf_mmap *md; | 45 | struct mmap *md; |
46 | 46 | ||
47 | threads = thread_map__new(-1, getpid(), UINT_MAX); | 47 | threads = thread_map__new(-1, getpid(), UINT_MAX); |
48 | if (threads == NULL) { | 48 | if (threads == NULL) { |
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index b71167b43dda..e5ef74d4e925 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c | |||
@@ -88,7 +88,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest | |||
88 | 88 | ||
89 | for (i = 0; i < evlist->nr_mmaps; i++) { | 89 | for (i = 0; i < evlist->nr_mmaps; i++) { |
90 | union perf_event *event; | 90 | union perf_event *event; |
91 | struct perf_mmap *md; | 91 | struct mmap *md; |
92 | 92 | ||
93 | md = &evlist->mmap[i]; | 93 | md = &evlist->mmap[i]; |
94 | if (perf_mmap__read_init(md) < 0) | 94 | if (perf_mmap__read_init(md) < 0) |
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c index e1b42292cf7f..49d2d4c5956d 100644 --- a/tools/perf/tests/perf-record.c +++ b/tools/perf/tests/perf-record.c | |||
@@ -166,7 +166,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus | |||
166 | 166 | ||
167 | for (i = 0; i < evlist->nr_mmaps; i++) { | 167 | for (i = 0; i < evlist->nr_mmaps; i++) { |
168 | union perf_event *event; | 168 | union perf_event *event; |
169 | struct perf_mmap *md; | 169 | struct mmap *md; |
170 | 170 | ||
171 | md = &evlist->mmap[i]; | 171 | md = &evlist->mmap[i]; |
172 | if (perf_mmap__read_init(md) < 0) | 172 | if (perf_mmap__read_init(md) < 0) |
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 97694a040986..7abe0b6aabb7 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c | |||
@@ -42,7 +42,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
42 | }; | 42 | }; |
43 | struct perf_cpu_map *cpus; | 43 | struct perf_cpu_map *cpus; |
44 | struct perf_thread_map *threads; | 44 | struct perf_thread_map *threads; |
45 | struct perf_mmap *md; | 45 | struct mmap *md; |
46 | 46 | ||
47 | attr.sample_freq = 500; | 47 | attr.sample_freq = 500; |
48 | 48 | ||
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c index 3fb1ff7b8a2f..e7888ddd69a3 100644 --- a/tools/perf/tests/switch-tracking.c +++ b/tools/perf/tests/switch-tracking.c | |||
@@ -263,7 +263,7 @@ static int process_events(struct evlist *evlist, | |||
263 | unsigned pos, cnt = 0; | 263 | unsigned pos, cnt = 0; |
264 | LIST_HEAD(events); | 264 | LIST_HEAD(events); |
265 | struct event_node *events_array, *node; | 265 | struct event_node *events_array, *node; |
266 | struct perf_mmap *md; | 266 | struct mmap *md; |
267 | int i, ret; | 267 | int i, ret; |
268 | 268 | ||
269 | for (i = 0; i < evlist->nr_mmaps; i++) { | 269 | for (i = 0; i < evlist->nr_mmaps; i++) { |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 088c7708b03a..cff99707cc9d 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -51,7 +51,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused | |||
51 | char sbuf[STRERR_BUFSIZE]; | 51 | char sbuf[STRERR_BUFSIZE]; |
52 | struct perf_cpu_map *cpus; | 52 | struct perf_cpu_map *cpus; |
53 | struct perf_thread_map *threads; | 53 | struct perf_thread_map *threads; |
54 | struct perf_mmap *md; | 54 | struct mmap *md; |
55 | 55 | ||
56 | signal(SIGCHLD, sig_handler); | 56 | signal(SIGCHLD, sig_handler); |
57 | 57 | ||
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 0e8c89cf7cad..1d22ffd972ac 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c | |||
@@ -1228,7 +1228,7 @@ int perf_event__process_auxtrace_error(struct perf_session *session, | |||
1228 | return 0; | 1228 | return 0; |
1229 | } | 1229 | } |
1230 | 1230 | ||
1231 | static int __auxtrace_mmap__read(struct perf_mmap *map, | 1231 | static int __auxtrace_mmap__read(struct mmap *map, |
1232 | struct auxtrace_record *itr, | 1232 | struct auxtrace_record *itr, |
1233 | struct perf_tool *tool, process_auxtrace_t fn, | 1233 | struct perf_tool *tool, process_auxtrace_t fn, |
1234 | bool snapshot, size_t snapshot_size) | 1234 | bool snapshot, size_t snapshot_size) |
@@ -1339,13 +1339,13 @@ static int __auxtrace_mmap__read(struct perf_mmap *map, | |||
1339 | return 1; | 1339 | return 1; |
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | int auxtrace_mmap__read(struct perf_mmap *map, struct auxtrace_record *itr, | 1342 | int auxtrace_mmap__read(struct mmap *map, struct auxtrace_record *itr, |
1343 | struct perf_tool *tool, process_auxtrace_t fn) | 1343 | struct perf_tool *tool, process_auxtrace_t fn) |
1344 | { | 1344 | { |
1345 | return __auxtrace_mmap__read(map, itr, tool, fn, false, 0); | 1345 | return __auxtrace_mmap__read(map, itr, tool, fn, false, 0); |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | int auxtrace_mmap__read_snapshot(struct perf_mmap *map, | 1348 | int auxtrace_mmap__read_snapshot(struct mmap *map, |
1349 | struct auxtrace_record *itr, | 1349 | struct auxtrace_record *itr, |
1350 | struct perf_tool *tool, process_auxtrace_t fn, | 1350 | struct perf_tool *tool, process_auxtrace_t fn, |
1351 | size_t snapshot_size) | 1351 | size_t snapshot_size) |
diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index b110aec1da4d..f201f36bc35f 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h | |||
@@ -22,7 +22,7 @@ union perf_event; | |||
22 | struct perf_session; | 22 | struct perf_session; |
23 | struct evlist; | 23 | struct evlist; |
24 | struct perf_tool; | 24 | struct perf_tool; |
25 | struct perf_mmap; | 25 | struct mmap; |
26 | struct perf_sample; | 26 | struct perf_sample; |
27 | struct option; | 27 | struct option; |
28 | struct record_opts; | 28 | struct record_opts; |
@@ -445,14 +445,14 @@ void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp, | |||
445 | bool per_cpu); | 445 | bool per_cpu); |
446 | 446 | ||
447 | typedef int (*process_auxtrace_t)(struct perf_tool *tool, | 447 | typedef int (*process_auxtrace_t)(struct perf_tool *tool, |
448 | struct perf_mmap *map, | 448 | struct mmap *map, |
449 | union perf_event *event, void *data1, | 449 | union perf_event *event, void *data1, |
450 | size_t len1, void *data2, size_t len2); | 450 | size_t len1, void *data2, size_t len2); |
451 | 451 | ||
452 | int auxtrace_mmap__read(struct perf_mmap *map, struct auxtrace_record *itr, | 452 | int auxtrace_mmap__read(struct mmap *map, struct auxtrace_record *itr, |
453 | struct perf_tool *tool, process_auxtrace_t fn); | 453 | struct perf_tool *tool, process_auxtrace_t fn); |
454 | 454 | ||
455 | int auxtrace_mmap__read_snapshot(struct perf_mmap *map, | 455 | int auxtrace_mmap__read_snapshot(struct mmap *map, |
456 | struct auxtrace_record *itr, | 456 | struct auxtrace_record *itr, |
457 | struct perf_tool *tool, process_auxtrace_t fn, | 457 | struct perf_tool *tool, process_auxtrace_t fn, |
458 | size_t snapshot_size); | 458 | size_t snapshot_size); |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ea9517d506d8..ceab9fb7f7f9 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -423,7 +423,7 @@ int perf_evlist__alloc_pollfd(struct evlist *evlist) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | static int __perf_evlist__add_pollfd(struct evlist *evlist, int fd, | 425 | static int __perf_evlist__add_pollfd(struct evlist *evlist, int fd, |
426 | struct perf_mmap *map, short revent) | 426 | struct mmap *map, short revent) |
427 | { | 427 | { |
428 | int pos = fdarray__add(&evlist->pollfd, fd, revent | POLLERR | POLLHUP); | 428 | int pos = fdarray__add(&evlist->pollfd, fd, revent | POLLERR | POLLHUP); |
429 | /* | 429 | /* |
@@ -447,7 +447,7 @@ int perf_evlist__add_pollfd(struct evlist *evlist, int fd) | |||
447 | static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd, | 447 | static void perf_evlist__munmap_filtered(struct fdarray *fda, int fd, |
448 | void *arg __maybe_unused) | 448 | void *arg __maybe_unused) |
449 | { | 449 | { |
450 | struct perf_mmap *map = fda->priv[fd].ptr; | 450 | struct mmap *map = fda->priv[fd].ptr; |
451 | 451 | ||
452 | if (map) | 452 | if (map) |
453 | perf_mmap__put(map); | 453 | perf_mmap__put(map); |
@@ -693,16 +693,16 @@ void perf_evlist__munmap(struct evlist *evlist) | |||
693 | zfree(&evlist->overwrite_mmap); | 693 | zfree(&evlist->overwrite_mmap); |
694 | } | 694 | } |
695 | 695 | ||
696 | static struct perf_mmap *perf_evlist__alloc_mmap(struct evlist *evlist, | 696 | static struct mmap *perf_evlist__alloc_mmap(struct evlist *evlist, |
697 | bool overwrite) | 697 | bool overwrite) |
698 | { | 698 | { |
699 | int i; | 699 | int i; |
700 | struct perf_mmap *map; | 700 | struct mmap *map; |
701 | 701 | ||
702 | evlist->nr_mmaps = perf_cpu_map__nr(evlist->core.cpus); | 702 | evlist->nr_mmaps = perf_cpu_map__nr(evlist->core.cpus); |
703 | if (perf_cpu_map__empty(evlist->core.cpus)) | 703 | if (perf_cpu_map__empty(evlist->core.cpus)) |
704 | evlist->nr_mmaps = perf_thread_map__nr(evlist->core.threads); | 704 | evlist->nr_mmaps = perf_thread_map__nr(evlist->core.threads); |
705 | map = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap)); | 705 | map = zalloc(evlist->nr_mmaps * sizeof(struct mmap)); |
706 | if (!map) | 706 | if (!map) |
707 | return NULL; | 707 | return NULL; |
708 | 708 | ||
@@ -741,7 +741,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx, | |||
741 | int evlist_cpu = cpu_map__cpu(evlist->core.cpus, cpu_idx); | 741 | int evlist_cpu = cpu_map__cpu(evlist->core.cpus, cpu_idx); |
742 | 742 | ||
743 | evlist__for_each_entry(evlist, evsel) { | 743 | evlist__for_each_entry(evlist, evsel) { |
744 | struct perf_mmap *maps = evlist->mmap; | 744 | struct mmap *maps = evlist->mmap; |
745 | int *output = _output; | 745 | int *output = _output; |
746 | int fd; | 746 | int fd; |
747 | int cpu; | 747 | int cpu; |
@@ -1847,7 +1847,7 @@ static void *perf_evlist__poll_thread(void *arg) | |||
1847 | perf_evlist__poll(evlist, 1000); | 1847 | perf_evlist__poll(evlist, 1000); |
1848 | 1848 | ||
1849 | for (i = 0; i < evlist->nr_mmaps; i++) { | 1849 | for (i = 0; i < evlist->nr_mmaps; i++) { |
1850 | struct perf_mmap *map = &evlist->mmap[i]; | 1850 | struct mmap *map = &evlist->mmap[i]; |
1851 | union perf_event *event; | 1851 | union perf_event *event; |
1852 | 1852 | ||
1853 | if (perf_mmap__read_init(map)) | 1853 | if (perf_mmap__read_init(map)) |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index a55f0f2546e5..129786361572 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -39,8 +39,8 @@ struct evlist { | |||
39 | pid_t pid; | 39 | pid_t pid; |
40 | } workload; | 40 | } workload; |
41 | struct fdarray pollfd; | 41 | struct fdarray pollfd; |
42 | struct perf_mmap *mmap; | 42 | struct mmap *mmap; |
43 | struct perf_mmap *overwrite_mmap; | 43 | struct mmap *overwrite_mmap; |
44 | struct evsel *selected; | 44 | struct evsel *selected; |
45 | struct events_stats stats; | 45 | struct events_stats stats; |
46 | struct perf_env *env; | 46 | struct perf_env *env; |
diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 33c5b5495482..f3b7c8b0fa90 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c | |||
@@ -22,13 +22,13 @@ | |||
22 | #include "../perf.h" | 22 | #include "../perf.h" |
23 | #include "util.h" /* page_size */ | 23 | #include "util.h" /* page_size */ |
24 | 24 | ||
25 | size_t perf_mmap__mmap_len(struct perf_mmap *map) | 25 | size_t perf_mmap__mmap_len(struct mmap *map) |
26 | { | 26 | { |
27 | return map->mask + 1 + page_size; | 27 | return map->mask + 1 + page_size; |
28 | } | 28 | } |
29 | 29 | ||
30 | /* When check_messup is true, 'end' must points to a good entry */ | 30 | /* When check_messup is true, 'end' must points to a good entry */ |
31 | static union perf_event *perf_mmap__read(struct perf_mmap *map, | 31 | static union perf_event *perf_mmap__read(struct mmap *map, |
32 | u64 *startp, u64 end) | 32 | u64 *startp, u64 end) |
33 | { | 33 | { |
34 | unsigned char *data = map->base + page_size; | 34 | unsigned char *data = map->base + page_size; |
@@ -82,7 +82,7 @@ static union perf_event *perf_mmap__read(struct perf_mmap *map, | |||
82 | * } | 82 | * } |
83 | * perf_mmap__read_done() | 83 | * perf_mmap__read_done() |
84 | */ | 84 | */ |
85 | union perf_event *perf_mmap__read_event(struct perf_mmap *map) | 85 | union perf_event *perf_mmap__read_event(struct mmap *map) |
86 | { | 86 | { |
87 | union perf_event *event; | 87 | union perf_event *event; |
88 | 88 | ||
@@ -104,17 +104,17 @@ union perf_event *perf_mmap__read_event(struct perf_mmap *map) | |||
104 | return event; | 104 | return event; |
105 | } | 105 | } |
106 | 106 | ||
107 | static bool perf_mmap__empty(struct perf_mmap *map) | 107 | static bool perf_mmap__empty(struct mmap *map) |
108 | { | 108 | { |
109 | return perf_mmap__read_head(map) == map->prev && !map->auxtrace_mmap.base; | 109 | return perf_mmap__read_head(map) == map->prev && !map->auxtrace_mmap.base; |
110 | } | 110 | } |
111 | 111 | ||
112 | void perf_mmap__get(struct perf_mmap *map) | 112 | void perf_mmap__get(struct mmap *map) |
113 | { | 113 | { |
114 | refcount_inc(&map->refcnt); | 114 | refcount_inc(&map->refcnt); |
115 | } | 115 | } |
116 | 116 | ||
117 | void perf_mmap__put(struct perf_mmap *map) | 117 | void perf_mmap__put(struct mmap *map) |
118 | { | 118 | { |
119 | BUG_ON(map->base && refcount_read(&map->refcnt) == 0); | 119 | BUG_ON(map->base && refcount_read(&map->refcnt) == 0); |
120 | 120 | ||
@@ -122,7 +122,7 @@ void perf_mmap__put(struct perf_mmap *map) | |||
122 | perf_mmap__munmap(map); | 122 | perf_mmap__munmap(map); |
123 | } | 123 | } |
124 | 124 | ||
125 | void perf_mmap__consume(struct perf_mmap *map) | 125 | void perf_mmap__consume(struct mmap *map) |
126 | { | 126 | { |
127 | if (!map->overwrite) { | 127 | if (!map->overwrite) { |
128 | u64 old = map->prev; | 128 | u64 old = map->prev; |
@@ -161,13 +161,13 @@ void __weak auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp __mayb | |||
161 | } | 161 | } |
162 | 162 | ||
163 | #ifdef HAVE_AIO_SUPPORT | 163 | #ifdef HAVE_AIO_SUPPORT |
164 | static int perf_mmap__aio_enabled(struct perf_mmap *map) | 164 | static int perf_mmap__aio_enabled(struct mmap *map) |
165 | { | 165 | { |
166 | return map->aio.nr_cblocks > 0; | 166 | return map->aio.nr_cblocks > 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | #ifdef HAVE_LIBNUMA_SUPPORT | 169 | #ifdef HAVE_LIBNUMA_SUPPORT |
170 | static int perf_mmap__aio_alloc(struct perf_mmap *map, int idx) | 170 | static int perf_mmap__aio_alloc(struct mmap *map, int idx) |
171 | { | 171 | { |
172 | map->aio.data[idx] = mmap(NULL, perf_mmap__mmap_len(map), PROT_READ|PROT_WRITE, | 172 | map->aio.data[idx] = mmap(NULL, perf_mmap__mmap_len(map), PROT_READ|PROT_WRITE, |
173 | MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); | 173 | MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); |
@@ -179,7 +179,7 @@ static int perf_mmap__aio_alloc(struct perf_mmap *map, int idx) | |||
179 | return 0; | 179 | return 0; |
180 | } | 180 | } |
181 | 181 | ||
182 | static void perf_mmap__aio_free(struct perf_mmap *map, int idx) | 182 | static void perf_mmap__aio_free(struct mmap *map, int idx) |
183 | { | 183 | { |
184 | if (map->aio.data[idx]) { | 184 | if (map->aio.data[idx]) { |
185 | munmap(map->aio.data[idx], perf_mmap__mmap_len(map)); | 185 | munmap(map->aio.data[idx], perf_mmap__mmap_len(map)); |
@@ -187,7 +187,7 @@ static void perf_mmap__aio_free(struct perf_mmap *map, int idx) | |||
187 | } | 187 | } |
188 | } | 188 | } |
189 | 189 | ||
190 | static int perf_mmap__aio_bind(struct perf_mmap *map, int idx, int cpu, int affinity) | 190 | static int perf_mmap__aio_bind(struct mmap *map, int idx, int cpu, int affinity) |
191 | { | 191 | { |
192 | void *data; | 192 | void *data; |
193 | size_t mmap_len; | 193 | size_t mmap_len; |
@@ -207,7 +207,7 @@ static int perf_mmap__aio_bind(struct perf_mmap *map, int idx, int cpu, int affi | |||
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | #else /* !HAVE_LIBNUMA_SUPPORT */ | 209 | #else /* !HAVE_LIBNUMA_SUPPORT */ |
210 | static int perf_mmap__aio_alloc(struct perf_mmap *map, int idx) | 210 | static int perf_mmap__aio_alloc(struct mmap *map, int idx) |
211 | { | 211 | { |
212 | map->aio.data[idx] = malloc(perf_mmap__mmap_len(map)); | 212 | map->aio.data[idx] = malloc(perf_mmap__mmap_len(map)); |
213 | if (map->aio.data[idx] == NULL) | 213 | if (map->aio.data[idx] == NULL) |
@@ -216,19 +216,19 @@ static int perf_mmap__aio_alloc(struct perf_mmap *map, int idx) | |||
216 | return 0; | 216 | return 0; |
217 | } | 217 | } |
218 | 218 | ||
219 | static void perf_mmap__aio_free(struct perf_mmap *map, int idx) | 219 | static void perf_mmap__aio_free(struct mmap *map, int idx) |
220 | { | 220 | { |
221 | zfree(&(map->aio.data[idx])); | 221 | zfree(&(map->aio.data[idx])); |
222 | } | 222 | } |
223 | 223 | ||
224 | static int perf_mmap__aio_bind(struct perf_mmap *map __maybe_unused, int idx __maybe_unused, | 224 | static int perf_mmap__aio_bind(struct mmap *map __maybe_unused, int idx __maybe_unused, |
225 | int cpu __maybe_unused, int affinity __maybe_unused) | 225 | int cpu __maybe_unused, int affinity __maybe_unused) |
226 | { | 226 | { |
227 | return 0; | 227 | return 0; |
228 | } | 228 | } |
229 | #endif | 229 | #endif |
230 | 230 | ||
231 | static int perf_mmap__aio_mmap(struct perf_mmap *map, struct mmap_params *mp) | 231 | static int perf_mmap__aio_mmap(struct mmap *map, struct mmap_params *mp) |
232 | { | 232 | { |
233 | int delta_max, i, prio, ret; | 233 | int delta_max, i, prio, ret; |
234 | 234 | ||
@@ -282,7 +282,7 @@ static int perf_mmap__aio_mmap(struct perf_mmap *map, struct mmap_params *mp) | |||
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | static void perf_mmap__aio_munmap(struct perf_mmap *map) | 285 | static void perf_mmap__aio_munmap(struct mmap *map) |
286 | { | 286 | { |
287 | int i; | 287 | int i; |
288 | 288 | ||
@@ -294,23 +294,23 @@ static void perf_mmap__aio_munmap(struct perf_mmap *map) | |||
294 | zfree(&map->aio.aiocb); | 294 | zfree(&map->aio.aiocb); |
295 | } | 295 | } |
296 | #else /* !HAVE_AIO_SUPPORT */ | 296 | #else /* !HAVE_AIO_SUPPORT */ |
297 | static int perf_mmap__aio_enabled(struct perf_mmap *map __maybe_unused) | 297 | static int perf_mmap__aio_enabled(struct mmap *map __maybe_unused) |
298 | { | 298 | { |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | 301 | ||
302 | static int perf_mmap__aio_mmap(struct perf_mmap *map __maybe_unused, | 302 | static int perf_mmap__aio_mmap(struct mmap *map __maybe_unused, |
303 | struct mmap_params *mp __maybe_unused) | 303 | struct mmap_params *mp __maybe_unused) |
304 | { | 304 | { |
305 | return 0; | 305 | return 0; |
306 | } | 306 | } |
307 | 307 | ||
308 | static void perf_mmap__aio_munmap(struct perf_mmap *map __maybe_unused) | 308 | static void perf_mmap__aio_munmap(struct mmap *map __maybe_unused) |
309 | { | 309 | { |
310 | } | 310 | } |
311 | #endif | 311 | #endif |
312 | 312 | ||
313 | void perf_mmap__munmap(struct perf_mmap *map) | 313 | void perf_mmap__munmap(struct mmap *map) |
314 | { | 314 | { |
315 | perf_mmap__aio_munmap(map); | 315 | perf_mmap__aio_munmap(map); |
316 | if (map->data != NULL) { | 316 | if (map->data != NULL) { |
@@ -343,7 +343,7 @@ static void build_node_mask(int node, cpu_set_t *mask) | |||
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | static void perf_mmap__setup_affinity_mask(struct perf_mmap *map, struct mmap_params *mp) | 346 | static void perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params *mp) |
347 | { | 347 | { |
348 | CPU_ZERO(&map->affinity_mask); | 348 | CPU_ZERO(&map->affinity_mask); |
349 | if (mp->affinity == PERF_AFFINITY_NODE && cpu__max_node() > 1) | 349 | if (mp->affinity == PERF_AFFINITY_NODE && cpu__max_node() > 1) |
@@ -352,7 +352,7 @@ static void perf_mmap__setup_affinity_mask(struct perf_mmap *map, struct mmap_pa | |||
352 | CPU_SET(map->cpu, &map->affinity_mask); | 352 | CPU_SET(map->cpu, &map->affinity_mask); |
353 | } | 353 | } |
354 | 354 | ||
355 | int perf_mmap__mmap(struct perf_mmap *map, struct mmap_params *mp, int fd, int cpu) | 355 | int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu) |
356 | { | 356 | { |
357 | /* | 357 | /* |
358 | * The last one will be done at perf_mmap__consume(), so that we | 358 | * The last one will be done at perf_mmap__consume(), so that we |
@@ -440,7 +440,7 @@ static int overwrite_rb_find_range(void *buf, int mask, u64 *start, u64 *end) | |||
440 | /* | 440 | /* |
441 | * Report the start and end of the available data in ringbuffer | 441 | * Report the start and end of the available data in ringbuffer |
442 | */ | 442 | */ |
443 | static int __perf_mmap__read_init(struct perf_mmap *md) | 443 | static int __perf_mmap__read_init(struct mmap *md) |
444 | { | 444 | { |
445 | u64 head = perf_mmap__read_head(md); | 445 | u64 head = perf_mmap__read_head(md); |
446 | u64 old = md->prev; | 446 | u64 old = md->prev; |
@@ -474,7 +474,7 @@ static int __perf_mmap__read_init(struct perf_mmap *md) | |||
474 | return 0; | 474 | return 0; |
475 | } | 475 | } |
476 | 476 | ||
477 | int perf_mmap__read_init(struct perf_mmap *map) | 477 | int perf_mmap__read_init(struct mmap *map) |
478 | { | 478 | { |
479 | /* | 479 | /* |
480 | * Check if event was unmapped due to a POLLHUP/POLLERR. | 480 | * Check if event was unmapped due to a POLLHUP/POLLERR. |
@@ -485,8 +485,8 @@ int perf_mmap__read_init(struct perf_mmap *map) | |||
485 | return __perf_mmap__read_init(map); | 485 | return __perf_mmap__read_init(map); |
486 | } | 486 | } |
487 | 487 | ||
488 | int perf_mmap__push(struct perf_mmap *md, void *to, | 488 | int perf_mmap__push(struct mmap *md, void *to, |
489 | int push(struct perf_mmap *map, void *to, void *buf, size_t size)) | 489 | int push(struct mmap *map, void *to, void *buf, size_t size)) |
490 | { | 490 | { |
491 | u64 head = perf_mmap__read_head(md); | 491 | u64 head = perf_mmap__read_head(md); |
492 | unsigned char *data = md->base + page_size; | 492 | unsigned char *data = md->base + page_size; |
@@ -532,7 +532,7 @@ out: | |||
532 | * The last perf_mmap__read() will set tail to map->prev. | 532 | * The last perf_mmap__read() will set tail to map->prev. |
533 | * Need to correct the map->prev to head which is the end of next read. | 533 | * Need to correct the map->prev to head which is the end of next read. |
534 | */ | 534 | */ |
535 | void perf_mmap__read_done(struct perf_mmap *map) | 535 | void perf_mmap__read_done(struct mmap *map) |
536 | { | 536 | { |
537 | /* | 537 | /* |
538 | * Check if event was unmapped due to a POLLHUP/POLLERR. | 538 | * Check if event was unmapped due to a POLLHUP/POLLERR. |
diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index 3857a49e8f96..01524608a984 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h | |||
@@ -15,11 +15,11 @@ | |||
15 | 15 | ||
16 | struct aiocb; | 16 | struct aiocb; |
17 | /** | 17 | /** |
18 | * struct perf_mmap - perf's ring buffer mmap details | 18 | * struct mmap - perf's ring buffer mmap details |
19 | * | 19 | * |
20 | * @refcnt - e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this | 20 | * @refcnt - e.g. code using PERF_EVENT_IOC_SET_OUTPUT to share this |
21 | */ | 21 | */ |
22 | struct perf_mmap { | 22 | struct mmap { |
23 | void *base; | 23 | void *base; |
24 | int mask; | 24 | int mask; |
25 | int fd; | 25 | int fd; |
@@ -78,33 +78,33 @@ struct mmap_params { | |||
78 | struct auxtrace_mmap_params auxtrace_mp; | 78 | struct auxtrace_mmap_params auxtrace_mp; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | int perf_mmap__mmap(struct perf_mmap *map, struct mmap_params *mp, int fd, int cpu); | 81 | int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu); |
82 | void perf_mmap__munmap(struct perf_mmap *map); | 82 | void perf_mmap__munmap(struct mmap *map); |
83 | 83 | ||
84 | void perf_mmap__get(struct perf_mmap *map); | 84 | void perf_mmap__get(struct mmap *map); |
85 | void perf_mmap__put(struct perf_mmap *map); | 85 | void perf_mmap__put(struct mmap *map); |
86 | 86 | ||
87 | void perf_mmap__consume(struct perf_mmap *map); | 87 | void perf_mmap__consume(struct mmap *map); |
88 | 88 | ||
89 | static inline u64 perf_mmap__read_head(struct perf_mmap *mm) | 89 | static inline u64 perf_mmap__read_head(struct mmap *mm) |
90 | { | 90 | { |
91 | return ring_buffer_read_head(mm->base); | 91 | return ring_buffer_read_head(mm->base); |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline void perf_mmap__write_tail(struct perf_mmap *md, u64 tail) | 94 | static inline void perf_mmap__write_tail(struct mmap *md, u64 tail) |
95 | { | 95 | { |
96 | ring_buffer_write_tail(md->base, tail); | 96 | ring_buffer_write_tail(md->base, tail); |
97 | } | 97 | } |
98 | 98 | ||
99 | union perf_event *perf_mmap__read_forward(struct perf_mmap *map); | 99 | union perf_event *perf_mmap__read_forward(struct mmap *map); |
100 | 100 | ||
101 | union perf_event *perf_mmap__read_event(struct perf_mmap *map); | 101 | union perf_event *perf_mmap__read_event(struct mmap *map); |
102 | 102 | ||
103 | int perf_mmap__push(struct perf_mmap *md, void *to, | 103 | int perf_mmap__push(struct mmap *md, void *to, |
104 | int push(struct perf_mmap *map, void *to, void *buf, size_t size)); | 104 | int push(struct mmap *map, void *to, void *buf, size_t size)); |
105 | 105 | ||
106 | size_t perf_mmap__mmap_len(struct perf_mmap *map); | 106 | size_t perf_mmap__mmap_len(struct mmap *map); |
107 | 107 | ||
108 | int perf_mmap__read_init(struct perf_mmap *md); | 108 | int perf_mmap__read_init(struct mmap *md); |
109 | void perf_mmap__read_done(struct perf_mmap *map); | 109 | void perf_mmap__read_done(struct mmap *map); |
110 | #endif /*__PERF_MMAP_H */ | 110 | #endif /*__PERF_MMAP_H */ |
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 0ba19dd75510..1e1247cffea8 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c | |||
@@ -984,12 +984,12 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, | |||
984 | return Py_BuildValue("i", evlist->core.nr_entries); | 984 | return Py_BuildValue("i", evlist->core.nr_entries); |
985 | } | 985 | } |
986 | 986 | ||
987 | static struct perf_mmap *get_md(struct evlist *evlist, int cpu) | 987 | static struct mmap *get_md(struct evlist *evlist, int cpu) |
988 | { | 988 | { |
989 | int i; | 989 | int i; |
990 | 990 | ||
991 | for (i = 0; i < evlist->nr_mmaps; i++) { | 991 | for (i = 0; i < evlist->nr_mmaps; i++) { |
992 | struct perf_mmap *md = &evlist->mmap[i]; | 992 | struct mmap *md = &evlist->mmap[i]; |
993 | 993 | ||
994 | if (md->cpu == cpu) | 994 | if (md->cpu == cpu) |
995 | return md; | 995 | return md; |
@@ -1005,7 +1005,7 @@ static PyObject *pyrf_evlist__read_on_cpu(struct pyrf_evlist *pevlist, | |||
1005 | union perf_event *event; | 1005 | union perf_event *event; |
1006 | int sample_id_all = 1, cpu; | 1006 | int sample_id_all = 1, cpu; |
1007 | static char *kwlist[] = { "cpu", "sample_id_all", NULL }; | 1007 | static char *kwlist[] = { "cpu", "sample_id_all", NULL }; |
1008 | struct perf_mmap *md; | 1008 | struct mmap *md; |
1009 | int err; | 1009 | int err; |
1010 | 1010 | ||
1011 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist, | 1011 | if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i|i", kwlist, |