diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 8aab89b2248e..687fb7f8cc03 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -43,7 +43,7 @@ static struct symbol_conf symbol_conf__defaults = { | |||
43 | .try_vmlinux_path = true, | 43 | .try_vmlinux_path = true, |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct rb_root kernel_maps; | 46 | static struct rb_root kernel_maps__functions; |
47 | 47 | ||
48 | static void symbols__fixup_end(struct rb_root *self) | 48 | static void symbols__fixup_end(struct rb_root *self) |
49 | { | 49 | { |
@@ -71,7 +71,7 @@ static void symbols__fixup_end(struct rb_root *self) | |||
71 | static void kernel_maps__fixup_end(void) | 71 | static void kernel_maps__fixup_end(void) |
72 | { | 72 | { |
73 | struct map *prev, *curr; | 73 | struct map *prev, *curr; |
74 | struct rb_node *nd, *prevnd = rb_first(&kernel_maps); | 74 | struct rb_node *nd, *prevnd = rb_first(&kernel_maps__functions); |
75 | 75 | ||
76 | if (prevnd == NULL) | 76 | if (prevnd == NULL) |
77 | return; | 77 | return; |
@@ -325,7 +325,7 @@ static int kernel_maps__load_all_kallsyms(void) | |||
325 | * kernel_maps__split_kallsyms, when we have split the | 325 | * kernel_maps__split_kallsyms, when we have split the |
326 | * maps per module | 326 | * maps per module |
327 | */ | 327 | */ |
328 | symbols__insert(&kernel_map->dso->functions, sym); | 328 | symbols__insert(&kernel_map__functions->dso->functions, sym); |
329 | } | 329 | } |
330 | 330 | ||
331 | free(line); | 331 | free(line); |
@@ -346,10 +346,10 @@ out_failure: | |||
346 | */ | 346 | */ |
347 | static int kernel_maps__split_kallsyms(symbol_filter_t filter) | 347 | static int kernel_maps__split_kallsyms(symbol_filter_t filter) |
348 | { | 348 | { |
349 | struct map *map = kernel_map; | 349 | struct map *map = kernel_map__functions; |
350 | struct symbol *pos; | 350 | struct symbol *pos; |
351 | int count = 0; | 351 | int count = 0; |
352 | struct rb_node *next = rb_first(&kernel_map->dso->functions); | 352 | struct rb_node *next = rb_first(&kernel_map__functions->dso->functions); |
353 | int kernel_range = 0; | 353 | int kernel_range = 0; |
354 | 354 | ||
355 | while (next) { | 355 | while (next) { |
@@ -376,7 +376,7 @@ static int kernel_maps__split_kallsyms(symbol_filter_t filter) | |||
376 | */ | 376 | */ |
377 | pos->start = map->map_ip(map, pos->start); | 377 | pos->start = map->map_ip(map, pos->start); |
378 | pos->end = map->map_ip(map, pos->end); | 378 | pos->end = map->map_ip(map, pos->end); |
379 | } else if (map != kernel_map) { | 379 | } else if (map != kernel_map__functions) { |
380 | char dso_name[PATH_MAX]; | 380 | char dso_name[PATH_MAX]; |
381 | struct dso *dso; | 381 | struct dso *dso; |
382 | 382 | ||
@@ -399,12 +399,12 @@ static int kernel_maps__split_kallsyms(symbol_filter_t filter) | |||
399 | } | 399 | } |
400 | 400 | ||
401 | if (filter && filter(map, pos)) { | 401 | if (filter && filter(map, pos)) { |
402 | rb_erase(&pos->rb_node, &kernel_map->dso->functions); | 402 | rb_erase(&pos->rb_node, &kernel_map__functions->dso->functions); |
403 | symbol__delete(pos); | 403 | symbol__delete(pos); |
404 | } else { | 404 | } else { |
405 | if (map != kernel_map) { | 405 | if (map != kernel_map__functions) { |
406 | rb_erase(&pos->rb_node, | 406 | rb_erase(&pos->rb_node, |
407 | &kernel_map->dso->functions); | 407 | &kernel_map__functions->dso->functions); |
408 | symbols__insert(&map->dso->functions, pos); | 408 | symbols__insert(&map->dso->functions, pos); |
409 | } | 409 | } |
410 | count++; | 410 | count++; |
@@ -420,8 +420,8 @@ static int kernel_maps__load_kallsyms(symbol_filter_t filter) | |||
420 | if (kernel_maps__load_all_kallsyms()) | 420 | if (kernel_maps__load_all_kallsyms()) |
421 | return -1; | 421 | return -1; |
422 | 422 | ||
423 | symbols__fixup_end(&kernel_map->dso->functions); | 423 | symbols__fixup_end(&kernel_map__functions->dso->functions); |
424 | kernel_map->dso->origin = DSO__ORIG_KERNEL; | 424 | kernel_map__functions->dso->origin = DSO__ORIG_KERNEL; |
425 | 425 | ||
426 | return kernel_maps__split_kallsyms(filter); | 426 | return kernel_maps__split_kallsyms(filter); |
427 | } | 427 | } |
@@ -431,7 +431,7 @@ size_t kernel_maps__fprintf(FILE *fp) | |||
431 | size_t printed = fprintf(fp, "Kernel maps:\n"); | 431 | size_t printed = fprintf(fp, "Kernel maps:\n"); |
432 | struct rb_node *nd; | 432 | struct rb_node *nd; |
433 | 433 | ||
434 | for (nd = rb_first(&kernel_maps); nd; nd = rb_next(nd)) { | 434 | for (nd = rb_first(&kernel_maps__functions); nd; nd = rb_next(nd)) { |
435 | struct map *pos = rb_entry(nd, struct map, rb_node); | 435 | struct map *pos = rb_entry(nd, struct map, rb_node); |
436 | 436 | ||
437 | printed += fprintf(fp, "Map:"); | 437 | printed += fprintf(fp, "Map:"); |
@@ -1159,17 +1159,17 @@ out: | |||
1159 | return ret; | 1159 | return ret; |
1160 | } | 1160 | } |
1161 | 1161 | ||
1162 | struct map *kernel_map; | 1162 | struct map *kernel_map__functions; |
1163 | 1163 | ||
1164 | static void kernel_maps__insert(struct map *map) | 1164 | static void kernel_maps__insert(struct map *map) |
1165 | { | 1165 | { |
1166 | maps__insert(&kernel_maps, map); | 1166 | maps__insert(&kernel_maps__functions, map); |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | struct symbol *kernel_maps__find_function(u64 ip, struct map **mapp, | 1169 | struct symbol *kernel_maps__find_function(u64 ip, struct map **mapp, |
1170 | symbol_filter_t filter) | 1170 | symbol_filter_t filter) |
1171 | { | 1171 | { |
1172 | struct map *map = maps__find(&kernel_maps, ip); | 1172 | struct map *map = maps__find(&kernel_maps__functions, ip); |
1173 | 1173 | ||
1174 | if (mapp) | 1174 | if (mapp) |
1175 | *mapp = map; | 1175 | *mapp = map; |
@@ -1178,7 +1178,7 @@ struct symbol *kernel_maps__find_function(u64 ip, struct map **mapp, | |||
1178 | ip = map->map_ip(map, ip); | 1178 | ip = map->map_ip(map, ip); |
1179 | return map__find_function(map, ip, filter); | 1179 | return map__find_function(map, ip, filter); |
1180 | } else | 1180 | } else |
1181 | WARN_ONCE(RB_EMPTY_ROOT(&kernel_maps), | 1181 | WARN_ONCE(RB_EMPTY_ROOT(&kernel_maps__functions), |
1182 | "Empty kernel_maps, was symbol__init() called?\n"); | 1182 | "Empty kernel_maps, was symbol__init() called?\n"); |
1183 | 1183 | ||
1184 | return NULL; | 1184 | return NULL; |
@@ -1188,7 +1188,7 @@ struct map *kernel_maps__find_by_dso_name(const char *name) | |||
1188 | { | 1188 | { |
1189 | struct rb_node *nd; | 1189 | struct rb_node *nd; |
1190 | 1190 | ||
1191 | for (nd = rb_first(&kernel_maps); nd; nd = rb_next(nd)) { | 1191 | for (nd = rb_first(&kernel_maps__functions); nd; nd = rb_next(nd)) { |
1192 | struct map *map = rb_entry(nd, struct map, rb_node); | 1192 | struct map *map = rb_entry(nd, struct map, rb_node); |
1193 | 1193 | ||
1194 | if (map->dso && strcmp(map->dso->name, name) == 0) | 1194 | if (map->dso && strcmp(map->dso->name, name) == 0) |
@@ -1505,11 +1505,11 @@ static int kernel_maps__create_kernel_map(const struct symbol_conf *conf) | |||
1505 | if (kernel == NULL) | 1505 | if (kernel == NULL) |
1506 | return -1; | 1506 | return -1; |
1507 | 1507 | ||
1508 | kernel_map = map__new2(0, kernel); | 1508 | kernel_map__functions = map__new2(0, kernel); |
1509 | if (kernel_map == NULL) | 1509 | if (kernel_map__functions == NULL) |
1510 | goto out_delete_kernel_dso; | 1510 | goto out_delete_kernel_dso; |
1511 | 1511 | ||
1512 | kernel_map->map_ip = kernel_map->unmap_ip = identity__map_ip; | 1512 | kernel_map__functions->map_ip = kernel_map__functions->unmap_ip = identity__map_ip; |
1513 | kernel->short_name = "[kernel]"; | 1513 | kernel->short_name = "[kernel]"; |
1514 | kernel->kernel = 1; | 1514 | kernel->kernel = 1; |
1515 | 1515 | ||
@@ -1522,15 +1522,15 @@ static int kernel_maps__create_kernel_map(const struct symbol_conf *conf) | |||
1522 | sizeof(kernel->build_id)) == 0) | 1522 | sizeof(kernel->build_id)) == 0) |
1523 | kernel->has_build_id = true; | 1523 | kernel->has_build_id = true; |
1524 | 1524 | ||
1525 | kernel_maps__insert(kernel_map); | 1525 | kernel_maps__insert(kernel_map__functions); |
1526 | dsos__add(kernel); | 1526 | dsos__add(kernel); |
1527 | dsos__add(vdso); | 1527 | dsos__add(vdso); |
1528 | 1528 | ||
1529 | return 0; | 1529 | return 0; |
1530 | 1530 | ||
1531 | out_delete_kernel_map: | 1531 | out_delete_kernel_map: |
1532 | map__delete(kernel_map); | 1532 | map__delete(kernel_map__functions); |
1533 | kernel_map = NULL; | 1533 | kernel_map__functions = NULL; |
1534 | out_delete_kernel_dso: | 1534 | out_delete_kernel_dso: |
1535 | dso__delete(kernel); | 1535 | dso__delete(kernel); |
1536 | return -1; | 1536 | return -1; |