lkml.org 
[lkml]   [2018]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@intel.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

\
 
 \ /
  Last update: 2018-05-15 12:49    [W:0.205 / U:5.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site