[PATCH 05/10] perf top: apply new mmap_read interfaces
From: kan . liang
Date: Tue Oct 10 2017 - 13:21:04 EST
From: Kan Liang <kan.liang@xxxxxxxxx>
no functional change
Signed-off-by: Kan Liang <kan.liang@xxxxxxxxx>
---
tools/perf/builtin-top.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 477a869..be9ffae 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -805,11 +805,17 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
struct perf_sample sample;
struct perf_evsel *evsel;
struct perf_session *session = top->session;
+ struct perf_mmap_read read;
union perf_event *event;
struct machine *machine;
int ret;
- while ((event = perf_evlist__mmap_read(top->evlist, idx)) != NULL) {
+ if (perf_evlist__mmap_read_init(top->evlist, idx, &read, false)) {
+ pr_err("Can't get mmap information\n");
+ return;
+ }
+
+ while ((event = perf_mmap__read_event(&read)) != NULL) {
ret = perf_evlist__parse_sample(top->evlist, event, &sample);
if (ret) {
pr_err("Can't parse sample, err = %d\n", ret);
@@ -866,6 +872,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx)
next_event:
perf_evlist__mmap_consume(top->evlist, idx);
}
+ perf_mmap__read_done(&read);
}
static void perf_top__mmap_read(struct perf_top *top)
--
2.5.5