lmbench-graphene-regress 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. #!/bin/bash
  2. # lmbench - run the lmbench benchmark suite.
  3. #
  4. # Hacked by Larry McVoy (lm@sun.com, lm@sgi.com, lm@bitmover.com).
  5. # Copyright (c) 1994 Larry McVoy. GPLed software.
  6. # $Id$
  7. # Make sure we can find: ./cmd, df, and netstat
  8. PATH=.:../../scripts:$PATH:/etc:/usr/etc:/sbin:/usr/sbin
  9. export PATH
  10. echo PATH = $PATH
  11. echo lat_syscall = `readlink -f lat_syscall`
  12. # lat_unix, lat_udp, lat_tcp only do one run!!!
  13. # we loop to repeat the tests
  14. N_RUNS=6
  15. if [ -f $1 ]
  16. then . $1
  17. echo Using config in $1 >> ${OUTPUT}
  18. else echo Using defaults >> ${OUTPUT}
  19. ENOUGH=1000000
  20. TIMING_O=0
  21. LOOP_O=0
  22. fi
  23. export ENOUGH TIMING_O LOOP_O
  24. if [ X$FILE = X ]
  25. then FILE=/tmp/XXX
  26. touch $FILE || echo Can not create $FILE >> ${OUTPUT}
  27. fi
  28. if [ X$MB = X ]
  29. then MB=8
  30. fi
  31. AVAILKB=`expr $MB \* 1024`
  32. # Figure out how big we can go for stuff that wants to use
  33. # all and half of memory.
  34. HALF="512 1k 2k 4k 8k 16k 32k 64k 128k 256k 512k 1m"
  35. ALL="$HALF 2m"
  36. i=4
  37. while [ $i -le $MB ]
  38. do
  39. ALL="$ALL ${i}m"
  40. h=`expr $i / 2`
  41. HALF="$HALF ${h}m"
  42. i=`expr $i \* 2`
  43. done
  44. if [ X$FSDIR = X ]
  45. then FSDIR=/tmp/lat_fs
  46. fi
  47. MP=N
  48. # Figure out as much stuff as we can about this system.
  49. # Sure would be nice if everyone had SGI's "hinv".
  50. echo \[lmbench2.0 results for `uname -a`] 1>&2
  51. echo \[ALL: ${ALL}] 1>&2
  52. echo \[DISKS: ${DISKS}] 1>&2
  53. echo \[DISK_DESC: ${DISK_DESC}] 1>&2
  54. echo \[ENOUGH: ${ENOUGH}] 1>&2
  55. echo \[FAST: ${FAST}] 1>&2
  56. echo \[FASTMEM: ${FASTMEM}] 1>&2
  57. echo \[FILE: ${FILE}] 1>&2
  58. echo \[FSDIR: ${FSDIR}] 1>&2
  59. echo \[HALF: ${HALF}] 1>&2
  60. echo \[INFO: ${INFO}] 1>&2
  61. echo \[LOOP_O: ${LOOP_O}] 1>&2
  62. echo \[MB: ${MB}] 1>&2
  63. echo \[MHZ: ${MHZ}] 1>&2
  64. echo \[MOTHERBOARD: ${MOTHERBOARD}] 1>&2
  65. echo \[NETrunS: ${NETrunS}] 1>&2
  66. echo \[PROCESSORS: ${PROCESSORS}] 1>&2
  67. echo \[REMOTE: ${REMOTE}] 1>&2
  68. echo \[SLOWFS: ${SLOWFS}] 1>&2
  69. echo \[OS: ${OS}] 1>&2
  70. echo \[TIMING_O: ${TIMING_O}] 1>&2
  71. echo \[LMBENCH VERSION: ${VERSION}] 1>&2
  72. echo \[USER: $USER] 1>&2
  73. echo \[HOSTNAME: `hostname`] 1>&2
  74. echo \[NODENAME: `uname -n`] 1>&2
  75. echo \[SYSNAME: `uname -s`] 1>&2
  76. echo \[PROCESSOR: `uname -p`] 1>&2
  77. echo \[MACHINE: `uname -m`] 1>&2
  78. echo \[RELEASE: `uname -r`] 1>&2
  79. echo \[VERSION: `uname -v`] 1>&2
  80. #if 0
  81. echo \[`date`] 1>&2
  82. echo \[`uptime`] 1>&2
  83. netstat -i | while read i
  84. do echo \[net: "$i"] 1>&2
  85. set `echo $i`
  86. case $1 in
  87. *ame) ;;
  88. *) ifconfig $1 | while read i
  89. do echo \[if: "$i"] 1>&2
  90. done
  91. ;;
  92. esac
  93. done
  94. mount | while read i
  95. do echo \[mount: "$i"] 1>&2
  96. done
  97. STAT=$FSDIR/lmbench
  98. mkdir $FSDIR 2>/dev/null
  99. touch $STAT 2>/dev/null
  100. if [ ! -f $STAT ]
  101. then echo "Can't make a file - $STAT - in $FSDIR" >> ${OUTPUT}
  102. touch $STAT
  103. exit 1
  104. fi
  105. function run {
  106. echo "$@"
  107. TMPOUT=/tmp/OUT
  108. rm -rf $TMPOUT
  109. $LOADER "$@" 2>>$TMPOUT | tee -a $TMPOUT
  110. cat $TMPOUT 1>&2
  111. }
  112. date >> ${OUTPUT}
  113. echo Latency measurements >> ${OUTPUT}
  114. msleep 250
  115. run lat_syscall null
  116. run lat_syscall read
  117. run lat_syscall write
  118. run lat_syscall stat $STAT
  119. run lat_syscall fstat $STAT
  120. run lat_syscall open $STAT
  121. #select file (500), select tcp (500)
  122. run lat_select file 500
  123. run lat_select tcp 500
  124. #sig install, sig_overhead, prot. Fault
  125. run lat_sig install
  126. run lat_sig catch
  127. run lat_sig prot lat_sig
  128. #AF_UNIX
  129. echo AF_UNIX socket latency >> ${OUTPUT}
  130. for i in $(eval echo "{1..$N_RUNS}")
  131. do run lat_unix
  132. done
  133. #forks
  134. cp hello /tmp/hello
  135. for i in fork dfork vfork exec dforkexec shell
  136. do run lat_proc $i
  137. done
  138. rm -f /tmp/hello
  139. for i in $(eval echo "{1..$N_RUNS}")
  140. do rm -f $FILE
  141. run lmdd label="File $FILE write bandwidth:" of=$FILE move=${MB}m fsync=1 print=3
  142. done
  143. #0,4,10KB create/delete
  144. date >> ${OUTPUT}
  145. echo Calculating file system latency >> ${OUTPUT}
  146. echo '"File system latency' 1>&2
  147. run lat_fs $FSDIR
  148. echo "" 1>&2
  149. date >> ${OUTPUT}
  150. echo Local netruning >> ${OUTPUT}
  151. echo UDP socket latency >> ${OUTPUT}
  152. run lat_udp -s &
  153. sleep 3
  154. for i in $(eval echo "{1..$N_RUNS}")
  155. do run lat_udp 127.0.0.1
  156. sleep 1
  157. done
  158. run lat_udp -127.0.0.1
  159. sleep 3
  160. echo TCP socket latency >> ${OUTPUT}
  161. run lat_tcp -s &
  162. sleep 3
  163. for i in $(eval echo "{1..$N_RUNS}")
  164. do run lat_tcp 127.0.0.1
  165. sleep 1
  166. done
  167. run lat_tcp -127.0.0.1
  168. sleep 3
  169. echo TCP connect latency >> ${OUTPUT}
  170. run lat_connect -s &
  171. sleep 3
  172. run lat_connect 127.0.0.1
  173. sleep 1
  174. run lat_connect -127.0.0.1
  175. sleep 3
  176. echo TCP socket bandwidth >> ${OUTPUT}
  177. run bw_tcp -s &
  178. sleep 3
  179. for i in $(eval echo "{1..$N_RUNS}")
  180. do run bw_tcp 127.0.0.1
  181. sleep 1
  182. done
  183. run bw_tcp -127.0.0.1
  184. sleep 3
  185. date >> ${OUTPUT}
  186. echo Bandwidth measurements >> ${OUTPUT}
  187. for i in $(eval echo "{1..$N_RUNS}")
  188. do run bw_unix
  189. done
  190. for i in $(eval echo "{1..$N_RUNS}")
  191. do run bw_pipe
  192. done
  193. date >> ${OUTPUT}
  194. msleep 250
  195. echo Calculating context switch overhead >> ${OUTPUT}
  196. if [ $MB -ge 8 ]
  197. then CTX="0 4 8 16 32 64"
  198. N="2 4 8 16 24 32 64 96"
  199. else
  200. CTX="0 4 8 16 32"
  201. N="2 4 8 16 24 32 64 96"
  202. fi
  203. ## dep: This test is currently flaky; for the moment, let's comment it out for regression testing
  204. #for size in $CTX
  205. #do for i in $(eval echo "{1..$N_RUNS}")
  206. # do run lat_ctx -s $size $N
  207. # done
  208. #done
  209. date >> ${OUTPUT}
  210. echo Calculating memory load latency >> ${OUTPUT}
  211. msleep 250
  212. echo "" 1>&2
  213. echo "Memory load latency" 1>&2
  214. if [ X$FASTMEM = XYES ]
  215. then run lat_mem_rd $MB 128
  216. else run lat_mem_rd $MB 16 32 64 128 256 512 1024
  217. fi
  218. date >> ${OUTPUT}
  219. echo '' 1>&2
  220. echo \[`date`] 1>&2
  221. date >> ${OUTPUT}
  222. echo Calculating memory bandwidths >> ${OUTPUT}
  223. msleep 250
  224. echo "" 1>&2
  225. echo \"read bandwidth 1>&2
  226. for i in $ALL; do run bw_file_rd $i io_only $FILE; done
  227. echo "" 1>&2
  228. echo "" 1>&2
  229. echo \"read open2close bandwidth 1>&2
  230. for i in $ALL; do run bw_file_rd $i open2close $FILE; done
  231. echo "" 1>&2
  232. echo \"Mmap read bandwidth 1>&2
  233. for i in $ALL; do run bw_mmap_rd $i mmap_only $FILE; done
  234. echo "" 1>&2
  235. echo \"Mmap read open2close bandwidth 1>&2
  236. for i in $ALL; do run bw_mmap_rd $i open2close $FILE; done
  237. echo "" 1>&2
  238. rm -f $FILE
  239. echo \"libc bcopy unaligned 1>&2
  240. for i in $HALF; do run bw_mem $i bcopy; done; echo "" 1>&2
  241. echo \"libc bcopy aligned 1>&2
  242. for i in $HALF; do run bw_mem $i bcopy conflict; done; echo "" 1>&2
  243. echo \"unrolled bcopy unaligned 1>&2
  244. for i in $HALF; do run bw_mem $i fcp; done; echo "" 1>&2
  245. echo \"unrolled partial bcopy unaligned 1>&2
  246. for i in $HALF; do run bw_mem $i cp; done; echo "" 1>&2
  247. echo "Memory read bandwidth" 1>&2
  248. for i in $ALL; do run bw_mem $i frd; done; echo "" 1>&2
  249. echo "Memory partial read bandwidth" 1>&2
  250. for i in $ALL; do run bw_mem $i rd; done; echo "" 1>&2
  251. echo "Memory write bandwidth" 1>&2
  252. for i in $ALL; do run bw_mem $i fwr; done; echo "" 1>&2
  253. echo "Memory partial write bandwidth" 1>&2
  254. for i in $ALL; do run bw_mem $i wr; done; echo "" 1>&2
  255. echo "Memory partial read/write bandwidth" 1>&2
  256. for i in $ALL; do run bw_mem $i rdwr; done; echo "" 1>&2
  257. echo "Memory bzero bandwidth" 1>&2
  258. for i in $ALL; do run bw_mem $i bzero; done; echo "" 1>&2
  259. exit 0