aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2013-08-07 07:38:52 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-08-07 16:35:33 -0400
commit82e75d00adc5bde3cf98f11e937eed6127163969 (patch)
tree3a4b3f9fbc5befbd20031087a1dd31bfd6a63712 /tools/perf
parent8e0cf965f95edd41df11cca50b92b4cb6ea8d80a (diff)
perf tests: Adjust the vmlinux symtab matches kallsyms test again
The kallsyms maps now may map to kcore and the symbol values now may be file offsets. For comparison with vmlinux the virtual memory address is needed which is obtained by unmapping the symbol value. The "vmlinux symtab matches kallsyms" is adjusted accordingly. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1375875537-4509-9-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/tests/vmlinux-kallsyms.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index e2e14984c3a0..2bd13edcbc17 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -16,6 +16,8 @@ static int vmlinux_matches_kallsyms_filter(struct map *map __maybe_unused,
16 return 0; 16 return 0;
17} 17}
18 18
19#define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x))
20
19int test__vmlinux_matches_kallsyms(void) 21int test__vmlinux_matches_kallsyms(void)
20{ 22{
21 int err = -1; 23 int err = -1;
@@ -74,7 +76,7 @@ int test__vmlinux_matches_kallsyms(void)
74 goto out; 76 goto out;
75 } 77 }
76 78
77 ref_reloc_sym.addr = sym->start; 79 ref_reloc_sym.addr = UM(sym->start);
78 80
79 /* 81 /*
80 * Step 5: 82 * Step 5:
@@ -131,7 +133,7 @@ int test__vmlinux_matches_kallsyms(void)
131 mem_start, NULL, NULL); 133 mem_start, NULL, NULL);
132 pair = first_pair; 134 pair = first_pair;
133 135
134 if (pair && pair->start == mem_start) { 136 if (pair && UM(pair->start) == mem_start) {
135next_pair: 137next_pair:
136 if (strcmp(sym->name, pair->name) == 0) { 138 if (strcmp(sym->name, pair->name) == 0) {
137 /* 139 /*
@@ -143,11 +145,11 @@ next_pair:
143 * off the real size. More than that and we 145 * off the real size. More than that and we
144 * _really_ have a problem. 146 * _really_ have a problem.
145 */ 147 */
146 s64 skew = mem_end - pair->end; 148 s64 skew = mem_end - UM(pair->end);
147 if (llabs(skew) >= page_size) 149 if (llabs(skew) >= page_size)
148 pr_debug("%#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n", 150 pr_debug("%#" PRIx64 ": diff end addr for %s v: %#" PRIx64 " k: %#" PRIx64 "\n",
149 mem_start, sym->name, mem_end, 151 mem_start, sym->name, mem_end,
150 pair->end); 152 UM(pair->end));
151 153
152 /* 154 /*
153 * Do not count this as a failure, because we 155 * Do not count this as a failure, because we
@@ -165,7 +167,7 @@ detour:
165 if (nnd) { 167 if (nnd) {
166 struct symbol *next = rb_entry(nnd, struct symbol, rb_node); 168 struct symbol *next = rb_entry(nnd, struct symbol, rb_node);
167 169
168 if (next->start == mem_start) { 170 if (UM(next->start) == mem_start) {
169 pair = next; 171 pair = next;
170 goto next_pair; 172 goto next_pair;
171 } 173 }