summaryrefslogtreecommitdiff
path: root/tools/perf/util/symbol.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-04-25 23:01:46 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-04-26 19:47:13 +0300
commit5cf88a6325ad75efe4f01204086d216b5d7f1ea8 (patch)
tree0ab15d0db815f708d77fda5da2d7d79918511b06 /tools/perf/util/symbol.c
parentb0867f0c624ca48886ae5bbe0574dbc3eef8c694 (diff)
downloadlinux-5cf88a6325ad75efe4f01204086d216b5d7f1ea8.tar.xz
perf symbols: Shorten dso__(first|last)_symbol()
All users want MAP__FUNCTION, and this split is going away. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-sm72zwt1f03ma5uw78l6zze0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r--tools/perf/util/symbol.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 25701078beab..7aa32372f08c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -515,16 +515,26 @@ struct symbol *dso__find_symbol(struct dso *dso,
return dso->last_find_result[type].symbol;
}
-struct symbol *dso__first_symbol(struct dso *dso, enum map_type type)
+static struct symbol *__dso__first_symbol(struct dso *dso, enum map_type type)
{
return symbols__first(&dso->symbols[type]);
}
-struct symbol *dso__last_symbol(struct dso *dso, enum map_type type)
+struct symbol *dso__first_symbol(struct dso *dso)
+{
+ return __dso__first_symbol(dso, MAP__FUNCTION);
+}
+
+static struct symbol *__dso__last_symbol(struct dso *dso, enum map_type type)
{
return symbols__last(&dso->symbols[type]);
}
+struct symbol *dso__last_symbol(struct dso *dso)
+{
+ return __dso__last_symbol(dso, MAP__FUNCTION);
+}
+
struct symbol *dso__next_symbol(struct symbol *sym)
{
return symbols__next(sym);
@@ -1218,7 +1228,7 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
}
/* Find the kernel map using the first symbol */
- sym = dso__first_symbol(dso, map->type);
+ sym = __dso__first_symbol(dso, map->type);
list_for_each_entry(new_map, &md.maps, node) {
if (sym && sym->start >= new_map->start &&
sym->start < new_map->end) {