From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Borislav Petkov <bp@suse.de>, David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Stephane Eranian <eranian@google.com>,
Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 03/16] perf maps: Introduce maps__find_symbol_by_name()
Date: Wed, 30 Sep 2015 18:54:58 -0300 [thread overview]
Message-ID: <1443650111-31140-4-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1443650111-31140-1-git-send-email-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
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@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-pvkar0jacqn92g148u9sqttt@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 b1c475d9b240..622c2c9a1e65 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 57829e89b78b..7309d64ce39e 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,
--
2.1.0
next prev parent reply other threads:[~2015-09-30 21:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-30 21:54 [GIT PULL 00/16] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-09-30 21:54 ` [PATCH 01/16] tools: Fix shadowed declaration in err.h Arnaldo Carvalho de Melo
2015-09-30 21:54 ` [PATCH 02/16] perf tools: Fix shadowed declaration in parse-events.c Arnaldo Carvalho de Melo
2015-09-30 21:54 ` Arnaldo Carvalho de Melo [this message]
2015-09-30 21:54 ` [PATCH 04/16] perf report: Amend documentation about max_stack and synthesized callchains Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 05/16] perf tools: Fix build break on powerpc due to sample_reg_masks Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 06/16] perf machine: Use machine__kernel_map() thoroughly Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 07/16] perf machine: Add method for common kernel_map(FUNCTION) operation Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 08/16] tools lib symbol: Rename kallsyms2elf_type to kallsyms2elf_binding Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 09/16] tools lib symbol: Introduce kallsyms2elf_type Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 10/16] perf probe: Fix to remove dot suffix from second or latter events Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 11/16] perf probe: Begin and end libdwfl report session correctly Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 12/16] perf probe: Show correct source lines of probes on kmodules Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 13/16] perf probe: Fix a segfault bug in debuginfo_cache Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 14/16] perf probe: Improve error message when %return is on inlined function Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 15/16] perf list: Remove blank lines, headers when piping output Arnaldo Carvalho de Melo
2015-09-30 21:55 ` [PATCH 16/16] perf tools: By default use the most precise "cycles" hw counter available Arnaldo Carvalho de Melo
2015-10-01 7:05 ` [GIT PULL 00/16] perf/core improvements and fixes Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443650111-31140-4-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=bp@suse.de \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).