2 #include <linux/compiler.h> 3 #include <linux/rbtree.h> 13 #define UM(x) kallsyms_map->unmap_ip(kallsyms_map, (x)) 20 struct map *kallsyms_map, *vmlinux_map, *
map;
21 struct machine kallsyms, vmlinux;
23 u64 mem_start, mem_end;
43 pr_debug(
"machine__create_kernel_maps ");
79 pr_debug(
"machine__create_kernel_maps ");
97 pr_debug(
"Couldn't find a vmlinux that matches the kernel running on this machine, skipping test\n");
111 struct symbol *pair, *first_pair;
119 mem_end = vmlinux_map->
unmap_ip(vmlinux_map, sym->
end);
124 if (pair &&
UM(pair->
start) == mem_start) {
136 s64 skew = mem_end -
UM(pair->
end);
138 pr_debug(
"WARN: %#" PRIx64
": diff end addr for %s v: %#" PRIx64
" k: %#" PRIx64
"\n",
139 mem_start, sym->
name, mem_end,
152 if (
UM(pair->
start) == mem_start)
155 pr_debug(
"WARN: %#" PRIx64
": diff name v: %s k: %s\n",
158 pr_debug(
"WARN: %#" PRIx64
": diff name v: %s k: %s\n",
159 mem_start, sym->
name, first_pair->
name);
165 pr_debug(
"ERR : %#" PRIx64
": %s not on kallsyms\n",
166 mem_start, sym->
name);
174 header_printed =
false;
191 if (!header_printed) {
192 pr_info(
"WARN: Maps only in vmlinux:\n");
193 header_printed =
true;
199 header_printed =
false;
205 mem_end = vmlinux_map->
unmap_ip(vmlinux_map, map->
end);
208 if (pair == NULL || pair->
priv)
211 if (pair->
start == mem_start) {
212 if (!header_printed) {
213 pr_info(
"WARN: Maps in vmlinux with a different name in kallsyms:\n");
214 header_printed =
true;
217 pr_info(
"WARN: %" PRIx64
"-%" PRIx64
" %" PRIx64
" %s in kallsyms as",
219 if (mem_end != pair->
end)
220 pr_info(
":\nWARN: *%" PRIx64
"-%" PRIx64
" %" PRIx64,
227 header_printed =
false;
233 if (!header_printed) {
234 pr_info(
"WARN: Maps only in kallsyms:\n");
235 header_printed =
true;
struct map * map_groups__find_by_name(struct map_groups *mg, const char *name)
int machine__create_kernel_maps(struct machine *machine)
#define map__for_each_symbol(map, pos, n)
void machine__exit(struct machine *machine)
int machine__init(struct machine *machine, const char *root_dir, pid_t pid)
int test__vmlinux_matches_kallsyms(struct test *test __maybe_unused, int subtest __maybe_unused)
static struct symbol * machine__find_kernel_symbol_by_name(struct machine *machine, const char *name, struct map **mapp)
static struct map * machine__kernel_map(struct machine *machine)
struct map * maps__first(struct maps *maps)
#define pr_debug(fmt,...)
size_t map__fprintf(struct map *map, FILE *fp)
struct map * map__next(struct map *map)
enum dso_kernel_type kernel
static struct map * map_groups__find(struct map_groups *mg, u64 addr)
int machine__load_vmlinux_path(struct machine *machine)
int machine__load_kallsyms(struct machine *machine, const char *filename)
static int sym(yyscan_t scanner, int type, int config)
static struct symbol * machine__find_kernel_symbol(struct machine *machine, u64 addr, struct map **mapp)
static struct maps * machine__kernel_maps(struct machine *machine)
u64(* unmap_ip)(struct map *, u64)
int arch__compare_symbol_names(const char *namea, const char *nameb)