Skip to contentSkip to conversation

perf tools: fix building error for arm64.

PATCH Superseded Wang Nan 5 participants 8 messages Mar 17, 2015 – Mar 22, 2015 perf events

lore
Share & tools
lore

Wang Nan

author
#0 lore raw

PATCH v2 1/1 perf tools: fix building error for arm64.

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch replaces 'arm64' to 'aarch64' before 's/arm.*/arm/' to protect arm64 and replaces 'aarch64' back to 'arm64' after fixing 'arm.*'.

---
v1 -> v2: Replace tabs with spaces to make new line similay to other lines.

---
 tools/perf/config/Makefile.arch | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/config/Makefile.arch +3 -0
index e972057..a5b6020 100644
@@ -2,8 +2,11 @@ ifndef ARCH
 ARCH := $(shell uname -m 2>/dev/null || echo not)
 endif
 
+# Set arm64 to aarch64 before replacing arm.* to arm to protect ARCH = arm64.
+# aarch64 will be replaced by arm64 again.
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
+                                  -e s/arm64/aarch64/ \
                                   -e s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
Signature · 1 line
1.8.3.4
#1 lore raw
Quoted 22 lines · Wang Nan

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch replaces 'arm64' to 'aarch64' before 's/arm.*/arm/' to protect arm64 and replaces 'aarch64' back to 'arm64' after fixing 'arm.*'.

---
v1 -> v2: Replace tabs with spaces to make new line similay to other lines.

---
 tools/perf/config/Makefile.arch | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/config/Makefile.arch +0 -0
index e972057..a5b6020 100644
@@ -2,8 +2,11 @@ ifndef ARCH
 ARCH := $(shell uname -m 2>/dev/null || echo not)

tools/perf/config/Makefile.arch ifndef ARCH · line 12

Quoted 10 lines
tools/perf/config/Makefile.arch +3 -0
 endif
 
+# Set arm64 to aarch64 before replacing arm.* to arm to protect ARCH = arm64.
+# aarch64 will be replaced by arm64 again.
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
+                                  -e s/arm64/aarch64/ \
                                   -e s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \

hum, could we rather make the 'arm.*' expression complete? like this one seems to work:

[jolsa@krava perf]$ echo armkrava | sed -e '/arm64/!s/arm.*/arm/' arm
[jolsa@krava perf]$ echo arm64 | sed -e '/arm64/!s/arm.*/arm/' arm64

jirka

author
#2 lore raw
Quoted 25 lines · Jiri Olsa
Quoted 24 lines · Wang Nan

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch replaces 'arm64' to 'aarch64' before 's/arm.*/arm/' to protect arm64 and replaces 'aarch64' back to 'arm64' after fixing 'arm.*'.

---
v1 -> v2: Replace tabs with spaces to make new line similay to other lines.

---
 tools/perf/config/Makefile.arch | 3 +++
 1 file changed, 3 insertions(+)
tools/perf/config/Makefile.arch +0 -0
index e972057..a5b6020 100644
@@ -2,8 +2,11 @@ ifndef ARCH
 ARCH := $(shell uname -m 2>/dev/null || echo not)
 endif
 
Quoted 12 lines

tools/perf/config/Makefile.arch ifndef ARCH · line 12

Quoted 8 lines
tools/perf/config/Makefile.arch +3 -0
+# Set arm64 to aarch64 before replacing arm.* to arm to protect ARCH = arm64.
+# aarch64 will be replaced by arm64 again.
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
+                                  -e s/arm64/aarch64/ \
                                   -e s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \

hum, could we rather make the 'arm.*' expression complete? like this one seems to work:

Sure. It does work. Posted a v3 patch.

Quoted 8 lines

[jolsa@krava perf]$ echo armkrava | sed -e '/arm64/!s/arm.*/arm/' arm
[jolsa@krava perf]$ echo arm64 | sed -e '/arm64/!s/arm.*/arm/' arm64

jirka

author
#3 lore raw

PATCH v3 1/1 perf tools: fix building error for arm64.

