Browse Source

Add "regression" rules for LMBench and GCC

Chia-Che Tsai 6 years ago
parent
commit
7086a5c0ad

+ 22 - 2
LibOS/shim/test/apps/gcc/Makefile

@@ -90,10 +90,30 @@ obj/lib/$(MPC_OBJ): src/$(MPC_SRC)
 src/$(MPC_SRC): $(MPC_SRC).tar.gz src
 	cd src && tar -xzf ../$<
 
-regress_gcc: all
-	./gcc.manifest /test_files/helloworld.c -o hello
+regression: all
+	@echo "\n\nCompile hello.c:"
+	./gcc.manifest test_files/helloworld.c -o hello
+	@chmod 755 hello
 	./hello
 
+	@echo "\n\nCompile bzip2.c:"
+	./gcc.manifest test_files/bzip2.c -o bzip2
+	@chmod 755 bzip2
+	@[ ! -f bzip2.tmp ] || rm -f bzip2.tmp
+	@cp -f bzip2 bzip2.copy
+	./bzip2 -z bzip2.copy && ./bzip2 -d bzip2.copy.bz2
+	diff -q bzip2 bzip2.copy
+	@rm -f bzip2.copy
+
+	@echo "\n\nCompile gzip.c:"
+	./gcc.manifest test_files/gzip.c -o gzip
+	@chmod 755 gzip
+	@cp -f gzip gzip.copy
+	./gzip gzip.copy && ./gzip -d gzip.copy.gz
+	diff -q gzip gzip.copy
+	@rm -f gzip.copy
+
+
 src:
 	mkdir -p src
 

+ 1 - 5
LibOS/shim/test/apps/gcc/gcc.manifest.template

@@ -23,11 +23,7 @@ fs.mount.tmp.type = chroot
 fs.mount.tmp.path = /tmp
 fs.mount.tmp.uri = file:/tmp
 
-fs.mount.test_files.type = chroot
-fs.mount.test_files.path = /test_files
-fs.mount.test_files.uri = file:$(PWD)/test_files
-
-sgx.enclave_size = 1G
+gx.enclave_size = 1G
 
 sgx.trusted_files.ld = file:$(LIBCDIR)/ld-linux-x86-64.so.2
 sgx.trusted_files.libc = file:$(LIBCDIR)/libc.so.6

+ 0 - 22
LibOS/shim/test/apps/lmbench/CONFIG.template

@@ -1,22 +0,0 @@
-DISKS=""; export DISKS
-DISK_DESC=""; export DISK_DESC
-OUTPUT=/dev/tty; export OUTPUT
-ENOUGH=5000; export ENOUGH
-FASTMEM="NO"; export FASTMEM
-FILE=/var/tmp/XXX; export FILE
-FSDIR=/var/tmp; export FSDIR
-INFO=INFO.kermit.cs.unc.edu; export INFO
-LOOP_O=0.00000013; export LOOP_O
-MAIL=no; export MAIL
-MB=512; export MB
-MHZ=""; export MHZ
-MOTHERBOARD=""; export MOTHERBOARD
-NETWORKS=""; export NETWORKS
-OS="linux"; export OS
-PROCESSORS=""; export PROCESSORS
-REMOTE=""; export REMOTE
-SLOWFS="NO"; export SLOWFS
-TIMING_O=0; export TIMING_O
-RSH=rsh; export RSH
-RCP=rcp; export RCP
-VERSION=2.5; export VERSION

+ 5 - 5
LibOS/shim/test/apps/lmbench/Makefile

@@ -66,11 +66,11 @@ test-graphene: all $(lmbench_config)
 		env LOADER=./pal_loader OS=linux RESULTS=results/graphene \
 		./results
 
-regress-graphene: all $(lmbench_config)
-	cp $(LMBENCHDIR)/scripts/lmbench-graphene-regress $(LMBENCHDIR)/bin/linux
-	cd $(LMBENCHDIR)/scripts && \
-		env LOADER=./pal_loader OS=linux RESULTS=results/graphene \
-		./results-regression
+regression: all
+	cp -f lmbench-regression $(LMBENCHDIR)/bin/linux
+	cd $(LMBENCHDIR)/bin/linux && \
+		env LOADER=./pal_loader OS=linux \
+		./lmbench-regression
 
 clean-lmbench:
 	$(MAKE) -C $(LMBENCHDIR) clean

+ 0 - 44
LibOS/shim/test/apps/lmbench/lmbench-2.5/scripts/results-regression

