Commit b6ad1976 authored by Mike Rapoport's avatar Mike Rapoport Committed by Linus Torvalds

userfaultfd: selftest: combine all cases into a single executable

Currently, selftest for userfaultfd is compiled three times: for
anonymous, shared and hugetlb memory.  Let's combine all the cases into
a single executable which will have a command line option for selection
of the test type.

Link: http://lkml.kernel.org/r/1490869741-5913-1-git-send-email-rppt@linux.vnet.ibm.comSigned-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Reviewed-by: default avatarMike Kravetz <mike.kravetz@oracle.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ac2e8e40
...@@ -15,21 +15,14 @@ TEST_GEN_FILES += on-fault-limit ...@@ -15,21 +15,14 @@ TEST_GEN_FILES += on-fault-limit
TEST_GEN_FILES += thuge-gen TEST_GEN_FILES += thuge-gen
TEST_GEN_FILES += transhuge-stress TEST_GEN_FILES += transhuge-stress
TEST_GEN_FILES += userfaultfd TEST_GEN_FILES += userfaultfd
TEST_GEN_FILES += userfaultfd_hugetlb
TEST_GEN_FILES += userfaultfd_shmem
TEST_GEN_FILES += mlock-random-test TEST_GEN_FILES += mlock-random-test
TEST_PROGS := run_vmtests TEST_PROGS := run_vmtests
include ../lib.mk include ../lib.mk
$(OUTPUT)/userfaultfd: LDLIBS += -lpthread ../../../../usr/include/linux/kernel.h $(OUTPUT)/userfaultfd: ../../../../usr/include/linux/kernel.h
$(OUTPUT)/userfaultfd: LDLIBS += -lpthread
$(OUTPUT)/userfaultfd_hugetlb: userfaultfd.c ../../../../usr/include/linux/kernel.h
$(CC) $(CFLAGS) -DHUGETLB_TEST -O2 -o $@ $< -lpthread
$(OUTPUT)/userfaultfd_shmem: userfaultfd.c ../../../../usr/include/linux/kernel.h
$(CC) $(CFLAGS) -DSHMEM_TEST -O2 -o $@ $< -lpthread
$(OUTPUT)/mlock-random-test: LDLIBS += -lcap $(OUTPUT)/mlock-random-test: LDLIBS += -lcap
......
...@@ -95,7 +95,7 @@ echo " hugetlb regression testing." ...@@ -95,7 +95,7 @@ echo " hugetlb regression testing."
echo "--------------------" echo "--------------------"
echo "running userfaultfd" echo "running userfaultfd"
echo "--------------------" echo "--------------------"
./userfaultfd 128 32 ./userfaultfd anon 128 32
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1 exitcode=1
...@@ -107,7 +107,7 @@ echo "----------------------------" ...@@ -107,7 +107,7 @@ echo "----------------------------"
echo "running userfaultfd_hugetlb" echo "running userfaultfd_hugetlb"
echo "----------------------------" echo "----------------------------"
# 258MB total huge pages == 128MB src and 128MB dst # 258MB total huge pages == 128MB src and 128MB dst
./userfaultfd_hugetlb 128 32 $mnt/ufd_test_file ./userfaultfd hugetlb 128 32 $mnt/ufd_test_file
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1 exitcode=1
...@@ -119,7 +119,7 @@ rm -f $mnt/ufd_test_file ...@@ -119,7 +119,7 @@ rm -f $mnt/ufd_test_file
echo "----------------------------" echo "----------------------------"
echo "running userfaultfd_shmem" echo "running userfaultfd_shmem"
echo "----------------------------" echo "----------------------------"
./userfaultfd_shmem 128 32 ./userfaultfd shmem 128 32
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "[FAIL]" echo "[FAIL]"
exitcode=1 exitcode=1
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment