vmlinux-kallsyms.c (41c177cf354126a22443b5c80cec9fdd313e67e1) | vmlinux-kallsyms.c (42fd623b58dbcc48310705bbf3e3d4d7c1deec29) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2#include <linux/compiler.h> 3#include <linux/rbtree.h> 4#include <inttypes.h> 5#include <string.h> 6#include <ctype.h> 7#include <stdlib.h> 8#include "dso.h" --- 137 unchanged lines hidden (view full) --- 146static int test__vmlinux_matches_kallsyms_cb2(struct map *map, void *data) 147{ 148 struct test__vmlinux_matches_kallsyms_cb_args *args = data; 149 struct map *pair; 150 u64 mem_start = map__unmap_ip(args->vmlinux_map, map__start(map)); 151 u64 mem_end = map__unmap_ip(args->vmlinux_map, map__end(map)); 152 153 pair = maps__find(args->kallsyms.kmaps, mem_start); | 1// SPDX-License-Identifier: GPL-2.0 2#include <linux/compiler.h> 3#include <linux/rbtree.h> 4#include <inttypes.h> 5#include <string.h> 6#include <ctype.h> 7#include <stdlib.h> 8#include "dso.h" --- 137 unchanged lines hidden (view full) --- 146static int test__vmlinux_matches_kallsyms_cb2(struct map *map, void *data) 147{ 148 struct test__vmlinux_matches_kallsyms_cb_args *args = data; 149 struct map *pair; 150 u64 mem_start = map__unmap_ip(args->vmlinux_map, map__start(map)); 151 u64 mem_end = map__unmap_ip(args->vmlinux_map, map__end(map)); 152 153 pair = maps__find(args->kallsyms.kmaps, mem_start); |
154 if (pair == NULL || map__priv(pair)) 155 return 0; | |
156 | 154 |
157 if (map__start(pair) == mem_start) { | 155 if (pair != NULL && !map__priv(pair) && map__start(pair) == mem_start) { |
158 struct dso *dso = map__dso(map); 159 160 if (!args->header_printed) { 161 pr_info("WARN: Maps in vmlinux with a different name in kallsyms:\n"); 162 args->header_printed = true; 163 } 164 165 pr_info("WARN: %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as", 166 map__start(map), map__end(map), map__pgoff(map), dso->name); 167 if (mem_end != map__end(pair)) 168 pr_info(":\nWARN: *%" PRIx64 "-%" PRIx64 " %" PRIx64, 169 map__start(pair), map__end(pair), map__pgoff(pair)); 170 pr_info(" %s\n", dso->name); 171 map__set_priv(pair, 1); 172 } | 156 struct dso *dso = map__dso(map); 157 158 if (!args->header_printed) { 159 pr_info("WARN: Maps in vmlinux with a different name in kallsyms:\n"); 160 args->header_printed = true; 161 } 162 163 pr_info("WARN: %" PRIx64 "-%" PRIx64 " %" PRIx64 " %s in kallsyms as", 164 map__start(map), map__end(map), map__pgoff(map), dso->name); 165 if (mem_end != map__end(pair)) 166 pr_info(":\nWARN: *%" PRIx64 "-%" PRIx64 " %" PRIx64, 167 map__start(pair), map__end(pair), map__pgoff(pair)); 168 pr_info(" %s\n", dso->name); 169 map__set_priv(pair, 1); 170 } |
171 map__put(pair); |
|
173 return 0; 174} 175 176static int test__vmlinux_matches_kallsyms_cb3(struct map *map, void *data) 177{ 178 struct test__vmlinux_matches_kallsyms_cb_args *args = data; 179 180 if (!map__priv(map)) { --- 203 unchanged lines hidden --- | 172 return 0; 173} 174 175static int test__vmlinux_matches_kallsyms_cb3(struct map *map, void *data) 176{ 177 struct test__vmlinux_matches_kallsyms_cb_args *args = data; 178 179 if (!map__priv(map)) { --- 203 unchanged lines hidden --- |