diff options
author | Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> | 2018-12-04 12:51:18 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-12-17 12:59:42 -0500 |
commit | 6d99a79cb40da3eddafef844b7a679fe5162f224 (patch) | |
tree | 9a8ff146571c22ca340ca0a7ce4f94c7cb40fa79 | |
parent | 75c375c0ae7cc75cec6683ee2539937c60c3e4af (diff) |
perf annotate: Introduce basic support for ARC
Introduce basic 'perf annotate' support for ARC to be able to use
anotation via stdio interface.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: linux-snps-arc@lists.infradead.org
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Vineet Gupta <vineet.gupta1@synopsys.com>
Link: http://lkml.kernel.org/r/20181204175118.25232-1-Eugeniy.Paltsev@synopsys.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/arch/arc/annotate/instructions.c | 9 | ||||
-rw-r--r-- | tools/perf/arch/common.c | 11 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 5 |
3 files changed, 24 insertions, 1 deletions
diff --git a/tools/perf/arch/arc/annotate/instructions.c b/tools/perf/arch/arc/annotate/instructions.c new file mode 100644 index 000000000000..2f00e995c7e3 --- /dev/null +++ b/tools/perf/arch/arc/annotate/instructions.c | |||
@@ -0,0 +1,9 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | ||
2 | #include <linux/compiler.h> | ||
3 | |||
4 | static int arc__annotate_init(struct arch *arch, char *cpuid __maybe_unused) | ||
5 | { | ||
6 | arch->initialized = true; | ||
7 | arch->objdump.comment_char = ';'; | ||
8 | return 0; | ||
9 | } | ||
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c index 5f69fd0b745a..f3824ca7c20b 100644 --- a/tools/perf/arch/common.c +++ b/tools/perf/arch/common.c | |||
@@ -5,6 +5,13 @@ | |||
5 | #include "../util/util.h" | 5 | #include "../util/util.h" |
6 | #include "../util/debug.h" | 6 | #include "../util/debug.h" |
7 | 7 | ||
8 | const char *const arc_triplets[] = { | ||
9 | "arc-linux-", | ||
10 | "arc-snps-linux-uclibc-", | ||
11 | "arc-snps-linux-gnu-", | ||
12 | NULL | ||
13 | }; | ||
14 | |||
8 | const char *const arm_triplets[] = { | 15 | const char *const arm_triplets[] = { |
9 | "arm-eabi-", | 16 | "arm-eabi-", |
10 | "arm-linux-androideabi-", | 17 | "arm-linux-androideabi-", |
@@ -147,7 +154,9 @@ static int perf_env__lookup_binutils_path(struct perf_env *env, | |||
147 | zfree(&buf); | 154 | zfree(&buf); |
148 | } | 155 | } |
149 | 156 | ||
150 | if (!strcmp(arch, "arm")) | 157 | if (!strcmp(arch, "arc")) |
158 | path_list = arc_triplets; | ||
159 | else if (!strcmp(arch, "arm")) | ||
151 | path_list = arm_triplets; | 160 | path_list = arm_triplets; |
152 | else if (!strcmp(arch, "arm64")) | 161 | else if (!strcmp(arch, "arm64")) |
153 | path_list = arm64_triplets; | 162 | path_list = arm64_triplets; |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 51d291b0b81f..ac9805e0bc76 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -134,6 +134,7 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i | |||
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | #include "arch/arc/annotate/instructions.c" | ||
137 | #include "arch/arm/annotate/instructions.c" | 138 | #include "arch/arm/annotate/instructions.c" |
138 | #include "arch/arm64/annotate/instructions.c" | 139 | #include "arch/arm64/annotate/instructions.c" |
139 | #include "arch/x86/annotate/instructions.c" | 140 | #include "arch/x86/annotate/instructions.c" |
@@ -143,6 +144,10 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i | |||
143 | 144 | ||
144 | static struct arch architectures[] = { | 145 | static struct arch architectures[] = { |
145 | { | 146 | { |
147 | .name = "arc", | ||
148 | .init = arc__annotate_init, | ||
149 | }, | ||
150 | { | ||
146 | .name = "arm", | 151 | .name = "arm", |
147 | .init = arm__annotate_init, | 152 | .init = arm__annotate_init, |
148 | }, | 153 | }, |