@@ -1,44 +0,0 @@
-#!/bin/sh
-
-# $Id$
-
-if [ -z "$OS" ]; then
-	OS=`../scripts/os`
-fi
-if [ -z "$CONFIG" ]; then
-	CONFIG=`../scripts/config`
-fi
-if [ -z "$RESULTS" ]; then
-	RESULTS=results/$OS
-fi
-BASE=../$RESULTS/`uname -n`
-EXT=0
-
-if [ ! -f "../bin/$OS/$CONFIG" ]
-then	echo "No config file?"
-	exit 1
-fi
-. ../bin/$OS/$CONFIG
-
-if [ ! -d ../$RESULTS ]
-then	mkdir -p ../$RESULTS
-fi
-RESULTS=$BASE.$EXT
-while [ -f $RESULTS ]
-do      EXT=`expr $EXT + 1`
-	RESULTS=$BASE.$EXT
-done
-
-cd ../bin/$OS 
-export OUTPUT
-echo Results going to ${RESULTS}
-./lmbench-graphene-regress $CONFIG 2>../${RESULTS}
-
-if [ X$MAIL = Xyes ]
-then	(echo Mailing results
-	echo ---- $INFO ---
-	cat $INFO 
-	echo ---- $RESULTS ---
-	cat ../$RESULTS) | mail lmbench2@bitmover.com 
-fi
-exit 0

+ 17 - 101
LibOS/shim/test/apps/lmbench/lmbench-2.5/scripts/lmbench-graphene-regress → LibOS/shim/test/apps/lmbench/lmbench-regression

@@ -19,8 +19,8 @@ N_RUNS=6
 
 if [ -f $1 ]
 then	. $1
-	echo Using config in $1 >> ${OUTPUT}
-else	echo Using defaults >> ${OUTPUT}
+	echo Using config in $1
+else	echo Using defaults
 	ENOUGH=1000000
 	TIMING_O=0
 	LOOP_O=0
@@ -29,7 +29,7 @@ export ENOUGH TIMING_O LOOP_O
 
 if [ X$FILE = X ]
 then	FILE=/tmp/XXX
-	touch $FILE || echo Can not create $FILE >> ${OUTPUT}
+	touch $FILE || echo Can not create $FILE
 fi
 if [ X$MB = X ]
 then	MB=8
@@ -110,7 +110,7 @@ STAT=$FSDIR/lmbench
 mkdir $FSDIR 2>/dev/null
 touch $STAT 2>/dev/null
 if [ ! -f $STAT ]
-then	echo "Can't make a file - $STAT - in $FSDIR" >> ${OUTPUT}
+then	echo "Can't make a file - $STAT - in $FSDIR"
 	touch $STAT
 	exit 1
 fi
@@ -123,8 +123,8 @@ function run {
 	cat $TMPOUT 1>&2
 }
 
-date >> ${OUTPUT}
-echo Latency measurements >> ${OUTPUT}
+date
+echo Latency measurements
 msleep 250
 run lat_syscall null
 run lat_syscall read
@@ -143,7 +143,7 @@ run lat_sig catch
 run lat_sig prot lat_sig
 
 #AF_UNIX
-echo AF_UNIX socket latency >> ${OUTPUT}
+echo AF_UNIX socket latency
 for i in $(eval echo "{1..$N_RUNS}")
 do	run lat_unix
 done
@@ -161,16 +161,16 @@ do	rm -f $FILE
 done
 
 #0,4,10KB create/delete
-date >> ${OUTPUT}
-	echo Calculating file system latency >> ${OUTPUT}
+date
+	echo Calculating file system latency
 	echo '"File system latency' 1>&2
 	run lat_fs $FSDIR
 	echo "" 1>&2
 
-date >> ${OUTPUT}
-echo Local netruning >> ${OUTPUT}
+date
+echo Local netruning
 
-echo UDP socket latency >> ${OUTPUT}
+echo UDP socket latency
 run lat_udp -s &
 sleep 3
 for i in $(eval echo "{1..$N_RUNS}")
@@ -180,7 +180,7 @@ done
 run lat_udp -127.0.0.1
 sleep 3
 
-echo TCP socket latency >> ${OUTPUT}
+echo TCP socket latency
 run lat_tcp -s &
 sleep 3
 for i in $(eval echo "{1..$N_RUNS}")
@@ -190,7 +190,7 @@ done
 run lat_tcp -127.0.0.1
 sleep 3
 
-echo TCP connect latency >> ${OUTPUT}
+echo TCP connect latency
 run lat_connect -s &
 sleep 3
 run lat_connect 127.0.0.1
@@ -198,7 +198,7 @@ sleep 1
 run lat_connect -127.0.0.1
 sleep 3
 
