Messages in this thread Patch in this message | | | From | kan.liang@intel ... | Subject | [PATCH 05/10] perf top: apply new mmap_read interfaces | Date | Tue, 10 Oct 2017 10:20:18 -0700 |
| |
From: Kan Liang <kan.liang@intel.com>
no functional change
Signed-off-by: Kan Liang <kan.liang@intel.com> --- 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
| |