Commit 2868b251 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'linux-kselftest-4.12-rc1' of...

Merge tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest updates from Shuah Khan:
 "This update consists of:

   - important fixes for build failures and clean target related
     warnings to address regressions introduced in commit 88baa78d
     ("selftests: remove duplicated all and clean target")

   - several minor spelling fixes in and log messages and comment
     blocks.

   - Enabling configs for better test coverage in ftrace, vm, and
     cpufreq tests.

   - .gitignore changes"

* tag 'linux-kselftest-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (26 commits)
  selftests: x86: add missing executables to .gitignore
  selftests: watchdog: accept multiple params on command line
  selftests: create cpufreq kconfig fragments
  selftests: x86: override clean in lib.mk to fix warnings
  selftests: sync: override clean in lib.mk to fix warnings
  selftests: splice: override clean in lib.mk to fix warnings
  selftests: gpio: fix clean target to remove all generated files and dirs
  selftests: add gpio generated files to .gitignore
  selftests: powerpc: override clean in lib.mk to fix warnings
  selftests: gpio: override clean in lib.mk to fix warnings
  selftests: futex: override clean in lib.mk to fix warnings
  selftests: lib.mk: define CLEAN macro to allow Makefiles to override clean
  selftests: splice: fix clean target to not remove default_file_splice_read.sh
  selftests: gpio: add config fragment for gpio-mockup
  selftests: breakpoints: allow to cross-compile for aarch64/arm64
  selftests/Makefile: Add missed PHONY targets
  selftests/vm/run_vmtests: Fix wrong comment
  selftests/Makefile: Add missed closing `"` in comment
  selftests/vm/run_vmtests: Polish output text
  selftests/timers: fix spelling mistake: "Asynchronous"
  ...
