aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-27 13:29:13 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-27 14:21:57 -0500
commit61f37a824d6782503ff66bf653f2e07902b641a1 (patch)
treecebf0c583dab767cda63c6f55b1193fe278d99ea /tools
parent3f5ee186f615a720fe78eb33662ae4da57a1eee3 (diff)
perf symbols: Rename kernel_mapto kernel_map[s]__functions
As we'll have kernel_map[s]__variables too. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1259346563-12568-2-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-annotate.c2
-rw-r--r--tools/perf/util/symbol.c46
-rw-r--r--tools/perf/util/symbol.h2
3 files changed, 25 insertions, 25 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 18ac5eaefc36..377cb7c9bdda 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -184,7 +184,7 @@ got_map:
184 * trick of looking in the whole kernel symbol list. 184 * trick of looking in the whole kernel symbol list.
185 */ 185 */
186 if ((long long)ip < 0) { 186 if ((long long)ip < 0) {
187 map = kernel_map; 187 map = kernel_map__functions;
188 goto got_map; 188 goto got_map;
189 } 189 }
190 } 190 }
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
46static struct rb_root kernel_maps; 46static struct rb_root kernel_maps__functions;
47 47
48static void symbols__fixup_end(struct rb_root *self) 48static void symbols__fixup_end(struct rb_root *self)
49{ 49{
@@ -71,7 +71,7 @@ static void symbols__fixup_end(struct rb_root *self)
71static void kernel_maps__fixup_end(void) 71static 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 */
347static int kernel_maps__split_kallsyms(symbol_filter_t filter) 347static 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
1162struct map *kernel_map; 1162struct map *kernel_map__functions;
1163 1163
1164static void kernel_maps__insert(struct map *map) 1164static 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
1169struct symbol *kernel_maps__find_function(u64 ip, struct map **mapp, 1169struct 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
1531out_delete_kernel_map: 1531out_delete_kernel_map:
1532 map__delete(kernel_map); 1532 map__delete(kernel_map__functions);
1533 kernel_map = NULL; 1533 kernel_map__functions = NULL;
1534out_delete_kernel_dso: 1534out_delete_kernel_dso:
1535 dso__delete(kernel); 1535 dso__delete(kernel);
1536 return -1; 1536 return -1;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 65846d0c5df7..b42d196dd8e9 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -105,6 +105,6 @@ size_t kernel_maps__fprintf(FILE *fp);
105int symbol__init(struct symbol_conf *conf); 105int symbol__init(struct symbol_conf *conf);
106 106
107extern struct list_head dsos; 107extern struct list_head dsos;
108extern struct map *kernel_map; 108extern struct map *kernel_map__functions;
109extern struct dso *vdso; 109extern struct dso *vdso;
110#endif /* __PERF_SYMBOL */ 110#endif /* __PERF_SYMBOL */