Commit ee667f94 authored by Wang Nan's avatar Wang Nan Committed by Arnaldo Carvalho de Melo

perf record: Prepare picking perf_event_mmap_page from multiple evlists

Following commits introduce new evlists to record. This patch adjusts
record__pick_pc() and introduces perf_evlist__pick_pc() to read control
page from one specific evlist. record__pick_pc() will be improved to
search control page from multiple evlists.
Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nilay Vaish <nilayvaish@gmail.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1467023052-146749-4-git-send-email-wangnan0@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent cb21686b
...@@ -686,10 +686,21 @@ perf_event__synth_time_conv(const struct perf_event_mmap_page *pc __maybe_unused ...@@ -686,10 +686,21 @@ perf_event__synth_time_conv(const struct perf_event_mmap_page *pc __maybe_unused
return 0; return 0;
} }
static const struct perf_event_mmap_page *
perf_evlist__pick_pc(struct perf_evlist *evlist)
{
if (evlist && evlist->mmap && evlist->mmap[0].base)
return evlist->mmap[0].base;
return NULL;
}
static const struct perf_event_mmap_page *record__pick_pc(struct record *rec) static const struct perf_event_mmap_page *record__pick_pc(struct record *rec)
{ {
if (rec->evlist && rec->evlist->mmap && rec->evlist->mmap[0].base) const struct perf_event_mmap_page *pc;
return rec->evlist->mmap[0].base;
pc = perf_evlist__pick_pc(rec->evlist);
if (pc)
return pc;
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment