Skip to content

Commit

Permalink
perf annotate: Introduce basic support for ARC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eugeniy Paltsev authored and acmel committed Dec 17, 2018
1 parent 75c375c commit 6d99a79
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tools/perf/arch/arc/annotate/instructions.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>

static int arc__annotate_init(struct arch *arch, char *cpuid __maybe_unused)
{
arch->initialized = true;
arch->objdump.comment_char = ';';
return 0;
}
11 changes: 10 additions & 1 deletion tools/perf/arch/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
#include "../util/util.h"
#include "../util/debug.h"

const char *const arc_triplets[] = {
"arc-linux-",
"arc-snps-linux-uclibc-",
"arc-snps-linux-gnu-",
NULL
};

const char *const arm_triplets[] = {
"arm-eabi-",
"arm-linux-androideabi-",
Expand Down Expand Up @@ -147,7 +154,9 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
zfree(&buf);
}

if (!strcmp(arch, "arm"))
if (!strcmp(arch, "arc"))
path_list = arc_triplets;
else if (!strcmp(arch, "arm"))
path_list = arm_triplets;
else if (!strcmp(arch, "arm64"))
path_list = arm64_triplets;
Expand Down
5 changes: 5 additions & 0 deletions tools/perf/util/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i
return 0;
}

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

static struct arch architectures[] = {
{
.name = "arc",
.init = arc__annotate_init,
},
{
.name = "arm",
.init = arm__annotate_init,
Expand Down

0 comments on commit 6d99a79

Please sign in to comment.