From: Garrett C. <yab...@us...> - 2009-07-29 08:33:57
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27959/testcases/kernel/syscalls/move_pages Modified Files: Tag: makefile_infra_rework Makefile move_pages01.c move_pages02.c move_pages03.c move_pages04.c move_pages05.c move_pages06.c move_pages07.c move_pages08.c move_pages09.c move_pages10.c move_pages11.c move_pages_support.c move_pages_support.h Log Message: Add [lib]numa compile checks in autoconf. Nuke ye olde script which did the same thing in a less portable manner. Index: move_pages05.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages05.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages05.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages05.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 57,61 **** --- 57,64 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 113,121 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 116,120 ---- *************** *** 129,132 **** --- 128,137 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 207,210 **** --- 212,218 ---- free_shared_pages(pages + SHARED_PAGE, N_SHARED_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages07.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages07.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages07.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages07.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,82 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 77,81 ---- *************** *** 90,93 **** --- 89,98 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 131,134 **** --- 136,142 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages02.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages02.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages02.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages02.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <sys/wait.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,82 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 77,81 ---- *************** *** 90,93 **** --- 89,98 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 124,127 **** --- 129,135 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages03.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages03.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages03.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages03.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 59,63 **** --- 59,66 ---- #include <semaphore.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 112,120 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 115,119 ---- *************** *** 128,131 **** --- 127,136 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 193,196 **** --- 198,204 ---- free_shared_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages11.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages11.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages11.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages11.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 58,62 **** --- 58,65 ---- #include <semaphore.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <pwd.h> *************** *** 112,120 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 115,119 ---- *************** *** 128,131 **** --- 127,136 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 192,195 **** --- 197,203 ---- free_shared_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages08.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages08.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages08.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages08.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,82 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 77,81 ---- *************** *** 90,93 **** --- 89,98 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 119,122 **** --- 124,130 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages10.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages10.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages10.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages10.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,82 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 77,81 ---- *************** *** 90,93 **** --- 89,98 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 119,122 **** --- 124,130 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages09.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages09.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages09.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages09.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,81 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; /* parse standard options */ --- 77,81 ---- *************** *** 89,92 **** --- 89,97 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 118,121 **** --- 123,129 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages04.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages04.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages04.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages04.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 57,61 **** --- 57,64 ---- #include <signal.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 80,88 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node = 1; /* parse standard options */ --- 83,87 ---- *************** *** 96,99 **** --- 95,104 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node = 1; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 138,147 **** status[UNTOUCHED_PAGE]); ! err_free_pages: ! /* This is capable of freeing both the touched and ! * untouched pages. ! */ ! free_pages(pages, TEST_PAGES); } cleanup(); --- 143,155 ---- status[UNTOUCHED_PAGE]); ! err_free_pages: ! /* This is capable of freeing both the touched and ! * untouched pages. ! */ ! free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages_support.h =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages_support.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** move_pages_support.h 26 Jul 2008 04:15:37 -0000 1.1 --- move_pages_support.h 29 Jul 2009 08:33:42 -0000 1.1.4.1 *************** *** 20,24 **** --- 20,26 ---- #define MOVE_PAGES_SUPPORT_H + #if HAVE_NUMAIF_H #include <numaif.h> + #endif #include <semaphore.h> Index: Makefile =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/Makefile,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** Makefile 20 Jul 2009 02:03:05 -0000 1.4.4.2 --- Makefile 29 Jul 2009 08:33:42 -0000 1.4.4.3 *************** *** 21,58 **** include $(top_srcdir)/include/mk/testcases.mk - check_numa_move_pages = $(shell \ - if printf \ - "\#include <numa.h>\n\ - int main() \ - { \ - numa_move_pages(0, 0, NULL, NULL, NULL, 0); \ - return 0; \ - }" | $(CC) -xc -lnuma - > /dev/null 2>&1 ; \ - then echo yes ; \ - else echo no ; fi) - - HAS_NUMA_MOVE_PAGES := $(call check_numa_move_pages) - - ifneq ($(HAS_NUMA_MOVE_PAGES),yes) - - MAKE_TARGETS := - - all install: no-all-install - - .PHONY: no-all-install - no-all-install: - @echo "-lnuma with move_pages support is required for move_pages" - @echo "testcases." - else INSTALL_TARGETS := move_pages.sh MAKE_TARGETS := $(patsubst %.c,%,$(wildcard *[0-9].c)) $(MAKE_TARGETS): move_pages_support.o install: move_page03.mode move_page11.mode - endif - move_page03.mode move_page11.mode: %: @/bin/sh $(srcdir)/$@.sh --- 21,37 ---- include $(top_srcdir)/include/mk/testcases.mk INSTALL_TARGETS := move_pages.sh MAKE_TARGETS := $(patsubst %.c,%,$(wildcard *[0-9].c)) + # linux_syscall_numbers.h is forcing move_pages_support.o to complain about + # cleanup being undefined [and when defined] unused. Let's just skip this + # warning... + move_pages_support.o: CFLAGS += -Wno-unused-function + $(MAKE_TARGETS): move_pages_support.o install: move_page03.mode move_page11.mode move_page03.mode move_page11.mode: %: @/bin/sh $(srcdir)/$@.sh *************** *** 60,64 **** .PHONY: move_pages03.mode move_page11.mode ! LDLIBS += -lnuma -lrt $(eval $(generic_leaf_target)) --- 39,43 ---- .PHONY: move_pages03.mode move_page11.mode ! LDLIBS += $(NUMA_LIBS) -lrt $(eval $(generic_leaf_target)) Index: move_pages01.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages01.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages01.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages01.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 54,58 **** --- 54,60 ---- #include <sys/wait.h> #include <errno.h> + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 73,77 **** int main(int argc, char **argv) { - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ --- 75,78 ---- *************** *** 86,89 **** --- 87,93 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + int lc; /* loop counter */ + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 101,104 **** --- 105,109 ---- ret = numa_move_pages(0, TEST_PAGES, pages, NULL, status, 0); TEST_ERRNO = errno; + if (ret != 0) { tst_resm(TFAIL, "retrieving NUMA nodes failed"); *************** *** 110,114 **** --- 115,123 ---- free_pages(pages, TEST_PAGES); + } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); Index: move_pages_support.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages_support.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages_support.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages_support.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 21,26 **** #include <unistd.h> #include <semaphore.h> #include <numa.h> ! #include <numaif.h> #include <errno.h> --- 21,33 ---- #include <unistd.h> #include <semaphore.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> ! #endif ! /* ! * #if HAVE_NUMAIF_H ! #include <numaif.h> ! #endif ! */ #include <errno.h> *************** *** 49,52 **** --- 56,61 ---- void free_pages(void **pages, unsigned int num) { + + #if HAS_NUMA_H int i; size_t onepage = get_page_size(); *************** *** 57,60 **** --- 66,70 ---- } } + #endif } *************** *** 74,78 **** --- 84,90 ---- { int i; + #if HAVE_NUMA_ALLOC_ONNODE size_t onepage = get_page_size(); + #endif for (i = 0; i < num; i++) { *************** *** 83,87 **** --- 95,101 ---- char *page; + #if HAVE_NUMA_ALLOC_ONNODE pages[i] = numa_alloc_onnode(onepage, nodes[i]); + #endif if (pages[i] == NULL) { tst_resm(TBROK, "allocation of page on node " *************** *** 116,122 **** int alloc_pages_linear(void **pages, unsigned int num) { unsigned int i; unsigned int n; - int nodes[num]; n = 0; --- 130,138 ---- int alloc_pages_linear(void **pages, unsigned int num) { + int nodes[num]; + + #if HAS_NUMA_H unsigned int i; unsigned int n; n = 0; *************** *** 128,131 **** --- 144,148 ---- n = 0; } + #endif return alloc_pages_on_nodes(pages, num, nodes); *************** *** 165,168 **** --- 182,186 ---- verify_pages_on_nodes(void **pages, int *status, unsigned int num, int *nodes) { + #if HAVE_NUMA_H unsigned int i; int which_node; *************** *** 197,200 **** --- 215,221 ---- tst_resm(TPASS, "pages are present in expected nodes"); + #else + tst_resm(TCONF, "NUMA support not provided"); + #endif } *************** *** 207,210 **** --- 228,232 ---- void verify_pages_linear(void **pages, int *status, unsigned int num) { + #if HAS_NUMA_H unsigned int i; unsigned int n; *************** *** 212,215 **** --- 234,238 ---- n = 0; + for (i = 0; i < num; i++) { nodes[i] = i; *************** *** 221,224 **** --- 244,248 ---- verify_pages_on_nodes(pages, status, num, nodes); + #endif } *************** *** 253,256 **** --- 277,281 ---- int alloc_shared_pages_on_node(void **pages, unsigned int num, int node) { + #if HAS_NUMA_H char *shared; unsigned int i; *************** *** 282,285 **** --- 307,313 ---- return 0; + #else + return -1; + #endif } *************** *** 378,381 **** --- 406,410 ---- void check_config(unsigned int min_nodes) { + #if HAS_NUMA_H if (numa_available() < 0) { tst_resm(TCONF, "NUMA support is not available"); *************** *** 397,399 **** --- 426,432 ---- tst_exit(); } + #else + tst_resm(TCONF, "NUMA support not provided"); + tst_exit(); + #endif } Index: move_pages06.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/move_pages/move_pages06.c,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** move_pages06.c 23 Mar 2009 13:35:58 -0000 1.2 --- move_pages06.c 29 Jul 2009 08:33:42 -0000 1.2.2.1 *************** *** 55,59 **** --- 55,62 ---- #include <unistd.h> #include <errno.h> + #include "config.h" + #if HAVE_NUMA_H #include <numa.h> + #endif #include <test.h> *************** *** 74,82 **** int main(int argc, char **argv) { - unsigned int i; - int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - unsigned int from_node = 0; - unsigned int to_node; /* parse standard options */ --- 77,81 ---- *************** *** 90,93 **** --- 89,98 ---- setup(); + #if HAVE_NUMA_MOVE_PAGES + unsigned int i; + int lc; /* loop counter */ + unsigned int from_node = 0; + unsigned int to_node; + /* check for looping state if -i option is given */ for (lc = 0; TEST_LOOPING(lc); lc++) { *************** *** 120,123 **** --- 125,131 ---- free_pages(pages, TEST_PAGES); } + #else + tst_resm(TCONF, "move_pages support not found."); + #endif cleanup(); |