[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 10 Oct 2017 10:20:18 -0700
From: kan.liang@...el.com
To: acme@...nel.org, peterz@...radead.org, mingo@...hat.com,
linux-kernel@...r.kernel.org
Cc: jolsa@...nel.org, wangnan0@...wei.com, hekuang@...wei.com,
namhyung@...nel.org, alexander.shishkin@...ux.intel.com,
adrian.hunter@...el.com, ak@...ux.intel.com,
Kan Liang <kan.liang@...el.com>
Subject: [PATCH 05/10] perf top: apply new mmap_read interfaces
From: Kan Liang <kan.liang@...el.com>
no functional change
Signed-off-by: Kan Liang <kan.liang@...el.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
Powered by blists - more mailing lists