diff options
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 15d6a6dd50c5..801e6962b0a6 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -506,6 +506,11 @@ void maps__insert(struct rb_root *maps, struct map *map) | |||
506 | rb_insert_color(&map->rb_node, maps); | 506 | rb_insert_color(&map->rb_node, maps); |
507 | } | 507 | } |
508 | 508 | ||
509 | void maps__remove(struct rb_root *self, struct map *map) | ||
510 | { | ||
511 | rb_erase(&map->rb_node, self); | ||
512 | } | ||
513 | |||
509 | struct map *maps__find(struct rb_root *maps, u64 ip) | 514 | struct map *maps__find(struct rb_root *maps, u64 ip) |
510 | { | 515 | { |
511 | struct rb_node **p = &maps->rb_node; | 516 | struct rb_node **p = &maps->rb_node; |
@@ -551,13 +556,6 @@ static void dsos__delete(struct list_head *self) | |||
551 | 556 | ||
552 | void machine__exit(struct machine *self) | 557 | void machine__exit(struct machine *self) |
553 | { | 558 | { |
554 | struct kmap *kmap = map__kmap(self->vmlinux_maps[MAP__FUNCTION]); | ||
555 | |||
556 | if (kmap->ref_reloc_sym) { | ||
557 | free((char *)kmap->ref_reloc_sym->name); | ||
558 | free(kmap->ref_reloc_sym); | ||
559 | } | ||
560 | |||
561 | map_groups__exit(&self->kmaps); | 559 | map_groups__exit(&self->kmaps); |
562 | dsos__delete(&self->user_dsos); | 560 | dsos__delete(&self->user_dsos); |
563 | dsos__delete(&self->kernel_dsos); | 561 | dsos__delete(&self->kernel_dsos); |
@@ -565,6 +563,12 @@ void machine__exit(struct machine *self) | |||
565 | self->root_dir = NULL; | 563 | self->root_dir = NULL; |
566 | } | 564 | } |
567 | 565 | ||
566 | void machine__delete(struct machine *self) | ||
567 | { | ||
568 | machine__exit(self); | ||
569 | free(self); | ||
570 | } | ||
571 | |||
568 | struct machine *machines__add(struct rb_root *self, pid_t pid, | 572 | struct machine *machines__add(struct rb_root *self, pid_t pid, |
569 | const char *root_dir) | 573 | const char *root_dir) |
570 | { | 574 | { |