diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-18 10:34:26 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-25 08:38:55 -0500 |
commit | 0781ea923445405a45464842e9ee0e30f76cb84b (patch) | |
tree | 84a038a97eafb571f1451120300745271c180327 /tools/perf/util/annotate.c | |
parent | 2a1ff812c40be982e4dd7a44159462fb25bebdf3 (diff) |
perf annotate: Allow arches to have a init routine and a priv area
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@linux.vnet.ibm.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Chris Riyder <chris.ryder@arm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kim Phillips <kim.phillips@arm.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-7dmnk9el2ipu3nxog092k9z5@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 11 |
1 files changed, 11 insertions, 0 deletions
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 { | |||
39 | size_t nr_instructions_allocated; | 39 | size_t nr_instructions_allocated; |
40 | struct ins_ops *(*associate_instruction_ops)(struct arch *arch, const char *name); | 40 | struct ins_ops *(*associate_instruction_ops)(struct arch *arch, const char *name); |
41 | bool sorted_instructions; | 41 | bool sorted_instructions; |
42 | bool initialized; | ||
43 | void *priv; | ||
44 | int (*init)(struct arch *arch); | ||
42 | struct { | 45 | struct { |
43 | char comment_char; | 46 | char comment_char; |
44 | char skip_functions_char; | 47 | char skip_functions_char; |
@@ -1356,6 +1359,14 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na | |||
1356 | if (arch == NULL) | 1359 | if (arch == NULL) |
1357 | return -ENOTSUP; | 1360 | return -ENOTSUP; |
1358 | 1361 | ||
1362 | if (arch->init) { | ||
1363 | err = arch->init(arch); | ||
1364 | if (err) { | ||
1365 | pr_err("%s: failed to initialize %s arch priv area\n", __func__, arch->name); | ||
1366 | return err; | ||
1367 | } | ||
1368 | } | ||
1369 | |||
1359 | pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__, | 1370 | pr_debug("%s: filename=%s, sym=%s, start=%#" PRIx64 ", end=%#" PRIx64 "\n", __func__, |
1360 | symfs_filename, sym->name, map->unmap_ip(map, sym->start), | 1371 | symfs_filename, sym->name, map->unmap_ip(map, sym->start), |
1361 | map->unmap_ip(map, sym->end)); | 1372 | map->unmap_ip(map, sym->end)); |