parents 00d95933 945f8f5f
kselftest
gpiogpio-event-mon
gpiogpio-hammer
gpioinclude/
gpiolsgpio
......@@ -39,7 +39,7 @@ TARGETS += x86
TARGETS += zram
#Please keep the TARGETS list alphabetically sorted
# Run "make quicktest=1 run_tests" or
# "make quicktest=1 kselftest from top level Makefile
# "make quicktest=1 kselftest" from top level Makefile
TARGETS_HOTPLUG = cpu-hotplug
TARGETS_HOTPLUG += memory-hotplug
......@@ -133,4 +133,4 @@ clean:
make OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
done;
.PHONY: install
.PHONY: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean
......@@ -5,7 +5,7 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
ifeq ($(ARCH),x86)
TEST_GEN_PROGS := breakpoint_test
endif
ifeq ($(ARCH),aarch64)
ifneq (,$(filter $(ARCH),aarch64 arm64))
TEST_GEN_PROGS := breakpoint_test_arm64
endif
......
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_DEBUG_RT_MUTEXES=y
CONFIG_DEBUG_PI_LIST=y
CONFIG_DEBUG_SPINLOCK=y
CONFIG_DEBUG_MUTEXES=y
CONFIG_DEBUG_LOCK_ALLOC=y
CONFIG_PROVE_LOCKING=y
CONFIG_LOCKDEP=y
CONFIG_DEBUG_ATOMIC_SLEEP=y
......@@ -26,7 +26,7 @@ check_types() {
test $X2 = $X3
test 0x$X3 = $3
B4=`printf "%x" $4`
B4=`printf "%02x" $4`
B3=`echo -n $X3 | tail -c 3 | head -c 2`
test $B3 = $B4
}
......
......@@ -8,7 +8,7 @@ include ../lib.mk
all:
for DIR in $(SUBDIRS); do \
BUILD_TARGET=$$OUTPUT/$$DIR; \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
done
......@@ -22,7 +22,7 @@ override define INSTALL_RULE
install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
@for SUBDIR in $(SUBDIRS); do \
BUILD_TARGET=$$OUTPUT/$$SUBDIR; \
BUILD_TARGET=$(OUTPUT)/$$SUBDIR; \
mkdir $$BUILD_TARGET -p; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
done;
......@@ -32,9 +32,10 @@ override define EMIT_TESTS
echo "./run.sh"
endef
clean:
override define CLEAN
for DIR in $(SUBDIRS); do \
BUILD_TARGET=$$OUTPUT/$$DIR; \
BUILD_TARGET=$(OUTPUT)/$$DIR; \
mkdir $$BUILD_TARGET -p; \
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
done
endef
......@@ -2,13 +2,20 @@
TEST_PROGS := gpio-mockup.sh
TEST_FILES := gpio-mockup-sysfs.sh $(BINARIES)
BINARIES := gpio-mockup-chardev
EXTRA_PROGS := ../gpiogpio-event-mon ../gpiogpio-hammer ../gpiolsgpio
EXTRA_DIRS := ../gpioinclude/
EXTRA_OBJS := ../gpiogpio-event-mon-in.o ../gpiogpio-event-mon.o
EXTRA_OBJS += ../gpiogpio-hammer-in.o ../gpiogpio-utils.o ../gpiolsgpio-in.o
EXTRA_OBJS += ../gpiolsgpio.o
include ../lib.mk
all: $(BINARIES)
clean:
$(RM) $(BINARIES)
override define CLEAN
$(RM) $(BINARIES) $(EXTRA_PROGS) $(EXTRA_OBJS)
$(RM) -r $(EXTRA_DIRS)
endef
CFLAGS += -O2 -g -std=gnu99 -Wall -I../../../../usr/include/
LDLIBS += -lmount -I/usr/include/libmount
......
CONFIG_GPIOLIB=y
CONFIG_GPIO_MOCKUP=m
......@@ -51,8 +51,12 @@ endef
emit_tests:
$(EMIT_TESTS)
clean:
define CLEAN
$(RM) -r $(TEST_GEN_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(EXTRA_CLEAN)
endef
clean:
$(CLEAN)
$(OUTPUT)/%:%.c
$(LINK.c) $^ $(LDLIBS) -o $@
......
CONFIG_TEST_PRINTF=m
CONFIG_TEST_BITMAP=m
CONFIG_PRIME_NUMBERS=m
......@@ -60,12 +60,13 @@ override define EMIT_TESTS
done;
endef
clean:
override define CLEAN
@for TARGET in $(SUB_DIRS); do \
BUILD_TARGET=$(OUTPUT)/$$TARGET; \
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \
done;
rm -f tags
endef
tags:
find . -name '*.c' -o -name '*.h' | xargs ctags
......
......@@ -4,5 +4,4 @@ all: $(TEST_PROGS) $(EXTRA)
include ../lib.mk
clean:
rm -fr $(TEST_PROGS) $(EXTRA)
EXTRA_CLEAN := $(EXTRA)
......@@ -20,5 +20,4 @@ TESTS += sync_stress_merge.o
sync_test: $(OBJS) $(TESTS)
clean:
$(RM) sync_test $(OBJS) $(TESTS)
EXTRA_CLEAN := sync_test $(OBJS) $(TESTS)
......@@ -159,7 +159,7 @@ int main(int argv, char **argc)
}
printf("Running Asyncrhonous Switching Tests...\n");
printf("Running Asynchronous Switching Tests...\n");
pid = fork();
if (!pid)
return run_tests(60);
......
CONFIG_SYSVIPC=y
CONFIG_USERFAULTFD=y
......@@ -62,7 +62,7 @@ int main(void)
void *addr;
int ret;
addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, 0, 0);
addr = mmap(ADDR, LENGTH, PROTECTION, FLAGS, -1, 0);
if (addr == MAP_FAILED) {
perror("mmap");
exit(1);
......
......@@ -293,7 +293,7 @@ static int test_mlock_lock()
unsigned long page_size = getpagesize();
map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("test_mlock_locked mmap");
goto out;
......@@ -402,7 +402,7 @@ static int test_mlock_onfault()
unsigned long page_size = getpagesize();
map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("test_mlock_locked mmap");
goto out;
......@@ -445,7 +445,7 @@ static int test_lock_onfault_of_present()
uint64_t page1_flags, page2_flags;
map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("test_mlock_locked mmap");
goto out;
......@@ -492,7 +492,7 @@ static int test_munlockall()
unsigned long page_size = getpagesize();
map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("test_munlockall mmap");
......@@ -518,7 +518,7 @@ static int test_munlockall()
munmap(map, 2 * page_size);
map = mmap(NULL, 2 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("test_munlockall second mmap");
......@@ -573,7 +573,7 @@ static int test_vma_management(bool call_mlock)
struct vm_boundaries page3;
map = mmap(NULL, 3 * page_size, PROT_READ | PROT_WRITE,
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
if (map == MAP_FAILED) {
perror("mmap()");
return ret;
......
......@@ -26,7 +26,7 @@ static int test_limit(void)
}
map = mmap(NULL, 2 * lims.rlim_max, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, 0, 0);
MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);
if (map != MAP_FAILED)
printf("mmap should have failed, but didn't\n");
else {
......
......@@ -49,9 +49,9 @@ fi
mkdir $mnt
mount -t hugetlbfs none $mnt
echo "--------------------"
echo "---------------------"
echo "running hugepage-mmap"
echo "--------------------"
echo "---------------------"
./hugepage-mmap
if [ $? -ne 0 ]; then
echo "[FAIL]"
......@@ -77,9 +77,9 @@ fi
echo $shmmax > /proc/sys/kernel/shmmax
echo $shmall > /proc/sys/kernel/shmall
echo "--------------------"
echo "-------------------"
echo "running map_hugetlb"
echo "--------------------"
echo "-------------------"
./map_hugetlb
if [ $? -ne 0 ]; then
echo "[FAIL]"
......@@ -92,9 +92,9 @@ echo "NOTE: The above hugetlb tests provide minimal coverage. Use"
echo " https://github.com/libhugetlbfs/libhugetlbfs.git for"
echo " hugetlb regression testing."
echo "--------------------"
echo "-------------------"
echo "running userfaultfd"
echo "--------------------"
echo "-------------------"
./userfaultfd anon 128 32
if [ $? -ne 0 ]; then
echo "[FAIL]"
......@@ -103,10 +103,10 @@ else
echo "[PASS]"
fi
echo "----------------------------"
echo "---------------------------"
echo "running userfaultfd_hugetlb"
echo "----------------------------"
# 258MB total huge pages == 128MB src and 128MB dst
echo "---------------------------"
# 256MB total huge pages == 128MB src and 128MB dst
./userfaultfd hugetlb 128 32 $mnt/ufd_test_file
if [ $? -ne 0 ]; then
echo "[FAIL]"
......@@ -116,9 +116,9 @@ else
fi
rm -f $mnt/ufd_test_file
echo "----------------------------"
echo "-------------------------"
echo "running userfaultfd_shmem"
echo "----------------------------"
echo "-------------------------"
./userfaultfd shmem 128 32
if [ $? -ne 0 ]; then
echo "[FAIL]"
......@@ -143,9 +143,9 @@ else
echo "[PASS]"
fi
echo "--------------------"
echo "----------------------"
echo "running on-fault-limit"
echo "--------------------"
echo "----------------------"
sudo -u nobody ./on-fault-limit
if [ $? -ne 0 ]; then
echo "[FAIL]"
......
......@@ -146,7 +146,7 @@ void test_mmap(unsigned long size, unsigned flags)
before = read_free(size);
map = mmap(NULL, size*NUM_PAGES, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB|flags, 0, 0);
MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB|flags, -1, 0);
if (map == (char *)-1) err("mmap");
memset(map, 0xff, size*NUM_PAGES);
......
......@@ -24,9 +24,11 @@ const char v = 'V';
static void keep_alive(void)
{
int dummy;
int ret;
ret = ioctl(fd, WDIOC_KEEPALIVE, &dummy);
if (!ret)
printf(".");
ioctl(fd, WDIOC_KEEPALIVE, &dummy);
}
/*
......@@ -51,6 +53,7 @@ int main(int argc, char *argv[])
int flags;
unsigned int ping_rate = 1;
int ret;
int i;
setbuf(stdout, NULL);
......@@ -61,29 +64,33 @@ int main(int argc, char *argv[])
exit(-1);
}
if (argc > 1) {
if (!strncasecmp(argv[1], "-d", 2)) {
for (i = 1; i < argc; i++) {
if (!strncasecmp(argv[i], "-d", 2)) {
flags = WDIOS_DISABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
ret = ioctl(fd, WDIOC_SETOPTIONS, &flags);
if (!ret)
printf("Watchdog card disabled.\n");
goto end;
} else if (!strncasecmp(argv[1], "-e", 2)) {
} else if (!strncasecmp(argv[i], "-e", 2)) {
flags = WDIOS_ENABLECARD;
ioctl(fd, WDIOC_SETOPTIONS, &flags);
ret = ioctl(fd, WDIOC_SETOPTIONS, &flags);
if (!ret)
printf("Watchdog card enabled.\n");
goto end;
} else if (!strncasecmp(argv[1], "-t", 2) && argv[2]) {
flags = atoi(argv[2]);
ioctl(fd, WDIOC_SETTIMEOUT, &flags);
} else if (!strncasecmp(argv[i], "-t", 2) && argv[2]) {
flags = atoi(argv[i + 1]);
ret = ioctl(fd, WDIOC_SETTIMEOUT, &flags);
if (!ret)
printf("Watchdog timeout set to %u seconds.\n", flags);
goto end;
} else if (!strncasecmp(argv[1], "-p", 2) && argv[2]) {
ping_rate = strtoul(argv[2], NULL, 0);
i++;
} else if (!strncasecmp(argv[i], "-p", 2) && argv[2]) {
ping_rate = strtoul(argv[i + 1], NULL, 0);
printf("Watchdog ping rate set to %u seconds.\n", ping_rate);
i++;
} else {
printf("-d to disable, -e to enable, -t <n> to set " \
"the timeout,\n-p <n> to set the ping rate, and \n");
printf("-d to disable, -e to enable, -t <n> to set "
"the timeout,\n-p <n> to set the ping rate, and ");
printf("run by itself to tick the card.\n");
printf("Parameters are parsed left-to-right in real-time.\n");
printf("Example: %s -d -t 10 -p 5 -e\n", argv[0]);
goto end;
}
}
......
*_32
*_64
single_step_syscall
sysret_ss_attrs
syscall_nt
ptrace_syscall
test_mremap_vdso
check_initial_reg_state
sigreturn
ldt_gdt
iopl
mpx-mini-test
ioperm
protection_keys
test_vdso
......@@ -40,8 +40,7 @@ all_32: $(BINARIES_32)
all_64: $(BINARIES_64)
clean:
$(RM) $(BINARIES_32) $(BINARIES_64)
EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64)
$(BINARIES_32): $(OUTPUT)/%_32: %.c
$(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm
......
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