diff options
author | Jiri Olsa <[email protected]> | 2018-02-15 13:26:31 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-02-16 14:25:57 -0300 |
commit | 05db6ff73d805ecc70947c9eee2ed9948d0be52b (patch) | |
tree | 15ade109d4dedcd4320a073a95d22a262d9d5725 | |
parent | 8c7f1bb37b29f140e08175132f3abb4d5ad229fc (diff) |
perf machine: Generalize machine__set_kernel_mmap()
So it could be called without event object, just with start and end
values. It will be used in following patch.
Signed-off-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/machine.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index b1f1961b13f4..292e70c774bd 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1262,15 +1262,15 @@ int machine__create_kernel_maps(struct machine *machine) return 0; } -static void machine__set_kernel_mmap_len(struct machine *machine, - union perf_event *event) +static void machine__set_kernel_mmap(struct machine *machine, + u64 start, u64 end) { int i; for (i = 0; i < MAP__NR_TYPES; i++) { - machine->vmlinux_maps[i]->start = event->mmap.start; - machine->vmlinux_maps[i]->end = (event->mmap.start + - event->mmap.len); + machine->vmlinux_maps[i]->start = start; + machine->vmlinux_maps[i]->end = end; + /* * Be a bit paranoid here, some perf.data file came with * a zero sized synthesized MMAP event for the kernel. @@ -1375,7 +1375,8 @@ static int machine__process_kernel_mmap_event(struct machine *machine, if (strstr(kernel->long_name, "vmlinux")) dso__set_short_name(kernel, "[kernel.vmlinux]", false); - machine__set_kernel_mmap_len(machine, event); + machine__set_kernel_mmap(machine, event->mmap.start, + event->mmap.start + event->mmap.len); /* * Avoid using a zero address (kptr_restrict) for the ref reloc |