* [PATCH 1/2] selftests: keep consistency for uname -m usage
@ 2017-03-15 13:15 Fathi Boudra
2017-03-15 13:15 ` [PATCH 2/2] selftests: lib: add config fragment for bitmap, printf and prime numbers tests Fathi Boudra
2017-03-15 15:56 ` [PATCH 1/2] selftests: keep consistency for uname -m usage Shuah Khan
0 siblings, 2 replies; 4+ messages in thread
From: Fathi Boudra @ 2017-03-15 13:15 UTC (permalink / raw)
To: linux-kernel, Shuah Khan; +Cc: Fathi Boudra
powerpc selftests allow to override ARCH for cross-compilation by making
the first ARCH assignment weak.
Use the same approach in breakpoints, ipc and prctl tests to:
- keep uname usage consistent across selftests
- make it easier to cross-compile
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
---
tools/testing/selftests/breakpoints/Makefile | 4 ++--
tools/testing/selftests/ipc/Makefile | 4 ++--
tools/testing/selftests/powerpc/Makefile | 2 +-
tools/testing/selftests/prctl/Makefile | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index 72aa103e4141..9d5a1af4b5c9 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -1,6 +1,6 @@
# Taken from perf makefile
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
TEST_GEN_PROGS := breakpoint_test
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 30ef4c7f53ea..7e5a459842bb 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -1,5 +1,5 @@
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/)
ifeq ($(ARCH),i386)
ARCH := x86
CFLAGS := -DCONFIG_X86_32 -D__i386__
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 1c5d0575802e..731e015d170d 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -1,7 +1,7 @@
# Makefile for powerpc selftests
# ARCH can be overridden by the user for cross compiling
-ARCH ?= $(shell uname -m)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/)
ifeq ($(ARCH),powerpc)
diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile
index 35aa1c8f2df2..08aeb8721ce6 100644
--- a/tools/testing/selftests/prctl/Makefile
+++ b/tools/testing/selftests/prctl/Makefile
@@ -1,6 +1,6 @@
ifndef CROSS_COMPILE
-uname_M := $(shell uname -m 2>/dev/null || echo not)
-ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+ARCH ?= $(shell uname -m 2>/dev/null || echo not)
+ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] selftests: lib: add config fragment for bitmap, printf and prime numbers tests
2017-03-15 13:15 [PATCH 1/2] selftests: keep consistency for uname -m usage Fathi Boudra
@ 2017-03-15 13:15 ` Fathi Boudra
2017-03-15 15:56 ` [PATCH 1/2] selftests: keep consistency for uname -m usage Shuah Khan
1 sibling, 0 replies; 4+ messages in thread
From: Fathi Boudra @ 2017-03-15 13:15 UTC (permalink / raw)
To: linux-kernel, Shuah Khan; +Cc: Fathi Boudra
test_bitmap, test_printf and prime_numbers are expected to be built as modules.
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
---
tools/testing/selftests/lib/config | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 tools/testing/selftests/lib/config
diff --git a/tools/testing/selftests/lib/config b/tools/testing/selftests/lib/config
new file mode 100644
index 000000000000..7fe4d7c3c947
--- /dev/null
+++ b/tools/testing/selftests/lib/config
@@ -0,0 +1,3 @@
+CONFIG_PRIME_NUMBERS=m
+CONFIG_TEST_BITMAP=m
+CONFIG_TEST_PRINTF=m
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] selftests: keep consistency for uname -m usage
2017-03-15 13:15 [PATCH 1/2] selftests: keep consistency for uname -m usage Fathi Boudra
2017-03-15 13:15 ` [PATCH 2/2] selftests: lib: add config fragment for bitmap, printf and prime numbers tests Fathi Boudra
@ 2017-03-15 15:56 ` Shuah Khan
2017-03-17 12:48 ` Fathi Boudra
1 sibling, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2017-03-15 15:56 UTC (permalink / raw)
To: Fathi Boudra, linux-kernel, linux-kselftest
Hi Fathi,
On 03/15/2017 07:15 AM, Fathi Boudra wrote:
> powerpc selftests allow to override ARCH for cross-compilation by making
> the first ARCH assignment weak.
> Use the same approach in breakpoints, ipc and prctl tests to:
> - keep uname usage consistent across selftests
> - make it easier to cross-compile
How does it make it easier to cross-compile? Could you please
elaborate on what this patch is fixing?
Also I would like to see 3 separate patches one for each
of the tests?
thanks,
-- Shuah
>
> Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
> ---
> tools/testing/selftests/breakpoints/Makefile | 4 ++--
> tools/testing/selftests/ipc/Makefile | 4 ++--
> tools/testing/selftests/powerpc/Makefile | 2 +-
> tools/testing/selftests/prctl/Makefile | 4 ++--
> 4 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
> index 72aa103e4141..9d5a1af4b5c9 100644
> --- a/tools/testing/selftests/breakpoints/Makefile
> +++ b/tools/testing/selftests/breakpoints/Makefile
> @@ -1,6 +1,6 @@
> # Taken from perf makefile
> -uname_M := $(shell uname -m 2>/dev/null || echo not)
> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>
> ifeq ($(ARCH),x86)
> TEST_GEN_PROGS := breakpoint_test
> diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
> index 30ef4c7f53ea..7e5a459842bb 100644
> --- a/tools/testing/selftests/ipc/Makefile
> +++ b/tools/testing/selftests/ipc/Makefile
> @@ -1,5 +1,5 @@
> -uname_M := $(shell uname -m 2>/dev/null || echo not)
> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/)
> ifeq ($(ARCH),i386)
> ARCH := x86
> CFLAGS := -DCONFIG_X86_32 -D__i386__
> diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
> index 1c5d0575802e..731e015d170d 100644
> --- a/tools/testing/selftests/powerpc/Makefile
> +++ b/tools/testing/selftests/powerpc/Makefile
> @@ -1,7 +1,7 @@
> # Makefile for powerpc selftests
>
> # ARCH can be overridden by the user for cross compiling
> -ARCH ?= $(shell uname -m)
> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
> ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/)
>
> ifeq ($(ARCH),powerpc)
> diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile
> index 35aa1c8f2df2..08aeb8721ce6 100644
> --- a/tools/testing/selftests/prctl/Makefile
> +++ b/tools/testing/selftests/prctl/Makefile
> @@ -1,6 +1,6 @@
> ifndef CROSS_COMPILE
> -uname_M := $(shell uname -m 2>/dev/null || echo not)
> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>
> ifeq ($(ARCH),x86)
> TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] selftests: keep consistency for uname -m usage
2017-03-15 15:56 ` [PATCH 1/2] selftests: keep consistency for uname -m usage Shuah Khan
@ 2017-03-17 12:48 ` Fathi Boudra
0 siblings, 0 replies; 4+ messages in thread
From: Fathi Boudra @ 2017-03-17 12:48 UTC (permalink / raw)
To: Shuah Khan; +Cc: linux-kernel, linux-kselftest
On 15 March 2017 at 17:56, Shuah Khan <shuah@kernel.org> wrote:
> Hi Fathi,
>
> On 03/15/2017 07:15 AM, Fathi Boudra wrote:
>> powerpc selftests allow to override ARCH for cross-compilation by making
>> the first ARCH assignment weak.
>> Use the same approach in breakpoints, ipc and prctl tests to:
>> - keep uname usage consistent across selftests
>> - make it easier to cross-compile
>
> How does it make it easier to cross-compile? Could you please
> elaborate on what this patch is fixing?
Nevermind, ARCH was already a weak assignment. My patches changed the behavior.
I've been confused by the different approach used by powerpc vs
breakpoints/ipc/prctl tests.
> Also I would like to see 3 separate patches one for each
> of the tests?
Will you accept a patch to get rid on uname_M variable, keep ARCH
usage consistent across selftests?
In other words, align with the way it's done in powerpc test.
It won't fix any cross-compilation issues but improve consistency in the code.
> thanks,
> -- Shuah
>
>>
>> Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
>> ---
>> tools/testing/selftests/breakpoints/Makefile | 4 ++--
>> tools/testing/selftests/ipc/Makefile | 4 ++--
>> tools/testing/selftests/powerpc/Makefile | 2 +-
>> tools/testing/selftests/prctl/Makefile | 4 ++--
>> 4 files changed, 7 insertions(+), 7 deletions(-)
>>
>> diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
>> index 72aa103e4141..9d5a1af4b5c9 100644
>> --- a/tools/testing/selftests/breakpoints/Makefile
>> +++ b/tools/testing/selftests/breakpoints/Makefile
>> @@ -1,6 +1,6 @@
>> # Taken from perf makefile
>> -uname_M := $(shell uname -m 2>/dev/null || echo not)
>> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
>> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>
>
>
>>
>> ifeq ($(ARCH),x86)
>> TEST_GEN_PROGS := breakpoint_test
>> diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
>> index 30ef4c7f53ea..7e5a459842bb 100644
>> --- a/tools/testing/selftests/ipc/Makefile
>> +++ b/tools/testing/selftests/ipc/Makefile
>> @@ -1,5 +1,5 @@
>> -uname_M := $(shell uname -m 2>/dev/null || echo not)
>> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
>> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
>> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/)
>> ifeq ($(ARCH),i386)
>> ARCH := x86
>> CFLAGS := -DCONFIG_X86_32 -D__i386__
>> diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
>> index 1c5d0575802e..731e015d170d 100644
>> --- a/tools/testing/selftests/powerpc/Makefile
>> +++ b/tools/testing/selftests/powerpc/Makefile
>> @@ -1,7 +1,7 @@
>> # Makefile for powerpc selftests
>>
>> # ARCH can be overridden by the user for cross compiling
>> -ARCH ?= $(shell uname -m)
>> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
>> ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/)
>>
>> ifeq ($(ARCH),powerpc)
>> diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile
>> index 35aa1c8f2df2..08aeb8721ce6 100644
>> --- a/tools/testing/selftests/prctl/Makefile
>> +++ b/tools/testing/selftests/prctl/Makefile
>> @@ -1,6 +1,6 @@
>> ifndef CROSS_COMPILE
>> -uname_M := $(shell uname -m 2>/dev/null || echo not)
>> -ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>> +ARCH ?= $(shell uname -m 2>/dev/null || echo not)
>> +ARCH := $(shell echo $(ARCH) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>>
>> ifeq ($(ARCH),x86)
>> TEST_PROGS := disable-tsc-ctxt-sw-stress-test disable-tsc-on-off-stress-test \
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-03-17 12:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-15 13:15 [PATCH 1/2] selftests: keep consistency for uname -m usage Fathi Boudra
2017-03-15 13:15 ` [PATCH 2/2] selftests: lib: add config fragment for bitmap, printf and prime numbers tests Fathi Boudra
2017-03-15 15:56 ` [PATCH 1/2] selftests: keep consistency for uname -m usage Shuah Khan
2017-03-17 12:48 ` Fathi Boudra
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.