diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-25 16:04:47 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-01-26 09:52:52 -0500 |
commit | ab414dcda8fa307388c40a540b35e3c98a9da5ae (patch) | |
tree | 6c19f6dc18976afe47797c93c2251bda8c13b174 | |
parent | 8acd3da03c3f6e4e31472c5c73402b95a5d0f6cb (diff) |
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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/tests/vmlinux-kallsyms.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c index f0bfc9e8fd9f..630b0b409b97 100644 --- a/tools/perf/tests/vmlinux-kallsyms.c +++ b/tools/perf/tests/vmlinux-kallsyms.c | |||
@@ -110,7 +110,6 @@ int test__vmlinux_matches_kallsyms(int subtest __maybe_unused) | |||
110 | */ | 110 | */ |
111 | for (nd = rb_first(&vmlinux_map->dso->symbols[type]); nd; nd = rb_next(nd)) { | 111 | for (nd = rb_first(&vmlinux_map->dso->symbols[type]); nd; nd = rb_next(nd)) { |
112 | struct symbol *pair, *first_pair; | 112 | struct symbol *pair, *first_pair; |
113 | bool backwards = true; | ||
114 | 113 | ||
115 | sym = rb_entry(nd, struct symbol, rb_node); | 114 | sym = rb_entry(nd, struct symbol, rb_node); |
116 | 115 | ||
@@ -151,27 +150,14 @@ next_pair: | |||
151 | continue; | 150 | continue; |
152 | 151 | ||
153 | } else { | 152 | } else { |
154 | struct rb_node *nnd; | 153 | pair = machine__find_kernel_symbol_by_name(&kallsyms, type, sym->name, NULL, NULL); |
155 | detour: | 154 | if (pair) { |
156 | nnd = backwards ? rb_prev(&pair->rb_node) : | 155 | if (UM(pair->start) == mem_start) |
157 | rb_next(&pair->rb_node); | ||
158 | if (nnd) { | ||
159 | struct symbol *next = rb_entry(nnd, struct symbol, rb_node); | ||
160 | |||
161 | if (UM(next->start) == mem_start) { | ||
162 | pair = next; | ||
163 | goto next_pair; | 156 | goto next_pair; |
164 | } | ||
165 | } | ||
166 | 157 | ||
167 | if (backwards) { | 158 | pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n", |
168 | backwards = false; | 159 | mem_start, sym->name, pair->name); |
169 | pair = first_pair; | ||
170 | goto detour; | ||
171 | } | 160 | } |
172 | |||
173 | pr_debug("%#" PRIx64 ": diff name v: %s k: %s\n", | ||
174 | mem_start, sym->name, pair->name); | ||
175 | } | 161 | } |
176 | } else | 162 | } else |
177 | pr_debug("%#" PRIx64 ": %s not on kallsyms\n", | 163 | pr_debug("%#" PRIx64 ": %s not on kallsyms\n", |