diff --git a/Makefile.am b/Makefile.am index 0271a10..110de20 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,9 @@ +if HAVE_PYTHON +TESTS_ENVIRONMENT = python if LRT_ULNX -TESTS = scripts/regression +TESTS = scripts/bindtst.py scripts/msgtst.py scripts/primalloctst.py \ + scripts/helloworld.py scripts/helloworldcpp.py +endif endif AM_CFLAGS = -Wall -Werror -fno-strict-aliasing -g3 @@ -59,7 +63,7 @@ endif if x86_64 BAREFLAGS += -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -AM_LDFLAGS += -melf_x86_64 -static -n -z max-page-size=0x1000 \ +AM_LDFLAGS += -Wl,-melf_x86_64 -static -n -z max-page-size=0x1000 \ -Wl,--build-id=none \ -T $(top_srcdir)/l0/lrt/bare/arch/amd64/link.ld diff --git a/apps/Makefile.am b/apps/Makefile.am index 512666f..60ab77d 100644 --- a/apps/Makefile.am +++ b/apps/Makefile.am @@ -7,7 +7,7 @@ include apps/eventtst/Makefile.am include apps/helloworld/Makefile.am include apps/helloworld_parallel/Makefile.am include apps/helloworldcpp/Makefile.am -include apps/intercept/Makefile.am +#include apps/intercept/Makefile.am include apps/msgtst/Makefile.am include apps/primalloctst/Makefile.am diff --git a/configure.ac b/configure.ac index e5881af..daf8e7e 100644 --- a/configure.ac +++ b/configure.ac @@ -10,7 +10,8 @@ AC_CONFIG_SRCDIR([l0/EBBMgrPrim.c]) AC_CONFIG_HEADER([config.h]) #AC_CONFIG_MACRO_DIR([m4]) m4_include([m4/check_gnu_make.m4]) - +AM_PATH_PYTHON([2.6],, [:]) +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ":"]) AC_CANONICAL_HOST AS_CASE([$host_cpu], [x86_64], [AC_DEFINE([ARCH_AMD64], [1], [x86_64 architecture])], diff --git a/intercept/Makefile.am b/intercept/Makefile.am index eb7e425..23adace 100644 --- a/intercept/Makefile.am +++ b/intercept/Makefile.am @@ -1,8 +1,8 @@ include intercept/arch/Makefile.am -intercept_sources = \ - intercept/Interceptor.c \ - intercept/Interceptor.h \ - intercept/TestInterceptor.c \ - intercept/TestInterceptor.h \ - $(intercept_arch_sources) +# intercept_sources = \ +# intercept/Interceptor.c \ +# intercept/Interceptor.h \ +# intercept/TestInterceptor.c \ +# intercept/TestInterceptor.h \ +# $(intercept_arch_sources) diff --git a/l0/lrt/defFT.c b/l0/lrt/defFT.c index 5a5b749..1eac88b 100644 --- a/l0/lrt/defFT.c +++ b/l0/lrt/defFT.c @@ -32,9 +32,9 @@ void *lrt_trans_default_func(lrt_trans_rep_ref *_self, lrt_trans_func_num fnum) //word to get the LTrans lrt_trans_ltrans *self = (lrt_trans_ltrans *)(*_self-1); lrt_trans_gtrans *gt = lrt_trans_lt2gt(self); - rwlock_rdlock(>->rwlock); + rwlock_rdlock(>->rwlock_instance); lrt_trans_rc ret = gt->mf(_self, self, fnum, gt->arg); - rwlock_rdunlock(>->rwlock); + rwlock_rdunlock(>->rwlock_instance); if(LRT_TRANS_RC_SUCCESS(ret)) { //return the function we wanted to call originally return (*_self)->ft[fnum]; diff --git a/l0/lrt/trans.c b/l0/lrt/trans.c index 492ccb9..b2dd4eb 100644 --- a/l0/lrt/trans.c +++ b/l0/lrt/trans.c @@ -197,28 +197,28 @@ void lrt_trans_wrlock(lrt_trans_id id) { lrt_trans_gtrans *gt = lrt_trans_id2gt(id); - rwlock_wrlock(>->rwlock); + rwlock_wrlock(>->rwlock_instance); } void lrt_trans_wrunlock(lrt_trans_id id) { lrt_trans_gtrans *gt = lrt_trans_id2gt(id); - rwlock_wrunlock(>->rwlock); + rwlock_wrunlock(>->rwlock_instance); } void lrt_trans_rdlock(lrt_trans_id id) { lrt_trans_gtrans *gt = lrt_trans_id2gt(id); - rwlock_rdlock(>->rwlock); + rwlock_rdlock(>->rwlock_instance); } void lrt_trans_rdunlock(lrt_trans_id id) { lrt_trans_gtrans *gt = lrt_trans_id2gt(id); - rwlock_rdunlock(>->rwlock); + rwlock_rdunlock(>->rwlock_instance); } uintptr_t diff --git a/l0/lrt/trans.h b/l0/lrt/trans.h index 2584e23..315c745 100644 --- a/l0/lrt/trans.h +++ b/l0/lrt/trans.h @@ -88,7 +88,7 @@ struct lrt_trans_s { }; union { uintptr_t v6; - rwlock rwlock; + rwlock rwlock_instance; }; union { uintptr_t v7; diff --git a/scripts/bindtst-bare.py b/scripts/bindtst-bare.py new file mode 100644 index 0000000..4f94066 --- /dev/null +++ b/scripts/bindtst-bare.py @@ -0,0 +1,17 @@ +import pexpect +import multiprocessing +import sys + +cores = multiprocessing.cpu_count() +for z in range(1, cores+1): + sys.stdout.write( "bindtst on " + str(z) + " cores [") + sys.stdout.flush() + child = pexpect.spawn ('qemu-system-x86_64 -nographic -smp ' + str(z) + ' apps/bindtst/bindtst.iso') + #child.logfile = sys.stdout + for j in range(z): + child.expect('bindtst: PASSED', timeout=100) + # child.kill(9) + child.sendcontrol('a') + child.send('x') + child.wait() + print "]" diff --git a/scripts/bindtst.py b/scripts/bindtst.py new file mode 100644 index 0000000..61b8be8 --- /dev/null +++ b/scripts/bindtst.py @@ -0,0 +1,11 @@ +import pexpect +import multiprocessing +import sys + +cores = multiprocessing.cpu_count() +sys.stdout.write( "bindtst on " + str(cores) + " cores [") +for i in range(cores): + child = pexpect.spawn ('apps/bindtst/bindtst -ebbos_cores ' + str(i+1)) + for j in range(i+1): + child.expect('bindtst: PASSED', timeout=10) +print "]" diff --git a/scripts/helloworld.py b/scripts/helloworld.py new file mode 100644 index 0000000..6289c94 --- /dev/null +++ b/scripts/helloworld.py @@ -0,0 +1,10 @@ +import pexpect +import multiprocessing +import sys + +cores = multiprocessing.cpu_count() +sys.stdout.write( "helloworld on " + str(cores) + " cores [") +for i in range(cores): + child = pexpect.spawn ('apps/helloworld/helloworld -ebbos_cores ' + str(i+1)) + child.expect('Hello world!', timeout=10) +print "]" diff --git a/scripts/helloworldcpp.py b/scripts/helloworldcpp.py new file mode 100644 index 0000000..4b390f6 --- /dev/null +++ b/scripts/helloworldcpp.py @@ -0,0 +1,10 @@ +import pexpect +import multiprocessing +import sys + +cores = multiprocessing.cpu_count() +sys.stdout.write( "helloworldcpp on " + str(cores) + " cores [") +for i in range(cores): + child = pexpect.spawn ('apps/helloworldcpp/helloworldcpp -ebbos_cores ' + str(i+1)) + child.expect('Hello world!', timeout=10) +print "]" diff --git a/scripts/msgtst.py b/scripts/msgtst.py new file mode 100644 index 0000000..e7c0a08 --- /dev/null +++ b/scripts/msgtst.py @@ -0,0 +1,11 @@ +import pexpect +import multiprocessing +import sys + +cores = multiprocessing.cpu_count() +sys.stdout.write( "msgtst on " + str(cores) + " cores [") +for i in range(cores): + child = pexpect.spawn ('apps/msgtst/msgtst -ebbos_cores ' + str(i+1)) + for j in range(99): + child.expect('msgtst ' + str(j%(i+1)) + ' -> ' + str((j+1)%(i+1)), timeout=10) +print "]" diff --git a/scripts/primalloctst.py b/scripts/primalloctst.py new file mode 100644 index 0000000..1c64bc0 --- /dev/null +++ b/scripts/primalloctst.py @@ -0,0 +1,23 @@ +import os +import pexpect +import multiprocessing +import sys + +alloc = 0 +free = 0 +cores = multiprocessing.cpu_count() +sys.stdout.write( "primalloctst on " + str(cores) + " cores [") +for i in range(cores): + child = pexpect.spawn ('apps/primalloctst/primalloctst -ebbos_cores ' + str(i+1)) + # for now, just expect this number of allocates + for j in range(1270): + i = child.expect(['allocated pointer', 'freed pointer'], timeout=10) + if i==0: + alloc +=1 + else: + free +=1 + +print "alloc is "+str(alloc) + " free is "+ str(free) +if alloc != free: + os._exit(-1) +