Commit 7194850e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-next-5.11-rc1' of...

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

Pull Kselftest updates from Shuah Khan:

 - Much needed gpio test Makefile cleanup to various problems with test
   dependencies and build errors from Michael Ellerman

 - Enabling vDSO test on non x86 platforms from Vincenzo Frascino

 - Fix intel_pstate to replace deprecated ftime() usages with
   clock_gettime() from Tommi Rantala

 - cgroup test build fix on older releases from Sachin Sant

 - A couple of spelling mistake fixes

* tag 'linux-kselftest-next-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/cgroup: Fix build on older distros
  selftests/run_kselftest.sh: fix dry-run typo
  tool: selftests: fix spelling typo of 'writting'
  selftests/memfd: Fix implicit declaration warnings
  selftests: intel_pstate: ftime() is deprecated
  selftests/gpio: Add to CLEAN rule rather than overriding
  selftests/gpio: Fix build when source tree is read only
  selftests/gpio: Move include of lib.mk up
  selftests/gpio: Use TEST_GEN_PROGS_EXTENDED
  kselftest: Extend vdso correctness test to clock_gettime64
  kselftest: Move test_vdso to the vDSO test suite
  kselftest: Extend vDSO selftest to clock_getres
  kselftest: Extend vDSO selftest
  kselftest: Enable vDSO test on non x86 platforms
parents b80affe3 c2e46f6b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ endif
TARGETS += tmpfs
TARGETS += tpm2
TARGETS += user
TARGETS += vDSO
TARGETS += vm
TARGETS += x86
TARGETS += zram
+2 −2
Original line number Diff line number Diff line
@@ -337,13 +337,13 @@ pid_t clone_into_cgroup(int cgroup_fd)
#ifdef CLONE_ARGS_SIZE_VER2
	pid_t pid;

	struct clone_args args = {
	struct __clone_args args = {
		.flags = CLONE_INTO_CGROUP,
		.exit_signal = SIGCHLD,
		.cgroup = cgroup_fd,
	};

	pid = sys_clone3(&args, sizeof(struct clone_args));
	pid = sys_clone3(&args, sizeof(struct __clone_args));
	/*
	 * Verify that this is a genuine test failure:
	 * ENOSYS -> clone3() not available
+12 −13
Original line number Diff line number Diff line
@@ -11,22 +11,21 @@ LDLIBS += $(VAR_LDLIBS)

TEST_PROGS := gpio-mockup.sh
TEST_FILES := gpio-mockup-sysfs.sh
TEST_PROGS_EXTENDED := gpio-mockup-chardev
TEST_GEN_PROGS_EXTENDED := gpio-mockup-chardev

GPIODIR := $(realpath ../../../gpio)
GPIOOBJ := gpio-utils.o
KSFT_KHDR_INSTALL := 1
include ../lib.mk

all: $(TEST_PROGS_EXTENDED)
GPIODIR := $(realpath ../../../gpio)
GPIOOUT := $(OUTPUT)/tools-gpio/
GPIOOBJ := $(GPIOOUT)/gpio-utils.o

override define CLEAN
	$(RM) $(TEST_PROGS_EXTENDED)
	$(MAKE) -C $(GPIODIR) OUTPUT=$(GPIODIR)/ clean
endef
CLEAN += ; $(RM) -rf $(GPIOOUT)

KSFT_KHDR_INSTALL := 1
include ../lib.mk
$(TEST_GEN_PROGS_EXTENDED): $(GPIOOBJ)

$(TEST_PROGS_EXTENDED): $(GPIODIR)/$(GPIOOBJ)
$(GPIOOUT):
	mkdir -p $@

$(GPIODIR)/$(GPIOOBJ):
	$(MAKE) OUTPUT=$(GPIODIR)/ -C $(GPIODIR)
$(GPIOOBJ): $(GPIOOUT)
	$(MAKE) OUTPUT=$(GPIOOUT) -C $(GPIODIR)
+16 −6
Original line number Diff line number Diff line
@@ -10,8 +10,12 @@
#include <sched.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include "../kselftest.h"

#define MSEC_PER_SEC	1000L
#define NSEC_PER_MSEC	1000000L

void usage(char *name) {
	printf ("Usage: %s cpunum\n", name);
}
@@ -22,7 +26,7 @@ int main(int argc, char **argv) {
	long long tsc, old_tsc, new_tsc;
	long long aperf, old_aperf, new_aperf;
	long long mperf, old_mperf, new_mperf;
	struct timeb before, after;
	struct timespec before, after;
	long long int start, finish, total;
	cpu_set_t cpuset;

@@ -55,7 +59,10 @@ int main(int argc, char **argv) {
		return 1;
	}

	ftime(&before);
	if (clock_gettime(CLOCK_MONOTONIC, &before) < 0) {
		perror("clock_gettime");
		return 1;
	}
	pread(fd, &old_tsc,  sizeof(old_tsc), 0x10);
	pread(fd, &old_aperf,  sizeof(old_mperf), 0xe7);
	pread(fd, &old_mperf,  sizeof(old_aperf), 0xe8);
@@ -64,7 +71,10 @@ int main(int argc, char **argv) {
		sqrt(i);
	}

	ftime(&after);
	if (clock_gettime(CLOCK_MONOTONIC, &after) < 0) {
		perror("clock_gettime");
		return 1;
	}
	pread(fd, &new_tsc,  sizeof(new_tsc), 0x10);
	pread(fd, &new_aperf,  sizeof(new_mperf), 0xe7);
	pread(fd, &new_mperf,  sizeof(new_aperf), 0xe8);
@@ -73,11 +83,11 @@ int main(int argc, char **argv) {
	aperf = new_aperf-old_aperf;
	mperf = new_mperf-old_mperf;

	start = before.time*1000 + before.millitm;
	finish = after.time*1000 + after.millitm;
	start = before.tv_sec*MSEC_PER_SEC + before.tv_nsec/NSEC_PER_MSEC;
	finish = after.tv_sec*MSEC_PER_SEC + after.tv_nsec/NSEC_PER_MSEC;
	total = finish - start;

	printf("runTime: %4.2f\n", 1.0*total/1000);
	printf("runTime: %4.2f\n", 1.0*total/MSEC_PER_SEC);
	printf("freq: %7.0f\n", tsc / (1.0*aperf / (1.0 * mperf)) / total);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
#include <inttypes.h>
#include <limits.h>
#include <linux/falloc.h>
#include <linux/fcntl.h>
#include <fcntl.h>
#include <linux/memfd.h>
#include <sched.h>
#include <stdio.h>
Loading