Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eugeniy Paltsev and committed by
Arnaldo Carvalho de Melo
6d99a79c 75c375c0

+24 -1
+9
tools/perf/arch/arc/annotate/instructions.c
··· 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 + }
+10 -1
tools/perf/arch/common.c
··· 5 5 #include "../util/util.h" 6 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 15 const char *const arm_triplets[] = { 9 16 "arm-eabi-", 10 17 "arm-linux-androideabi-", ··· 154 147 zfree(&buf); 155 148 } 156 149 157 - if (!strcmp(arch, "arm")) 150 + if (!strcmp(arch, "arc")) 151 + path_list = arc_triplets; 152 + else if (!strcmp(arch, "arm")) 158 153 path_list = arm_triplets; 159 154 else if (!strcmp(arch, "arm64")) 160 155 path_list = arm64_triplets;
+5
tools/perf/util/annotate.c
··· 134 134 return 0; 135 135 } 136 136 137 + #include "arch/arc/annotate/instructions.c" 137 138 #include "arch/arm/annotate/instructions.c" 138 139 #include "arch/arm64/annotate/instructions.c" 139 140 #include "arch/x86/annotate/instructions.c" ··· 143 142 #include "arch/sparc/annotate/instructions.c" 144 143 145 144 static struct arch architectures[] = { 145 + { 146 + .name = "arc", 147 + .init = arc__annotate_init, 148 + }, 146 149 { 147 150 .name = "arm", 148 151 .init = arm__annotate_init,