Skip to content

Commit 6d99a79

Browse files
Eugeniy Paltsevacmel
authored andcommitted
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 <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Alexey Brodkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: [email protected] Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Vineet Gupta <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 75c375c commit 6d99a79

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
}

tools/perf/arch/common.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
#include "../util/util.h"
66
#include "../util/debug.h"
77

8+
const char *const arc_triplets[] = {
9+
"arc-linux-",
10+
"arc-snps-linux-uclibc-",
11+
"arc-snps-linux-gnu-",
12+
NULL
13+
};
14+
815
const char *const arm_triplets[] = {
916
"arm-eabi-",
1017
"arm-linux-androideabi-",
@@ -147,7 +154,9 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
147154
zfree(&buf);
148155
}
149156

150-
if (!strcmp(arch, "arm"))
157+
if (!strcmp(arch, "arc"))
158+
path_list = arc_triplets;
159+
else if (!strcmp(arch, "arm"))
151160
path_list = arm_triplets;
152161
else if (!strcmp(arch, "arm64"))
153162
path_list = arm64_triplets;

tools/perf/util/annotate.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i
134134
return 0;
135135
}
136136

137+
#include "arch/arc/annotate/instructions.c"
137138
#include "arch/arm/annotate/instructions.c"
138139
#include "arch/arm64/annotate/instructions.c"
139140
#include "arch/x86/annotate/instructions.c"
@@ -142,6 +143,10 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i
142143
#include "arch/sparc/annotate/instructions.c"
143144

144145
static struct arch architectures[] = {
146+
{
147+
.name = "arc",
148+
.init = arc__annotate_init,
149+
},
145150
{
146151
.name = "arm",
147152
.init = arm__annotate_init,

0 commit comments

Comments
 (0)