aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-11-16 13:50:38 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-11-17 15:12:56 -0500
commit9c2fb451bda0aa60127e63e44993401818326e91 (patch)
treed29beae70e13e0e7a8339ae4136f930b323286ad /tools/perf/util/annotate.c
parent786c1b51844d858041166057c0c79e93c2015013 (diff)
perf annotate: Allow arches to specify functions to skip
This is to cope with an ARM specific kludge introduced in the original patch supporting ARM annotation, cfef25b8daf7 ("perf annotate: ARM support") that made functions with a '+' in its name to be skipped when processing call instructions. With this patchkit it should be possible to collect a perf.data file on a ARM machine and then annotate it on a x86 workstation and have those ARM kludges used. 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: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com> 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-2fi3sy7q3sssdi7m7cbe07gy@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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 1ba41a27214d..72769762ece9 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -35,6 +35,7 @@ struct arch {
35 const char *name; 35 const char *name;
36 struct { 36 struct {
37 char comment_char; 37 char comment_char;
38 char skip_functions_char;
38 } objdump; 39 } objdump;
39}; 40};
40 41
@@ -43,6 +44,7 @@ static struct arch architectures[] = {
43 .name = "arm", 44 .name = "arm",
44 .objdump = { 45 .objdump = {
45 .comment_char = ';', 46 .comment_char = ';',
47 .skip_functions_char = '+',
46 }, 48 },
47 }, 49 },
48 { 50 {
@@ -78,7 +80,7 @@ int ins__scnprintf(struct ins *ins, char *bf, size_t size,
78 return ins__raw_scnprintf(ins, bf, size, ops); 80 return ins__raw_scnprintf(ins, bf, size, ops);
79} 81}
80 82
81static int call__parse(struct arch *arch __maybe_unused, struct ins_operands *ops, struct map *map) 83static int call__parse(struct arch *arch, struct ins_operands *ops, struct map *map)
82{ 84{
83 char *endptr, *tok, *name; 85 char *endptr, *tok, *name;
84 86
@@ -90,10 +92,9 @@ static int call__parse(struct arch *arch __maybe_unused, struct ins_operands *op
90 92
91 name++; 93 name++;
92 94
93#ifdef __arm__ 95 if (arch->objdump.skip_functions_char &&
94 if (strchr(name, '+')) 96 strchr(name, arch->objdump.skip_functions_char))
95 return -1; 97 return -1;
96#endif
97 98
98 tok = strchr(name, '>'); 99 tok = strchr(name, '>');
99 if (tok == NULL) 100 if (tok == NULL)