-echo TCP socket bandwidth >> ${OUTPUT}
+echo TCP socket bandwidth
 run bw_tcp -s &
 sleep 3
 for i in $(eval echo "{1..$N_RUNS}")
@@ -208,8 +208,8 @@ done
 run bw_tcp -127.0.0.1
 sleep 3
 
-date >> ${OUTPUT}
-echo Bandwidth measurements >> ${OUTPUT}
+date
+echo Bandwidth measurements
 
 for i in $(eval echo "{1..$N_RUNS}")
 do	run bw_unix
@@ -219,88 +219,4 @@ for i in $(eval echo "{1..$N_RUNS}")
 do	run bw_pipe
 done
 
-date >> ${OUTPUT}
-msleep 250
-echo Calculating context switch overhead >> ${OUTPUT}
-if [ $MB -ge 8 ]
-then	CTX="0 4 8 16 32 64"
-	N="2 4 8 16 24 32 64 96"
-else
-	CTX="0 4 8 16 32"
-	N="2 4 8 16 24 32 64 96"
-fi
-
-## dep: This test is currently flaky; for the moment, let's comment it out for regression testing
-#for size in $CTX
-#do	for i in $(eval echo "{1..$N_RUNS}")
-#	do	run lat_ctx -s $size $N
-#	done
-#done
-
-date >> ${OUTPUT}
-echo Calculating memory load latency >> ${OUTPUT}
-msleep 250
-echo "" 1>&2
-echo "Memory load latency" 1>&2
-if [ X$FASTMEM = XYES ]
-then	run lat_mem_rd $MB 128
-else	run lat_mem_rd $MB 16 32 64 128 256 512 1024 
-fi
-date >> ${OUTPUT}
-echo '' 1>&2
-echo \[`date`] 1>&2
-
-date >> ${OUTPUT}
-echo Calculating memory bandwidths >> ${OUTPUT}
-msleep 250
-
-echo "" 1>&2
-echo \"read bandwidth 1>&2
-for i in $ALL; do run bw_file_rd $i io_only $FILE; done
-echo "" 1>&2
-
-echo "" 1>&2
-echo \"read open2close bandwidth 1>&2
-for i in $ALL; do run bw_file_rd $i open2close $FILE; done
-echo "" 1>&2
-
-echo \"Mmap read bandwidth 1>&2
-for i in $ALL; do run bw_mmap_rd $i mmap_only $FILE; done
-echo "" 1>&2
-
-echo \"Mmap read open2close bandwidth 1>&2
-for i in $ALL; do run bw_mmap_rd $i open2close $FILE; done
-echo "" 1>&2
-rm -f $FILE
-
-echo \"libc bcopy unaligned 1>&2
-for i in $HALF; do run bw_mem $i bcopy; done; echo "" 1>&2
-
-echo \"libc bcopy aligned 1>&2
-for i in $HALF; do run bw_mem $i bcopy conflict; done; echo "" 1>&2
-
-echo \"unrolled bcopy unaligned 1>&2
-for i in $HALF; do run bw_mem $i fcp; done; echo "" 1>&2
-
-echo \"unrolled partial bcopy unaligned 1>&2
-for i in $HALF; do run bw_mem $i cp; done; echo "" 1>&2
-
-echo "Memory read bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i frd; done; echo "" 1>&2
-
-echo "Memory partial read bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i rd; done; echo "" 1>&2
-
-echo "Memory write bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i fwr; done; echo "" 1>&2
-
-echo "Memory partial write bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i wr; done; echo "" 1>&2
-
-echo "Memory partial read/write bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i rdwr; done; echo "" 1>&2
-
-echo "Memory bzero bandwidth" 1>&2
-for i in $ALL; do run bw_mem $i bzero; done; echo "" 1>&2
-
 exit 0

+ 0 - 6
LibOS/shim/test/apps/lmbench/manifest.template

@@ -40,11 +40,5 @@ sgx.allowed_files.tmp1 = file:/tmp
 sgx.allowed_files.tmp2 = file:/var/tmp
 sgx.allowed_files.inc = file:/usr/include/x86_64-linux-gnu/sys/types.h
 
-sgx.trusted_files.test1 = file:random.64K
-sgx.trusted_files.test2 = file:random.256K
-sgx.trusted_files.test3 = file:random.1M
-sgx.trusted_files.test4 = file:random.4M
-sgx.trusted_files.test5 = file:random.16M
-
 sgx.trusted_children.hello = file:hello.sig
 sgx.trusted_children.sh = file:sh.sig