In reply to Jiri Olsa

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch prevent 'arm64' to be mached for 'arm.*' case.

---
v2 -> v3:
Make the 'arm.*' expression complete according to Jiri Olsa's suggestion.

---
 tools/perf/config/Makefile.arch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/config/Makefile.arch +1 -1
index e972057..e11fbd6 100644
@@ -4,7 +4,7 @@ endif
 
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                                  -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
Signature · 1 line
1.8.3.4
maintainer Acked-by on v3 1/1
#4 lore raw
Quoted 8 lines · Wang Nan

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch prevent 'arm64' to be mached for 'arm.*' case.

Thanks,
Namhyung

Quoted 28 lines

---
v2 -> v3:
Make the 'arm.*' expression complete according to Jiri Olsa's suggestion.

---
 tools/perf/config/Makefile.arch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/config/Makefile.arch +1 -1
index e972057..e11fbd6 100644
@@ -4,7 +4,7 @@ endif
 
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                                  -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
Signature · 7 lines
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
author
#5 lore raw

Hi Ingo,

Could you please pick this patch for -tip tree? It fixes a bug which makes arm64 -tip building failure.

Thank you.

Quoted 44 lines · Namhyung Kim
Quoted 8 lines · Wang Nan

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch prevent 'arm64' to be mached for 'arm.*' case.

Thanks,
Namhyung

Quoted 28 lines

---
v2 -> v3:
Make the 'arm.*' expression complete according to Jiri Olsa's suggestion.

---
 tools/perf/config/Makefile.arch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/config/Makefile.arch +1 -1
index e972057..e11fbd6 100644
@@ -4,7 +4,7 @@ endif
 
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                                  -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
Signature · 7 lines
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#6 lore raw

Em Thu, Mar 19, 2015 at 02:23:16PM +0800, Wang Nan escreveu:

Quoted 4 lines

Hi Ingo,

Could you please pick this patch for -tip tree? It fixes a bug which makes arm64 -tip building failure.

It is already in my tree, will go to tip soon.

- Arnaldo

Quoted 48 lines

Thank you.

Quoted 44 lines · Namhyung Kim
Quoted 8 lines · Wang Nan

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch prevent 'arm64' to be mached for 'arm.*' case.

Thanks,
Namhyung

Quoted 28 lines

---
v2 -> v3:
Make the 'arm.*' expression complete according to Jiri Olsa's suggestion.

---
 tools/perf/config/Makefile.arch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/config/Makefile.arch +1 -1
index e972057..e11fbd6 100644
@@ -4,7 +4,7 @@ endif
 
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                                  -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
Signature · 7 lines
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#7 lore raw

[tip:perf/core] perf tools: Fix building error for arm64.

In reply to Wang Nan
perf tools: Fix building error for arm64.
Commit-ID:  235504dec113089856b39c65afb77a2f444aa2a9
Gitweb:     http://git.kernel.org/tip/235504dec113089856b39c65afb77a2f444aa2a9
Author:     Wang Nan <[email protected]>
AuthorDate: Tue, 17 Mar 2015 13:29:47 +0000
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 18 Mar 2015 09:58:56 -0300

perf tools: Fix building error for arm64.

Commit b11db6581beaccef8ae9a388ae96074aa5cc144f ("perf tools: Fix build error on ARCH=i386/x86_64/sparc64") uses sed on ARCH, which triggers a bug in sequence of sed expression, where 's/arm.*/arm/' will replace 'arm64' to 'arm', causes arm64 building failure.

This patch prevent 'arm64' to be mached for 'arm.*' case.

---
 tools/perf/config/Makefile.arch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/config/Makefile.arch +1 -1
index e972057..e11fbd6 100644
@@ -4,7 +4,7 @@ endif
 
 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
                                   -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-                                  -e s/arm.*/arm/ -e s/sa110/arm/ \
+                                  -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
                                   -e s/s390x/s390/ -e s/parisc64/parisc/ \
                                   -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                   -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \