Skip to content

Commit

Permalink
perf map: Remove unused functions
Browse files Browse the repository at this point in the history
At some point those stopped being used, prune them.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-p2k98mj3ff2uk1z95sbl5r6e@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Nov 26, 2019
1 parent 805fcbc commit a82f15e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
30 changes: 8 additions & 22 deletions tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,12 @@ void map_groups__insert(struct map_groups *mg, struct map *map)
up_write(&maps->lock);
}

static void __maps__remove(struct maps *maps, struct map *map)
{
rb_erase_init(&map->rb_node, &maps->entries);
map__put(map);
}

void map_groups__remove(struct map_groups *mg, struct map *map)
{
struct maps *maps = &mg->maps;
Expand Down Expand Up @@ -654,8 +660,8 @@ static bool map__contains_symbol(struct map *map, struct symbol *sym)
return ip >= map->start && ip < map->end;
}

struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
struct map **mapp)
static struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
struct map **mapp)
{
struct symbol *sym;
struct map *pos;
Expand Down Expand Up @@ -890,26 +896,6 @@ static void __maps__insert(struct maps *maps, struct map *map)
map__get(map);
}

void maps__insert(struct maps *maps, struct map *map)
{
down_write(&maps->lock);
__maps__insert(maps, map);
up_write(&maps->lock);
}

void __maps__remove(struct maps *maps, struct map *map)
{
rb_erase_init(&map->rb_node, &maps->entries);
map__put(map);
}

void maps__remove(struct maps *maps, struct map *map)
{
down_write(&maps->lock);
__maps__remove(maps, map);
up_write(&maps->lock);
}

struct map *maps__find(struct maps *maps, u64 ip)
{
struct rb_node *p;
Expand Down
5 changes: 0 additions & 5 deletions tools/perf/util/map_groups.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ struct maps {
struct rw_semaphore lock;
};

void maps__insert(struct maps *maps, struct map *map);
void maps__remove(struct maps *maps, struct map *map);
void __maps__remove(struct maps *maps, struct map *map);
struct map *maps__find(struct maps *maps, u64 addr);
struct map *maps__first(struct maps *maps);
struct map *map__next(struct map *map);
Expand All @@ -32,8 +29,6 @@ struct map *map__next(struct map *map);
#define maps__for_each_entry_safe(maps, map, next) \
for (map = maps__first(maps), next = map__next(map); map; map = next, next = map__next(map))

struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name, struct map **mapp);

struct map_groups {
struct maps maps;
struct machine *machine;
Expand Down

0 comments on commit a82f15e

Please sign in to comment.