summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorWang Nan <wangnan0@huawei.com>2016-07-14 11:34:39 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-07-15 23:27:48 +0300
commitb2cb615d8aaba520fe351ff456f6c7730828b3fe (patch)
treebd358790cbd9436c49315be0720528684dd44c38 /tools/perf/builtin-record.c
parenta1f72618346a4e7ce9cff6aec1a62737d5d08763 (diff)
downloadlinux-b2cb615d8aaba520fe351ff456f6c7730828b3fe.tar.xz
perf evlist: Introduce backward_mmap array for evlist
Add backward_mmap to evlist, free it together with normal mmap. Improve perf_evlist__pick_pc(), search backward_mmap if evlist->mmap is not available. This patch doesn't alloc this array. It will be allocated conditionally in the following commits. Signed-off-by: Wang Nan <wangnan0@huawei.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: He Kuang <hekuang@huawei.com> 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/1468485287-33422-8-git-send-email-wangnan0@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index d15517e849a3..dbcb22304398 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -509,7 +509,7 @@ static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evli
if (!evlist)
return 0;
- maps = evlist->mmap;
+ maps = backward ? evlist->backward_mmap : evlist->mmap;
if (!maps)
return 0;
@@ -696,8 +696,12 @@ perf_event__synth_time_conv(const struct perf_event_mmap_page *pc __maybe_unused
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;
+ if (evlist) {
+ if (evlist->mmap && evlist->mmap[0].base)
+ return evlist->mmap[0].base;
+ if (evlist->backward_mmap && evlist->backward_mmap[0].base)
+ return evlist->backward_mmap[0].base;
+ }
return NULL;
}