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-next-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest update from Shuah Khan:

- several patches to fix incorrect kernel headers search path from
Mathieu Desnoyers

- a few follow-on fixes found during testing the above change

- miscellaneous fixes

- support for filtering and enumerating tests

* tag 'linux-kselftest-next-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (40 commits)
selftests/user_events: add a note about user_events.h dependency
selftests/mount_setattr: fix to make run_tests failure
selftests/mount_setattr: fix redefine struct mount_attr build error
selftests/sched: fix warn_unused_result build warns
selftests/ptp: Remove clean target from Makefile
selftests: use printf instead of echo -ne
selftests/ftrace: Fix bash specific "==" operator
selftests: tpm2: remove redundant ord()
selftests: find echo binary to use -ne options
selftests: Fix spelling mistake "allright" -> "all right"
selftests: tdx: Use installed kernel headers search path
selftests: ptrace: Use installed kernel headers search path
selftests: memfd: Use installed kernel headers search path
selftests: iommu: Use installed kernel headers search path
selftests: x86: Fix incorrect kernel headers search path
selftests: vm: Fix incorrect kernel headers search path
selftests: user_events: Fix incorrect kernel headers search path
selftests: sync: Fix incorrect kernel headers search path
selftests: seccomp: Fix incorrect kernel headers search path
selftests: sched: Fix incorrect kernel headers search path
...

