[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-pvkar0jacqn92g148u9sqttt@git.kernel.org>
Date: Thu, 1 Oct 2015 00:10:37 -0700
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: dsahern@...il.com, eranian@...gle.com, adrian.hunter@...el.com,
mingo@...nel.org, tglx@...utronix.de, fweisbec@...il.com,
namhyung@...nel.org, linux-kernel@...r.kernel.org, acme@...hat.com,
hpa@...or.com, jolsa@...hat.com, wangnan0@...wei.com, bp@...e.de
Subject: [tip:perf/core] perf maps: Introduce maps__find_symbol_by_name()
Commit-ID: b7f9ff5654d53fa47e0b5ff20f834f3e7a611846
Gitweb: http://git.kernel.org/tip/b7f9ff5654d53fa47e0b5ff20f834f3e7a611846
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Tue, 29 Sep 2015 17:34:46 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 30 Sep 2015 18:34:25 -0300
perf maps: Introduce maps__find_symbol_by_name()
Out of map_groups__find_symbol_by_name(), so that we can turn this later
one first into a call to maps__find_symbol_by_name(MAP__FUNCTION) +
MAP__VARIABLE, and then to just one call, we'll merge MAP__FUNCTION with
MAP__VARIABLE maps, to simplify the code.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-pvkar0jacqn92g148u9sqttt@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/map.c | 19 +++++++++++++------
tools/perf/util/map.h | 2 ++
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index b1c475d..622c2c9 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -553,13 +553,9 @@ struct symbol *map_groups__find_symbol(struct map_groups *mg,
return NULL;
}
-struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg,
- enum map_type type,
- const char *name,
- struct map **mapp,
- symbol_filter_t filter)
+struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
+ struct map **mapp, symbol_filter_t filter)
{
- struct maps *maps = &mg->maps[type];
struct symbol *sym;
struct rb_node *nd;
@@ -583,6 +579,17 @@ out:
return sym;
}
+struct symbol *map_groups__find_symbol_by_name(struct map_groups *mg,
+ enum map_type type,
+ const char *name,
+ struct map **mapp,
+ symbol_filter_t filter)
+{
+ struct symbol *sym = maps__find_symbol_by_name(&mg->maps[type], name, mapp, filter);
+
+ return sym;
+}
+
int map_groups__find_ams(struct addr_map_symbol *ams, symbol_filter_t filter)
{
if (ams->addr < ams->map->start || ams->addr >= ams->map->end) {
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 57829e8..7309d64 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -190,6 +190,8 @@ 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);
+struct symbol *maps__find_symbol_by_name(struct maps *maps, const char *name,
+ struct map **mapp, symbol_filter_t filter);
void map_groups__init(struct map_groups *mg, struct machine *machine);
void map_groups__exit(struct map_groups *mg);
int map_groups__clone(struct map_groups *mg,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists