[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1480086747-2393-4-git-send-email-acme@kernel.org>
Date: Fri, 25 Nov 2016 12:12:18 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Chris Riyder <chris.ryder@....com>,
David Ahern <dsahern@...il.com>, Jiri Olsa <jolsa@...nel.org>,
Kim Phillips <kim.phillips@....com>,
Markus Trippelsdorf <markus@...ppelsdorf.de>,
Masami Hiramatsu <mhiramat@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
"Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
Pawel Moll <pawel.moll@....com>,
Peter Zijlstra <peterz@...radead.org>,
Russell King <rmk+kernel@....linux.org.uk>,
Taeung Song <treeze.taeung@...il.com>,
Wang Nan <wangnan0@...wei.com>
Subject: [PATCH 03/12] perf annotate: Allow arches to have a init routine and a priv area
From: Arnaldo Carvalho de Melo <acme@...hat.com>
Arches like ARM will want to use regular expressions when deciding what
instructions to associate with what ins_ops, provide infrastructure for
that.
Reviewed-by: Ravi Bangoria <ravi.bangoria@...ux.vnet.ibm.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Chris Riyder <chris.ryder@....com>
Cc: David Ahern <dsahern@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Kim Phillips <kim.phillips@....com>
Cc: Markus Trippelsdorf <markus@...ppelsdorf.de>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
Cc: Pawel Moll <pawel.moll@....com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Russell King <rmk+kernel@....linux.org.uk>
Cc: Taeung Song <treeze.taeung@...il.com>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-7dmnk9el2ipu3nxog092k9z5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/annotate.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 026915a7dac8..1e96549650d7 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -39,6 +39,9 @@ struct arch {
size_t nr_instructions_allocated;
struct ins_ops *(*associate_instruction_ops)(struct arch *arch, const char *name);
bool sorted_instructions;
+ bool initialized;
+ void *priv;
+ int (*init)(struct arch *arch);
struct {
char comment_char;
char skip_functions_char;
@@ -1356,6 +1359,14 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na
if (arch == NULL)
return -ENOTSUP;
+ if (arch->init) {
+ err = arch->init(arch);
+ if (err) {
+ pr_err("%s: failed to initialize %s arch priv area\n", __func__, arch->name);
+ return err;
+ }
+ }
+
pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__,
symfs_filename, sym->name, map->unmap_ip(map, sym->start),
map->unmap_ip(map, sym->end));
--
2.7.4
Powered by blists - more mailing lists