+201 -67
+2 -2
tools/testing/selftests/Makefile
··· 237 237 @# included in the generated runlist. 238 238 for TARGET in $(TARGETS); do \ 239 239 BUILD_TARGET=$$BUILD/$$TARGET; \ 240 - [ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \ 241 - echo -ne "Emit Tests for $$TARGET\n"; \ 240 + [ ! -d $(INSTALL_PATH)/$$TARGET ] && printf "Skipping non-existent dir: $$TARGET\n" && continue; \ 241 + printf "Emit Tests for $$TARGET\n"; \ 242 242 $(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \ 243 243 -C $$TARGET emit_tests >> $(TEST_LIST); \ 244 244 done;
+1 -1
tools/testing/selftests/arm64/fp/Makefile
··· 3 3 # A proper top_srcdir is needed by KSFT(lib.mk) 4 4 top_srcdir = $(realpath ../../../../../) 5 5 6 - CFLAGS += -I$(top_srcdir)/usr/include/ 6 + CFLAGS += $(KHDR_INCLUDES) 7 7 8 8 TEST_GEN_PROGS := fp-stress \ 9 9 sve-ptrace sve-probe-vls \
+1 -1
tools/testing/selftests/arm64/tags/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - CFLAGS += -I../../../../../usr/include/ 3 + CFLAGS += $(KHDR_INCLUDES) 4 4 TEST_GEN_PROGS := tags_test 5 5 TEST_PROGS := run_tags_test.sh 6 6
+1 -1
tools/testing/selftests/clone3/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -g -std=gnu99 -I../../../../usr/include/ 2 + CFLAGS += -g -std=gnu99 $(KHDR_INCLUDES) 3 3 LDLIBS += -lcap 4 4 5 5 TEST_GEN_PROGS := clone3 clone3_clear_sighand clone3_set_tid \
+1 -1
tools/testing/selftests/core/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -g -I../../../../usr/include/ 2 + CFLAGS += -g $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS := close_range_test 5 5
+1 -1
tools/testing/selftests/dmabuf-heaps/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -static -O3 -Wl,-no-as-needed -Wall 2 + CFLAGS += -static -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS = dmabuf-heap 5 5
+1 -2
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
··· 13 13 #include <sys/types.h> 14 14 15 15 #include <linux/dma-buf.h> 16 + #include <linux/dma-heap.h> 16 17 #include <drm/drm.h> 17 - 18 - #include "../../../../include/uapi/linux/dma-heap.h" 19 18 20 19 #define DEVPATH "/dev/dma_heap" 21 20
+1 -1
tools/testing/selftests/drivers/dma-buf/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -I../../../../../usr/include/ 2 + CFLAGS += $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS := udmabuf 5 5
+1 -2
tools/testing/selftests/drivers/s390x/uvdevice/Makefile
··· 11 11 TEST_GEN_PROGS := test_uvdevice 12 12 13 13 top_srcdir ?= ../../../../../.. 14 - khdr_dir = $(top_srcdir)/usr/include 15 14 LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include 16 15 17 - CFLAGS += -Wall -Werror -static -I$(khdr_dir) -I$(LINUX_TOOL_ARCH_INCLUDE) 16 + CFLAGS += -Wall -Werror -static $(KHDR_INCLUDES) -I$(LINUX_TOOL_ARCH_INCLUDE) 18 17 19 18 include ../../../lib.mk 20 19
+1 -1
tools/testing/selftests/filesystems/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - CFLAGS += -I../../../../usr/include/ 3 + CFLAGS += $(KHDR_INCLUDES) 4 4 TEST_GEN_PROGS := devpts_pts 5 5 TEST_GEN_PROGS_EXTENDED := dnotify_test 6 6
+1 -1
tools/testing/selftests/filesystems/binderfs/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - CFLAGS += -I../../../../../usr/include/ -pthread 3 + CFLAGS += $(KHDR_INCLUDES) -pthread 4 4 TEST_GEN_PROGS := binderfs_test 5 5 6 6 binderfs_test: binderfs_test.c ../../kselftest.h ../../kselftest_harness.h
+1 -1
tools/testing/selftests/filesystems/epoll/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - CFLAGS += -I../../../../../usr/include/ 3 + CFLAGS += $(KHDR_INCLUDES) 4 4 LDLIBS += -lpthread 5 5 TEST_GEN_PROGS := epoll_wakeup_test 6 6
+1 -1
tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
··· 42 42 43 43 while [ $check_times -ne 0 ]; do 44 44 e=`cat $EVENT_ENABLE` 45 - if [ "$e" == $val ]; then 45 + if [ "$e" = $val ]; then 46 46 return 0 47 47 fi 48 48 sleep $SLEEP_TIME
+1 -1
tools/testing/selftests/futex/functional/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - INCLUDES := -I../include -I../../ -I../../../../../usr/include/ 2 + INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) 3 3 CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) $(KHDR_INCLUDES) 4 4 LDLIBS := -lpthread -lrt 5 5
+1 -1
tools/testing/selftests/gpio/Makefile
··· 3 3 TEST_PROGS := gpio-mockup.sh gpio-sim.sh 4 4 TEST_FILES := gpio-mockup-sysfs.sh 5 5 TEST_GEN_PROGS_EXTENDED := gpio-mockup-cdev gpio-chip-info gpio-line-name 6 - CFLAGS += -O2 -g -Wall -I../../../../usr/include/ $(KHDR_INCLUDES) 6 + CFLAGS += -O2 -g -Wall $(KHDR_INCLUDES) 7 7 8 8 include ../lib.mk
+1 -2
tools/testing/selftests/iommu/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 CFLAGS += -Wall -O2 -Wno-unused-function 3 - CFLAGS += -I../../../../include/uapi/ 4 - CFLAGS += -I../../../../include/ 3 + CFLAGS += $(KHDR_INCLUDES) 5 4 6 5 CFLAGS += -D_GNU_SOURCE 7 6
+1 -1
tools/testing/selftests/ipc/Makefile
··· 10 10 CFLAGS := -DCONFIG_X86_64 -D__x86_64__ 11 11 endif 12 12 13 - CFLAGS += -I../../../../usr/include/ 13 + CFLAGS += $(KHDR_INCLUDES) 14 14 15 15 TEST_GEN_PROGS := msgque 16 16
+1 -1
tools/testing/selftests/kcmp/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -I../../../../usr/include/ 2 + CFLAGS += $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS := kcmp_test 5 5
+137 -5
tools/testing/selftests/kselftest_harness.h
··· 54 54 #define _GNU_SOURCE 55 55 #endif 56 56 #include <asm/types.h> 57 + #include <ctype.h> 57 58 #include <errno.h> 58 59 #include <stdbool.h> 59 60 #include <stdint.h> ··· 986 985 } 987 986 } 988 987 988 + static void test_harness_list_tests(void) 989 + { 990 + struct __fixture_variant_metadata *v; 991 + struct __fixture_metadata *f; 992 + struct __test_metadata *t; 993 + 994 + for (f = __fixture_list; f; f = f->next) { 995 + v = f->variant; 996 + t = f->tests; 997 + 998 + if (f == __fixture_list) 999 + fprintf(stderr, "%-20s %-25s %s\n", 1000 + "# FIXTURE", "VARIANT", "TEST"); 1001 + else 1002 + fprintf(stderr, "--------------------------------------------------------------------------------\n"); 1003 + 1004 + do { 1005 + fprintf(stderr, "%-20s %-25s %s\n", 1006 + t == f->tests ? f->name : "", 1007 + v ? v->name : "", 1008 + t ? t->name : ""); 1009 + 1010 + v = v ? v->next : NULL; 1011 + t = t ? t->next : NULL; 1012 + } while (v || t); 1013 + } 1014 + } 1015 + 1016 + static int test_harness_argv_check(int argc, char **argv) 1017 + { 1018 + int opt; 1019 + 1020 + while ((opt = getopt(argc, argv, "hlF:f:V:v:t:T:r:")) != -1) { 1021 + switch (opt) { 1022 + case 'f': 1023 + case 'F': 1024 + case 'v': 1025 + case 'V': 1026 + case 't': 1027 + case 'T': 1028 + case 'r': 1029 + break; 1030 + case 'l': 1031 + test_harness_list_tests(); 1032 + return KSFT_SKIP; 1033 + case 'h': 1034 + default: 1035 + fprintf(stderr, 1036 + "Usage: %s [-h|-l] [-t|-T|-v|-V|-f|-F|-r name]\n" 1037 + "\t-h print help\n" 1038 + "\t-l list all tests\n" 1039 + "\n" 1040 + "\t-t name include test\n" 1041 + "\t-T name exclude test\n" 1042 + "\t-v name include variant\n" 1043 + "\t-V name exclude variant\n" 1044 + "\t-f name include fixture\n" 1045 + "\t-F name exclude fixture\n" 1046 + "\t-r name run specified test\n" 1047 + "\n" 1048 + "Test filter options can be specified " 1049 + "multiple times. The filtering stops\n" 1050 + "at the first match. For example to " 1051 + "include all tests from variant 'bla'\n" 1052 + "but not test 'foo' specify '-T foo -v bla'.\n" 1053 + "", argv[0]); 1054 + return opt == 'h' ? KSFT_SKIP : KSFT_FAIL; 1055 + } 1056 + } 1057 + 1058 + return KSFT_PASS; 1059 + } 1060 + 1061 + static bool test_enabled(int argc, char **argv, 1062 + struct __fixture_metadata *f, 1063 + struct __fixture_variant_metadata *v, 1064 + struct __test_metadata *t) 1065 + { 1066 + unsigned int flen = 0, vlen = 0, tlen = 0; 1067 + bool has_positive = false; 1068 + int opt; 1069 + 1070 + optind = 1; 1071 + while ((opt = getopt(argc, argv, "F:f:V:v:t:T:r:")) != -1) { 1072 + has_positive |= islower(opt); 1073 + 1074 + switch (tolower(opt)) { 1075 + case 't': 1076 + if (!strcmp(t->name, optarg)) 1077 + return islower(opt); 1078 + break; 1079 + case 'f': 1080 + if (!strcmp(f->name, optarg)) 1081 + return islower(opt); 1082 + break; 1083 + case 'v': 1084 + if (!strcmp(v->name, optarg)) 1085 + return islower(opt); 1086 + break; 1087 + case 'r': 1088 + if (!tlen) { 1089 + flen = strlen(f->name); 1090 + vlen = strlen(v->name); 1091 + tlen = strlen(t->name); 1092 + } 1093 + if (strlen(optarg) == flen + 1 + vlen + !!vlen + tlen && 1094 + !strncmp(f->name, &optarg[0], flen) && 1095 + !strncmp(v->name, &optarg[flen + 1], vlen) && 1096 + !strncmp(t->name, &optarg[flen + 1 + vlen + !!vlen], tlen)) 1097 + return true; 1098 + break; 1099 + } 1100 + } 1101 + 1102 + /* 1103 + * If there are no positive tests then we assume user just wants 1104 + * exclusions and everything else is a pass. 1105 + */ 1106 + return !has_positive; 1107 + } 1108 + 989 1109 void __run_test(struct __fixture_metadata *f, 990 1110 struct __fixture_variant_metadata *variant, 991 1111 struct __test_metadata *t) ··· 1154 1032 f->name, variant->name[0] ? "." : "", variant->name, t->name); 1155 1033 } 1156 1034 1157 - static int test_harness_run(int __attribute__((unused)) argc, 1158 - char __attribute__((unused)) **argv) 1035 + static int test_harness_run(int argc, char **argv) 1159 1036 { 1160 1037 struct __fixture_variant_metadata no_variant = { .name = "", }; 1161 1038 struct __fixture_variant_metadata *v; 1162 1039 struct __fixture_metadata *f; 1163 1040 struct __test_results *results; 1164 1041 struct __test_metadata *t; 1165 - int ret = 0; 1042 + int ret; 1166 1043 unsigned int case_count = 0, test_count = 0; 1167 1044 unsigned int count = 0; 1168 1045 unsigned int pass_count = 0; 1169 1046 1047 + ret = test_harness_argv_check(argc, argv); 1048 + if (ret != KSFT_PASS) 1049 + return ret; 1050 + 1170 1051 for (f = __fixture_list; f; f = f->next) { 1171 1052 for (v = f->variant ?: &no_variant; v; v = v->next) { 1172 - case_count++; 1053 + unsigned int old_tests = test_count; 1054 + 1173 1055 for (t = f->tests; t; t = t->next) 1174 - test_count++; 1056 + if (test_enabled(argc, argv, f, v, t)) 1057 + test_count++; 1058 + 1059 + if (old_tests != test_count) 1060 + case_count++; 1175 1061 } 1176 1062 } 1177 1063 ··· 1193 1063 for (f = __fixture_list; f; f = f->next) { 1194 1064 for (v = f->variant ?: &no_variant; v; v = v->next) { 1195 1065 for (t = f->tests; t; t = t->next) { 1066 + if (!test_enabled(argc, argv, f, v, t)) 1067 + continue; 1196 1068 count++; 1197 1069 t->results = results; 1198 1070 __run_test(f, v, t);
+1 -1
tools/testing/selftests/media_tests/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # 3 - CFLAGS += -I../ -I../../../../usr/include/ 3 + CFLAGS += -I../ $(KHDR_INCLUDES) 4 4 TEST_GEN_PROGS := media_device_test media_device_open video_device_test 5 5 6 6 include ../lib.mk
+1 -1
tools/testing/selftests/membarrier/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -g -I../../../../usr/include/ 2 + CFLAGS += -g $(KHDR_INCLUDES) 3 3 LDLIBS += -lpthread 4 4 5 5 TEST_GEN_PROGS := membarrier_test_single_thread \
+1 -3
tools/testing/selftests/memfd/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 CFLAGS += -D_FILE_OFFSET_BITS=64 3 - CFLAGS += -I../../../../include/uapi/ 4 - CFLAGS += -I../../../../include/ 5 - CFLAGS += -I../../../../usr/include/ 3 + CFLAGS += $(KHDR_INCLUDES) 6 4 7 5 TEST_GEN_PROGS := memfd_test 8 6 TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
+2 -2
tools/testing/selftests/mount_setattr/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for mount selftests. 3 - CFLAGS = -g -I../../../../usr/include/ -Wall -O2 -pthread 3 + CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 -pthread 4 4 5 - TEST_GEN_FILES += mount_setattr_test 5 + TEST_GEN_PROGS := mount_setattr_test 6 6 7 7 include ../lib.mk
-7
tools/testing/selftests/mount_setattr/mount_setattr_test.c
··· 103 103 #else 104 104 #define __NR_mount_setattr 442 105 105 #endif 106 - 107 - struct mount_attr { 108 - __u64 attr_set; 109 - __u64 attr_clr; 110 - __u64 propagation; 111 - __u64 userns_fd; 112 - }; 113 106 #endif 114 107 115 108 #ifndef __NR_open_tree
+1 -1
tools/testing/selftests/move_mount_set_group/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # Makefile for mount selftests. 3 - CFLAGS = -g -I../../../../usr/include/ -Wall -O2 3 + CFLAGS = -g $(KHDR_INCLUDES) -Wall -O2 4 4 5 5 TEST_GEN_FILES += move_mount_set_group_test 6 6
+1 -1
tools/testing/selftests/perf_events/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -Wl,-no-as-needed -Wall -I../../../../usr/include 2 + CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) 3 3 LDFLAGS += -lpthread 4 4 5 5 TEST_GEN_PROGS := sigtrap_threads remove_on_exec
+1 -1
tools/testing/selftests/pid_namespace/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -g -I../../../../usr/include/ 2 + CFLAGS += -g $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS = regression_enomem 5 5
+1 -1
tools/testing/selftests/pidfd/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -g -I../../../../usr/include/ -pthread -Wall 2 + CFLAGS += -g $(KHDR_INCLUDES) -pthread -Wall 3 3 4 4 TEST_GEN_PROGS := pidfd_test pidfd_fdinfo_test pidfd_open_test \ 5 5 pidfd_poll_test pidfd_wait pidfd_getfd_test pidfd_setns_test
+1 -1
tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c
··· 79 79 { 80 80 int n_tasks = 100, i; 81 81 82 - fprintf(stderr, "[No further output means we're allright]\n"); 82 + fprintf(stderr, "[No further output means we're all right]\n"); 83 83 84 84 for (i=0; i<n_tasks; i++) 85 85 if (fork() == 0)
+1 -1
tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c
··· 83 83 { 84 84 int n_tasks = 100, i; 85 85 86 - fprintf(stderr, "[No further output means we're allright]\n"); 86 + fprintf(stderr, "[No further output means we're all right]\n"); 87 87 88 88 for (i=0; i<n_tasks; i++) 89 89 if (fork() == 0)
+3 -6
tools/testing/selftests/ptp/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -I../../../../usr/include/ 3 - TEST_PROGS := testptp 2 + CFLAGS += $(KHDR_INCLUDES) 3 + TEST_GEN_PROGS := testptp 4 4 LDLIBS += -lrt 5 - all: $(TEST_PROGS) 5 + TEST_PROGS = phc.sh 6 6 7 7 include ../lib.mk 8 - 9 - clean: 10 - rm -fr $(TEST_PROGS)
+1 -1
tools/testing/selftests/ptrace/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - CFLAGS += -std=c99 -pthread -iquote../../../../include/uapi -Wall 2 + CFLAGS += -std=c99 -pthread -Wall $(KHDR_INCLUDES) 3 3 4 4 TEST_GEN_PROGS := get_syscall_info peeksiginfo vmaccess 5 5
+1 -1
tools/testing/selftests/rseq/Makefile
··· 4 4 CLANG_FLAGS += -no-integrated-as 5 5 endif 6 6 7 - CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -L$(OUTPUT) -Wl,-rpath=./ \ 7 + CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -L$(OUTPUT) -Wl,-rpath=./ \ 8 8 $(CLANG_FLAGS) 9 9 LDLIBS += -lpthread -ldl 10 10
+1 -1
tools/testing/selftests/sched/Makefile
··· 4 4 CLANG_FLAGS += -no-integrated-as 5 5 endif 6 6 7 - CFLAGS += -O2 -Wall -g -I./ -I../../../../usr/include/ -Wl,-rpath=./ \ 7 + CFLAGS += -O2 -Wall -g -I./ $(KHDR_INCLUDES) -Wl,-rpath=./ \ 8 8 $(CLANG_FLAGS) 9 9 LDLIBS += -lpthread 10 10
+12 -3
tools/testing/selftests/sched/cs_prctl_test.c
··· 27 27 #include <sys/prctl.h> 28 28 #include <unistd.h> 29 29 #include <time.h> 30 + #include <errno.h> 30 31 #include <stdio.h> 31 32 #include <stdlib.h> 32 33 #include <string.h> ··· 152 151 static int child_func_process(void *arg) 153 152 { 154 153 struct child_args *ca = (struct child_args *)arg; 154 + int ret; 155 155 156 156 close(ca->pfd[0]); 157 157 158 158 create_threads(ca->num_threads, ca->thr_tids); 159 159 160 - write(ca->pfd[1], &ca->thr_tids, sizeof(int) * ca->num_threads); 160 + ret = write(ca->pfd[1], &ca->thr_tids, sizeof(int) * ca->num_threads); 161 + if (ret == -1) 162 + printf("write failed on pfd[%d] - error (%s)\n", 163 + ca->pfd[1], strerror(errno)); 164 + 161 165 close(ca->pfd[1]); 162 166 163 167 while (1) ··· 175 169 void create_processes(int num_processes, int num_threads, struct child_args proc[]) 176 170 { 177 171 pid_t cpid; 178 - int i; 172 + int i, ret; 179 173 180 174 for (i = 0; i < num_processes; ++i) { 181 175 proc[i].num_threads = num_threads; ··· 190 184 } 191 185 192 186 for (i = 0; i < num_processes; ++i) { 193 - read(proc[i].pfd[0], &proc[i].thr_tids, sizeof(int) * proc[i].num_threads); 187 + ret = read(proc[i].pfd[0], &proc[i].thr_tids, sizeof(int) * proc[i].num_threads); 188 + if (ret == -1) 189 + printf("read failed on proc[%d].pfd[0] error (%s)\n", 190 + i, strerror(errno)); 194 191 close(proc[i].pfd[0]); 195 192 } 196 193 }
+1 -1
tools/testing/selftests/seccomp/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -Wl,-no-as-needed -Wall -isystem ../../../../usr/include/ 2 + CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) 3 3 LDFLAGS += -lpthread 4 4 LDLIBS += -lcap 5 5
+1 -1
tools/testing/selftests/sync/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra 3 - CFLAGS += -I../../../../usr/include/ 3 + CFLAGS += $(KHDR_INCLUDES) 4 4 LDFLAGS += -pthread 5 5 6 6 .PHONY: all clean
+1 -1
tools/testing/selftests/tdx/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - CFLAGS += -O3 -Wl,-no-as-needed -Wall -static 3 + CFLAGS += -O3 -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) -static 4 4 5 5 TEST_GEN_PROGS := tdx_guest_test 6 6
+1 -1
tools/testing/selftests/tdx/tdx_guest_test.c
··· 12 12 #include <errno.h> 13 13 #include <fcntl.h> 14 14 15 + #include <linux/tdx-guest.h> 15 16 #include "../kselftest_harness.h" 16 - #include "../../../../include/uapi/linux/tdx-guest.h" 17 17 18 18 #define TDX_GUEST_DEVNAME "/dev/tdx_guest" 19 19 #define HEX_DUMP_SIZE 8
+1 -1
tools/testing/selftests/tpm2/tpm2.py
··· 344 344 345 345 346 346 def hex_dump(d): 347 - d = [format(ord(x), '02x') for x in d] 347 + d = [format(x, '02x') for x in d] 348 348 d = [d[i: i + 16] for i in range(0, len(d), 16)] 349 349 d = [' '.join(x) for x in d] 350 350 d = os.linesep.join(d)
+9 -1
tools/testing/selftests/user_events/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - CFLAGS += -Wl,-no-as-needed -Wall -I../../../../usr/include 2 + CFLAGS += -Wl,-no-as-needed -Wall $(KHDR_INCLUDES) 3 3 LDLIBS += -lrt -lpthread -lm 4 + 5 + # Note: 6 + # This test depends on <linux/user_events.h> exported in uapi 7 + # The following commit removed user_events.h out of uapi: 8 + # commit 5cfff569cab8bf544bab62c911c5d6efd5af5e05 9 + # tracing: Move user_events.h temporarily out of include/uapi 10 + # This test will not compile until user_events.h is added 11 + # back to uapi. 4 12 5 13 TEST_GEN_PROGS = ftrace_test dyn_test perf_test 6 14
+1 -1
tools/testing/selftests/vm/Makefile
··· 25 25 # LDLIBS. 26 26 MAKEFLAGS += --no-builtin-rules 27 27 28 - CFLAGS = -Wall -I $(top_srcdir) -I $(top_srcdir)/usr/include $(EXTRA_CFLAGS) $(KHDR_INCLUDES) 28 + CFLAGS = -Wall -I $(top_srcdir) $(EXTRA_CFLAGS) $(KHDR_INCLUDES) 29 29 LDLIBS = -lrt -lpthread 30 30 TEST_GEN_FILES = cow 31 31 TEST_GEN_FILES += compaction_test
+1 -1
tools/testing/selftests/x86/Makefile
··· 34 34 BINARIES_32 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_32)) 35 35 BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) 36 36 37 - CFLAGS := -O2 -g -std=gnu99 -pthread -Wall 37 + CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) 38 38 39 39 # call32_from_64 in thunks.S uses absolute addresses. 40 40 ifeq ($(CAN_BUILD_WITH_NOPIE),1)