2023-03-15 05:20:31

by Paran Lee

[permalink] [raw]
Subject: [PATCH v2] perf tools riscv: Add support for riscv lookup_binutils_path

Add RISC-V binutils path on lookup triplets.

Signed-off-by: Paran Lee <[email protected]>
---
tools/perf/arch/common.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index 59dd875fd5e4..e80d4d22cabf 100644
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -43,6 +43,20 @@ const char *const powerpc_triplets[] = {
NULL
};

+const char *const riscv32_triplets[] = {
+ "riscv32-unknown-linux-gnu-",
+ "riscv32-linux-android-",
+ "riscv32-linux-gnu-",
+ NULL
+};
+
+const char *const riscv64_triplets[] = {
+ "riscv64-unknown-linux-gnu-",
+ "riscv64-linux-android-",
+ "riscv64-linux-gnu-",
+ NULL
+};
+
const char *const s390_triplets[] = {
"s390-ibm-linux-",
"s390x-linux-gnu-",
@@ -166,6 +180,10 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
path_list = arm64_triplets;
else if (!strcmp(arch, "powerpc"))
path_list = powerpc_triplets;
+ else if (!strcmp(arch, "riscv32"))
+ path_list = riscv32_triplets;
+ else if (!strcmp(arch, "riscv64"))
+ path_list = riscv64_triplets;
else if (!strcmp(arch, "sh"))
path_list = sh_triplets;
else if (!strcmp(arch, "s390"))
--
2.34.1



2023-03-16 00:12:26

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH v2] perf tools riscv: Add support for riscv lookup_binutils_path

On Tue, Mar 14, 2023 at 10:15 PM Paran Lee <[email protected]> wrote:
>
> Add RISC-V binutils path on lookup triplets.
>
> Signed-off-by: Paran Lee <[email protected]>

Acked-by: Ian Rogers <[email protected]>

Thanks,
Ian

> ---
> tools/perf/arch/common.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
> index 59dd875fd5e4..e80d4d22cabf 100644
> --- a/tools/perf/arch/common.c
> +++ b/tools/perf/arch/common.c
> @@ -43,6 +43,20 @@ const char *const powerpc_triplets[] = {
> NULL
> };
>
> +const char *const riscv32_triplets[] = {
> + "riscv32-unknown-linux-gnu-",
> + "riscv32-linux-android-",
> + "riscv32-linux-gnu-",
> + NULL
> +};
> +
> +const char *const riscv64_triplets[] = {
> + "riscv64-unknown-linux-gnu-",
> + "riscv64-linux-android-",
> + "riscv64-linux-gnu-",
> + NULL
> +};
> +
> const char *const s390_triplets[] = {
> "s390-ibm-linux-",
> "s390x-linux-gnu-",
> @@ -166,6 +180,10 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
> path_list = arm64_triplets;
> else if (!strcmp(arch, "powerpc"))
> path_list = powerpc_triplets;
> + else if (!strcmp(arch, "riscv32"))
> + path_list = riscv32_triplets;
> + else if (!strcmp(arch, "riscv64"))
> + path_list = riscv64_triplets;
> else if (!strcmp(arch, "sh"))
> path_list = sh_triplets;
> else if (!strcmp(arch, "s390"))
> --
> 2.34.1
>

2023-04-19 03:46:36

by Palmer Dabbelt

[permalink] [raw]
Subject: Re: [PATCH v2] perf tools riscv: Add support for riscv lookup_binutils_path

On Tue, 14 Mar 2023 22:15:01 PDT (-0700), [email protected] wrote:
> Add RISC-V binutils path on lookup triplets.
>
> Signed-off-by: Paran Lee <[email protected]>
> ---
> tools/perf/arch/common.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
> index 59dd875fd5e4..e80d4d22cabf 100644
> --- a/tools/perf/arch/common.c
> +++ b/tools/perf/arch/common.c
> @@ -43,6 +43,20 @@ const char *const powerpc_triplets[] = {
> NULL
> };
>
> +const char *const riscv32_triplets[] = {
> + "riscv32-unknown-linux-gnu-",
> + "riscv32-linux-android-",
> + "riscv32-linux-gnu-",
> + NULL
> +};
> +
> +const char *const riscv64_triplets[] = {
> + "riscv64-unknown-linux-gnu-",
> + "riscv64-linux-android-",
> + "riscv64-linux-gnu-",
> + NULL
> +};
> +
> const char *const s390_triplets[] = {
> "s390-ibm-linux-",
> "s390x-linux-gnu-",
> @@ -166,6 +180,10 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
> path_list = arm64_triplets;
> else if (!strcmp(arch, "powerpc"))
> path_list = powerpc_triplets;
> + else if (!strcmp(arch, "riscv32"))
> + path_list = riscv32_triplets;
> + else if (!strcmp(arch, "riscv64"))
> + path_list = riscv64_triplets;
> else if (!strcmp(arch, "sh"))
> path_list = sh_triplets;
> else if (!strcmp(arch, "s390"))

Reviewed-by: Palmer Dabbelt <[email protected]>
Acked-by: Palmer Dabbelt <[email protected]>

2023-04-29 01:59:52

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH v2] perf tools riscv: Add support for riscv lookup_binutils_path

Em Tue, Apr 18, 2023 at 08:41:21PM -0700, Palmer Dabbelt escreveu:
> On Tue, 14 Mar 2023 22:15:01 PDT (-0700), [email protected] wrote:
> > Add RISC-V binutils path on lookup triplets.
> >
> > Signed-off-by: Paran Lee <[email protected]>
> > ---
> > tools/perf/arch/common.c | 18 ++++++++++++++++++
> > 1 file changed, 18 insertions(+)
> >
> > diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
> > index 59dd875fd5e4..e80d4d22cabf 100644
> > --- a/tools/perf/arch/common.c
> > +++ b/tools/perf/arch/common.c
> > @@ -43,6 +43,20 @@ const char *const powerpc_triplets[] = {
> > NULL
> > };
> >
> > +const char *const riscv32_triplets[] = {
> > + "riscv32-unknown-linux-gnu-",
> > + "riscv32-linux-android-",
> > + "riscv32-linux-gnu-",
> > + NULL
> > +};
> > +
> > +const char *const riscv64_triplets[] = {
> > + "riscv64-unknown-linux-gnu-",
> > + "riscv64-linux-android-",
> > + "riscv64-linux-gnu-",
> > + NULL
> > +};
> > +
> > const char *const s390_triplets[] = {
> > "s390-ibm-linux-",
> > "s390x-linux-gnu-",
> > @@ -166,6 +180,10 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
> > path_list = arm64_triplets;
> > else if (!strcmp(arch, "powerpc"))
> > path_list = powerpc_triplets;
> > + else if (!strcmp(arch, "riscv32"))
> > + path_list = riscv32_triplets;
> > + else if (!strcmp(arch, "riscv64"))
> > + path_list = riscv64_triplets;
> > else if (!strcmp(arch, "sh"))
> > path_list = sh_triplets;
> > else if (!strcmp(arch, "s390"))
>
> Reviewed-by: Palmer Dabbelt <[email protected]>
> Acked-by: Palmer Dabbelt <[email protected]>

Thanks, applied.

- Arnaldo