All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Kim Phillips <kim.phillips@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	kernel-team@lge.com
Subject: Re: [PATCH] perf tools: set kernel end address properly
Date: Thu, 19 Apr 2018 11:54:24 +0900	[thread overview]
Message-ID: <20180419025424.GC13370@sejong> (raw)
In-Reply-To: <20180418193759.b63912fe5e5b8a9023ec80a8@arm.com>

On Wed, Apr 18, 2018 at 07:37:59PM -0500, Kim Phillips wrote:
> diff --git a/tools/perf/arch/arm64/util/sym-handling.c b/tools/perf/arch/arm64/util/sym-handling.c
> index 0051b1ee8450..5c4a2e208bbc 100644
> --- a/tools/perf/arch/arm64/util/sym-handling.c
> +++ b/tools/perf/arch/arm64/util/sym-handling.c
> @@ -20,3 +20,16 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
>                ehdr.e_type == ET_DYN;
>  }
>  #endif
> +
> +const char *arch__normalize_symbol_name(const char *name)
> +{
> +       /* 
> +        * arm64 kernels compensating for a CPU erratum can put up a 
> +        * module_emit_adrp_veneer in place of a module_emit_plt_entry
> +        */
> +       if (name && strlen(name) >= 23 &&
> +           !strncmp(name, "module_emit_adrp_veneer", 23))
> +               return "module_emit_plt_entry";
> +
> +       return name;
> +}

I don't know it's always preferable or just for the test.  It it's the
latter it may be better to move it to the test code.


> diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
> index 1e5adb65632a..07064e76947d 100644
> --- a/tools/perf/tests/vmlinux-kallsyms.c
> +++ b/tools/perf/tests/vmlinux-kallsyms.c
> @@ -163,6 +163,29 @@ int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest
>  
>                                 continue;
>                         }
> +               } else if (pair) {
> +                       s64 skew = mem_start - UM(pair->start);
> +                       struct map *kmap = map_groups__find(&kallsyms.kmaps, type, mem_start);
> +                       struct map *vmap = map_groups__find(&vmlinux.kmaps, type, mem_start);
> +
> +                       /* 
> +                        * arm64 kernels compensating for a CPU erratum can put up a 
> +                        * module_emit_adrp_veneer in place of a module_emit_plt_entry
> +                        */
> +                       if (llabs(skew) < page_size)

It seems that we needs to check it's the ARM64 at least.  If it's a
rare case we might need to add more paranoid checks.

Thanks,
Namhyung


> +                       {
> +                               pr_debug("NO ERR FOR SKEW %ld: %#" PRIx64 ": diff start addr v: %s k: %#" PRIx64 " %s\n",
> +                                        skew, mem_start, sym->name, UM(pair->start), pair->name);
> +                               continue;
> +                       }
> +
> +                       pr_debug("ERR : %#" PRIx64 ": diff start addr v: %s k: %#" PRIx64 " %s\n",
> +                                mem_start, sym->name, UM(pair->start), pair->name);
> +
> +                       if (kmap && vmap) {
> +                               pr_debug("    : map v: %s k: %s\n",
> +                                        vmap->dso->short_name, kmap->dso->short_name);
> +                       }
>                 } else
>                         pr_debug("ERR : %#" PRIx64 ": %s not on kallsyms\n",
>                                  mem_start, sym->name);

  parent reply	other threads:[~2018-04-19  2:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16  4:22 [PATCH] perf tools: set kernel end address properly Namhyung Kim
2018-04-16  9:23 ` Jiri Olsa
2018-04-16 13:51   ` Arnaldo Carvalho de Melo
2018-04-16 16:07     ` Kim Phillips
2018-04-16 16:58       ` Arnaldo Carvalho de Melo
2018-04-16 17:24         ` Kim Phillips
2018-04-16 22:48           ` Kim Phillips
2018-04-17  2:27             ` Namhyung Kim
2018-04-19  0:37               ` Kim Phillips
2018-04-19  2:37                 ` Namhyung Kim
2018-04-19 23:20                   ` Kim Phillips
2018-04-19 23:59                     ` Namhyung Kim
2018-04-20 23:23                       ` Kim Phillips
2018-04-23 13:52                         ` Arnaldo Carvalho de Melo
2018-04-23 14:56                           ` Kim Phillips
2018-04-26  5:51                       ` [tip:perf/urgent] perf machine: Set main " tip-bot for Namhyung Kim
2018-04-19  2:54                 ` Namhyung Kim [this message]
2018-04-19 23:33                   ` [PATCH] perf tools: set " Kim Phillips
2018-04-20  0:11                     ` Namhyung Kim
2018-04-20  8:10                     ` Ard Biesheuvel
2018-04-23 21:43                       ` Kim Phillips
2018-04-24  6:13                         ` Ard Biesheuvel
2018-04-24 12:50                           ` Kim Phillips
2018-04-24 13:07                             ` Ard Biesheuvel
2018-04-24 15:13                               ` [PATCH] arm64/kernel: rename module_emit_adrp_veneer->module_emit_veneer_for_adrp Kim Phillips
2018-04-24 15:13                                 ` Kim Phillips
2018-04-24 15:15                                 ` Ard Biesheuvel
2018-04-24 15:15                                   ` Ard Biesheuvel
2018-04-24 15:39                                   ` [PATCH v2] " Kim Phillips
2018-04-24 15:39                                     ` Kim Phillips

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180419025424.GC13370@sejong \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kernel-team@lge.com \
    --cc=kim.phillips@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.