perf test: Fixup aliases checking in the 'vmlinux matches kallsyms' test

There are cases where looking at just the next and prev entries is not
enough, like with:

  $ readelf -sW /usr/lib/debug/lib/modules/4.3.3-301.fc23.x86_64/vmlinux | grep ffffffff81065ec0
   4979: ffffffff81065ec0 53 FUNC  LOCAL  DEFAULT 1 try_to_free_pud_page
   4980: ffffffff81065ec0 53 FUNC  LOCAL  DEFAULT 1 try_to_free_pte_page
   4981: ffffffff81065ec0 53 FUNC  LOCAL  DEFAULT 1 try_to_free_pmd_page

So just search by name to see if the symbol is in kallsyms.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-jj1vlljg7ol4i713l60rt5ai@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 8acd3da0
...@@ -110,7 +110,6 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused) ...@@ -110,7 +110,6 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
*/ */
for (nd = rb_first(&vmlinux_map->dso->symbols[type]); nd; nd = rb_next(nd)) { for (nd = rb_first(&vmlinux_map->dso->symbols[type]); nd; nd = rb_next(nd)) {
struct symbol *pair, *first_pair; struct symbol *pair, *first_pair;
bool backwards = true;
sym = rb_entry(nd, struct symbol, rb_node); sym = rb_entry(nd, struct symbol, rb_node);
...@@ -151,27 +150,14 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused) ...@@ -151,27 +150,14 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused)
continue; continue;
} else { } else {
struct rb_node *nnd; pair = machine__find_kernel_symbol_by_name(&kallsyms, type, sym->name, NULL, NULL);
detour: if (pair) {
nnd = backwards ? rb_prev(&pair->rb_node) : if (UM(pair->start) == mem_start)
rb_next(&pair->rb_node);
if (nnd) {
struct symbol *next = rb_entry(nnd, struct symbol, rb_node);
if (UM(next->start) == mem_start) {
pair = next;
goto next_pair; goto next_pair;
}
}
if (backwards) { pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
backwards = false; mem_start, sym->name, pair->name);
pair = first_pair;
goto detour;
} }
pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n",
mem_start, sym->name, pair->name);
} }
} else } else
pr_debug("%#" PRIx64 ": %s not on kallsyms\n", pr_debug("%#" PRIx64 ": %s not on kallsyms\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment