From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753194AbeBFS30 (ORCPT ); Tue, 6 Feb 2018 13:29:26 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753228AbeBFS1s (ORCPT ); Tue, 6 Feb 2018 13:27:48 -0500 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Alexander Shishkin , Peter Zijlstra Subject: [PATCH 10/17] perf tools: Generalize machine__set_kernel_mmap function Date: Tue, 6 Feb 2018 19:18:06 +0100 Message-Id: <20180206181813.10943-11-jolsa@kernel.org> In-Reply-To: <20180206181813.10943-1-jolsa@kernel.org> References: <20180206181813.10943-1-jolsa@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org So it could be called without event object, just with start and end values. It will be used in following patch. Link: http://lkml.kernel.org/n/tip-u4hu7m5fmwwsscy6ki70hhq6@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/util/machine.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index f5c79110f0d1..7838fe56b0c9 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1260,15 +1260,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. @@ -1373,7 +1373,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 -- 2.13.6