• Lexi Shao's avatar
    perf symbols: Ignore $a/$d symbols for ARM modules · 1a86f4ba
    Lexi Shao authored
    On anARM machine, kernel symbols from modules can be resolved to $a
    instead of printing the actual symbol name. Ignore symbols starting with
    "$" when building kallsyms rbtree.
    
    A sample stacktrace is shown as follows:
    
      c0f2e39c schedule_hrtimeout+0x14 ([kernel.kallsyms])
      bf4a66d8 $a+0x78 ([test_module])
      c0a4f5f4 kthread+0x15c ([kernel.kallsyms])
      c0a001f8 ret_from_fork+0x14 ([kernel.kallsyms])
    
    On an ARM machine, $a/$d symbols are used by the compiler to mark the
    beginning of code/data part in code section. These symbols are filtered
    out when linking vmlinux(see scripts/kallsyms.c ignored_prefixes), but
    are left on modules. So there are $a symbols in /proc/kallsyms which
    share the same addresses with the actual module symbols and confuses
    perf when resolving symbols.
    
    After this patch, the module symbol name is printed:
    
      c0f2e39c schedule_hrtimeout+0x14 ([kernel.kallsyms])
      bf4a66d8 test_func+0x78 ([test_module])
      c0a4f5f4 kthread+0x15c ([kernel.kallsyms])
      c0a001f8 ret_from_fork+0x14 ([kernel.kallsyms])
    Reviewed-by: default avatarJames Clark <james.clark@arm.com>
    Signed-off-by: default avatarLexi Shao <shaolexi@huawei.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Andrii Nakryiko <andrii@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jessica Yu <jeyu@kernel.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: John Fastabend <john.fastabend@gmail.com>
    Cc: KP Singh <kpsingh@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Martin KaFai Lau <kafai@fb.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Nathan Chancellor <natechancellor@gmail.com>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: QiuXi <qiuxi1@huawei.com>
    Cc: Song Liu <songliubraving@fb.com>
    Cc: Wangbing <wangbing6@huawei.com>
    Cc: Xiaoming Ni <nixiaoming@huawei.com>
    Cc: Yonghong Song <yhs@fb.com>
    Cc: bpf@vger.kernel.org
    Cc: clang-built-linux@googlegroups.com
    Link: https://lore.kernel.org/r/20211029065038.39449-2-shaolexi@huawei.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    1a86f4ba
symbol.c 59.2 KB