public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] perf tools riscv: Add support for riscv lookup_binutils_path
@ 2023-03-12 13:03 Paran Lee
  2023-03-12 13:40 ` Conor Dooley
  0 siblings, 1 reply; 2+ messages in thread
From: Paran Lee @ 2023-03-12 13:03 UTC (permalink / raw)
  To: Jiri Olsa, Namhyung Kim, Ian Rogers, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Arnaldo Carvalho de Melo
  Cc: Anton Blanchard, Daniel Axtens, Michael Ellerman,
	linux-perf-users, linux-kernel, linux-riscv, Paran Lee

Add to know RISC-V binutils path.

Signed-off-by: Paran Lee <p4ranlee@gmail.com>
---
 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..6ac7a22244c0 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-",
@@ -168,6 +182,10 @@ static int perf_env__lookup_binutils_path(struct perf_env *env,
 		path_list = powerpc_triplets;
 	else if (!strcmp(arch, "sh"))
 		path_list = sh_triplets;
+	else if (!strcmp(arch, "riscv32"))
+		path_list = riscv32_triplets;
+	else if (!strcmp(arch, "riscv64"))
+		path_list = riscv64_triplets;
 	else if (!strcmp(arch, "s390"))
 		path_list = s390_triplets;
 	else if (!strcmp(arch, "sparc"))
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH] perf tools riscv: Add support for riscv lookup_binutils_path
  2023-03-12 13:03 [RESEND PATCH] perf tools riscv: Add support for riscv lookup_binutils_path Paran Lee
@ 2023-03-12 13:40 ` Conor Dooley
  0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2023-03-12 13:40 UTC (permalink / raw)
  To: Paran Lee
  Cc: Jiri Olsa, Namhyung Kim, Ian Rogers, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Arnaldo Carvalho de Melo,
	Anton Blanchard, Daniel Axtens, Michael Ellerman,
	linux-perf-users, linux-kernel, linux-riscv

[-- Attachment #1: Type: text/plain, Size: 1814 bytes --]

On Sun, Mar 12, 2023 at 10:03:05PM +0900, Paran Lee wrote:
> Add to know RISC-V binutils path.
> 
> Signed-off-by: Paran Lee <p4ranlee@gmail.com>
> ---
>  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..6ac7a22244c0 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-",

I don't know anything about perf, so I could be asking a really silly
question here, but how come riscvN-linux- has been omitted here?
The kernel.org toolchains [1] are prefixed that way, although I noticed
in your v1 that you'd seemingly duplicated the arm64 patterns, so I am
curious as to whether the omission is intentional.

Cheers,
Conor.

[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-12 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-12 13:03 [RESEND PATCH] perf tools riscv: Add support for riscv lookup_binutils_path Paran Lee
2023-03-12 13:40 ` Conor Dooley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox