Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull kselftest fixes from Shuah Khan:
"ftrace test fixes and a fix to kvm Makefile for relocatable
native/cross builds and installs"

* tag 'linux-kselftest-5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests: fix kvm relocatable native/cross builds and installs
selftests/ftrace: Make XFAIL green color
ftrace/selftest: make unresolved cases cause failure if --fail-unresolved set
ftrace/selftests: workaround cgroup RT scheduling issues

+58 -3
+30 -2
tools/testing/selftests/ftrace/ftracetest
··· 17 17 echo " -vv Alias of -v -v (Show all results in stdout)" 18 18 echo " -vvv Alias of -v -v -v (Show all commands immediately)" 19 19 echo " --fail-unsupported Treat UNSUPPORTED as a failure" 20 + echo " --fail-unresolved Treat UNRESOLVED as a failure" 20 21 echo " -d|--debug Debug mode (trace all shell commands)" 21 22 echo " -l|--logdir <dir> Save logs on the <dir>" 22 23 echo " If <dir> is -, all logs output in console only" ··· 30 29 # kselftest skip code is 4 31 30 err_skip=4 32 31 32 + # cgroup RT scheduling prevents chrt commands from succeeding, which 33 + # induces failures in test wakeup tests. Disable for the duration of 34 + # the tests. 35 + 36 + readonly sched_rt_runtime=/proc/sys/kernel/sched_rt_runtime_us 37 + 38 + sched_rt_runtime_orig=$(cat $sched_rt_runtime) 39 + 40 + setup() { 41 + echo -1 > $sched_rt_runtime 42 + } 43 + 44 + cleanup() { 45 + echo $sched_rt_runtime_orig > $sched_rt_runtime 46 + } 47 + 33 48 errexit() { # message 34 49 echo "Error: $1" 1>&2 50 + cleanup 35 51 exit $err_ret 36 52 } 37 53 ··· 56 38 if [ `id -u` -ne 0 ]; then 57 39 errexit "this must be run by root user" 58 40 fi 41 + 42 + setup 59 43 60 44 # Utilities 61 45 absdir() { # file_path ··· 111 91 ;; 112 92 --fail-unsupported) 113 93 UNSUPPORTED_RESULT=1 94 + shift 1 95 + ;; 96 + --fail-unresolved) 97 + UNRESOLVED_RESULT=1 114 98 shift 1 115 99 ;; 116 100 --logdir|-l) ··· 181 157 DEBUG=0 182 158 VERBOSE=0 183 159 UNSUPPORTED_RESULT=0 160 + UNRESOLVED_RESULT=0 184 161 STOP_FAILURE=0 185 162 # Parse command-line options 186 163 parse_opts $* ··· 260 235 261 236 INSTANCE= 262 237 CASENO=0 238 + 263 239 testcase() { # testfile 264 240 CASENO=$((CASENO+1)) 265 241 desc=`grep "^#[ \t]*description:" $1 | cut -f2 -d:` ··· 286 260 $UNRESOLVED) 287 261 prlog " [${color_blue}UNRESOLVED${color_reset}]" 288 262 UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO" 289 - return 1 # this is a kind of bug.. something happened. 263 + return $UNRESOLVED_RESULT # depends on use case 290 264 ;; 291 265 $UNTESTED) 292 266 prlog " [${color_blue}UNTESTED${color_reset}]" ··· 299 273 return $UNSUPPORTED_RESULT # depends on use case 300 274 ;; 301 275 $XFAIL) 302 - prlog " [${color_red}XFAIL${color_reset}]" 276 + prlog " [${color_green}XFAIL${color_reset}]" 303 277 XFAILED_CASES="$XFAILED_CASES $CASENO" 304 278 return 0 305 279 ;; ··· 431 405 prlog "# of unsupported: " `echo $UNSUPPORTED_CASES | wc -w` 432 406 prlog "# of xfailed: " `echo $XFAILED_CASES | wc -w` 433 407 prlog "# of undefined(test bug): " `echo $UNDEFINED_CASES | wc -w` 408 + 409 + cleanup 434 410 435 411 # if no error, return 0 436 412 exit $TOTAL_RESULT
+28 -1
tools/testing/selftests/kvm/Makefile
··· 5 5 6 6 top_srcdir = ../../../.. 7 7 KSFT_KHDR_INSTALL := 1 8 + 9 + # For cross-builds to work, UNAME_M has to map to ARCH and arch specific 10 + # directories and targets in this Makefile. "uname -m" doesn't map to 11 + # arch specific sub-directory names. 12 + # 13 + # UNAME_M variable to used to run the compiles pointing to the right arch 14 + # directories and build the right targets for these supported architectures. 15 + # 16 + # TEST_GEN_PROGS and LIBKVM are set using UNAME_M variable. 17 + # LINUX_TOOL_ARCH_INCLUDE is set using ARCH variable. 18 + # 19 + # x86_64 targets are named to include x86_64 as a suffix and directories 20 + # for includes are in x86_64 sub-directory. s390x and aarch64 follow the 21 + # same convention. "uname -m" doesn't result in the correct mapping for 22 + # s390x and aarch64. 23 + # 24 + # No change necessary for x86_64 8 25 UNAME_M := $(shell uname -m) 26 + 27 + # Set UNAME_M for arm64 compile/install to work 28 + ifeq ($(ARCH),arm64) 29 + UNAME_M := aarch64 30 + endif 31 + # Set UNAME_M s390x compile/install to work 32 + ifeq ($(ARCH),s390) 33 + UNAME_M := s390x 34 + endif 9 35 10 36 LIBKVM = lib/assert.c lib/elf.c lib/io.c lib/kvm_util.c lib/sparsebit.c lib/test_util.c 11 37 LIBKVM_x86_64 = lib/x86_64/processor.c lib/x86_64/vmx.c lib/x86_64/svm.c lib/x86_64/ucall.c ··· 79 53 INSTALL_HDR_PATH = $(top_srcdir)/usr 80 54 LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/ 81 55 LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include 82 - LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/x86/include 56 + LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include 83 57 CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ 84 58 -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ 85 59 -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ ··· 110 84 $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ) 111 85 $(AR) crs $@ $^ 112 86 87 + x := $(shell mkdir -p $(sort $(dir $(TEST_GEN_PROGS)))) 113 88 all: $(STATIC_LIBS) 114 89 $(TEST_GEN_PROGS): $(STATIC_LIBS) 115 90