2018-12-04 17:52:32

by Eugeniy Paltsev

[permalink] [raw]
Subject: [PATCH] ARC: introduce basic 'perf annotate' 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]>
---
tools/perf/arch/arc/annotate/instructions.c | 9 +++++++++
tools/perf/arch/common.c | 11 ++++++++++-
tools/perf/util/annotate.c | 5 +++++
3 files changed, 24 insertions(+), 1 deletion(-)
create mode 100644 tools/perf/arch/arc/annotate/instructions.c

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 @@
+// 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;
+}
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index 82657c01a3b8..f7cb57c424d1 100644
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -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-",
@@ -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;
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 6936daf89ddd..66066fb4d644 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
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"
@@ -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,
--
2.14.5



2018-12-06 17:17:15

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] ARC: introduce basic 'perf annotate' support for ARC

Em Tue, Dec 04, 2018 at 08:51:18PM +0300, Eugeniy Paltsev escreveu:
> Introduce basic 'perf annotate' support for ARC to be able
> to use anotation via stdio interface.

Would be nice to show the output of a 'perf annotate --stdio2' for a
perf.data file recorded on ARC :-)

- Arnaldo

> Signed-off-by: Eugeniy Paltsev <[email protected]>
> ---
> tools/perf/arch/arc/annotate/instructions.c | 9 +++++++++
> tools/perf/arch/common.c | 11 ++++++++++-
> tools/perf/util/annotate.c | 5 +++++
> 3 files changed, 24 insertions(+), 1 deletion(-)
> create mode 100644 tools/perf/arch/arc/annotate/instructions.c
>
> 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 @@
> +// 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;
> +}
> diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
> index 82657c01a3b8..f7cb57c424d1 100644
> --- a/tools/perf/arch/common.c
> +++ b/tools/perf/arch/common.c
> @@ -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-",
> @@ -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;
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 6936daf89ddd..66066fb4d644 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
> 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"
> @@ -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,
> --
> 2.14.5

--

- Arnaldo

Subject: [tip:perf/core] perf annotate: Introduce basic support for ARC

Commit-ID: c6934c91ba76438e4d641209dff32cbfdcaff9a2
Gitweb: https://git.kernel.org/tip/c6934c91ba76438e4d641209dff32cbfdcaff9a2
Author: Eugeniy Paltsev <[email protected]>
AuthorDate: Tue, 4 Dec 2018 20:51:18 +0300
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 6 Dec 2018 16:43:27 -0300

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]>
---
tools/perf/arch/arc/annotate/instructions.c | 9 +++++++++
tools/perf/arch/common.c | 11 ++++++++++-
tools/perf/util/annotate.c | 5 +++++
3 files changed, 24 insertions(+), 1 deletion(-)

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 @@
+// 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;
+}
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 @@
#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-",
@@ -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;
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
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"
@@ -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,

Subject: [tip:perf/core] perf annotate: Introduce basic support for ARC

Commit-ID: 6d99a79cb40da3eddafef844b7a679fe5162f224
Gitweb: https://git.kernel.org/tip/6d99a79cb40da3eddafef844b7a679fe5162f224
Author: Eugeniy Paltsev <[email protected]>
AuthorDate: Tue, 4 Dec 2018 20:51:18 +0300
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 17 Dec 2018 14:59:42 -0300

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]>
---
tools/perf/arch/arc/annotate/instructions.c | 9 +++++++++
tools/perf/arch/common.c | 11 ++++++++++-
tools/perf/util/annotate.c | 5 +++++
3 files changed, 24 insertions(+), 1 deletion(-)

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 @@
+// 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;
+}
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 @@
#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-",
@@ -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;
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
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"
@@ -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,