[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180515104900.GB7425@krava>
Date: Tue, 15 May 2018 12:49:00 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Adrian Hunter <adrian.hunter@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Andi Kleen <ak@...ux.intel.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Joerg Roedel <joro@...tes.org>, linux-kernel@...r.kernel.org,
x86@...nel.org
Subject: Re: [PATCH RFC 11/19] perf tools: Synthesize and process mmap events
for x86_64 KPTI entry trampolines
On Wed, May 09, 2018 at 02:43:40PM +0300, Adrian Hunter wrote:
> Like the kernel text, the location of x86_64 KPTI entry trampolines must be
> recorded in the perf.data file. Like the kernel, synthesize a mmap event
> for that, and add processing for it.
>
> Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> tools/perf/util/event.c | 90 +++++++++++++++++++++++++++++++++++++++++++++--
> tools/perf/util/machine.c | 28 +++++++++++++++
> 2 files changed, 115 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
> index aafa9878465f..d810ff8488b1 100644
> --- a/tools/perf/util/event.c
> +++ b/tools/perf/util/event.c
> @@ -888,9 +888,80 @@ int kallsyms__get_function_start(const char *kallsyms_filename,
> return 0;
> }
>
> -int perf_event__synthesize_kernel_mmap(struct perf_tool *tool,
> - perf_event__handler_t process,
> - struct machine *machine)
> +#if defined(__x86_64__)
also this could go under arch/x86/
jirka
> +
> +static int perf_event__synthesize_special_kmaps(struct perf_tool *tool,
> + perf_event__handler_t process,
> + struct machine *machine)
> +{
> + int rc = 0;
> + struct map *pos;
> + struct map_groups *kmaps = &machine->kmaps;
> + struct maps *maps = &kmaps->maps;
> + union perf_event *event = zalloc(sizeof(event->mmap) +
> + machine->id_hdr_size);
> +
> + if (!event) {
> + pr_debug("Not enough memory synthesizing mmap event "
> + "for special kernel maps\n");
> + return -1;
> + }
> +
SNIP
Powered by blists - more mailing lists