Changeset b7f8cb4
- Timestamp:
- Nov 16, 2017, 12:26:09 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0cf5b79, 0fe4e62, 5f91d650
- Parents:
- 11094d9 (diff), c3d048c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r11094d9 rb7f8cb4 15 15 arch_name = '' 16 16 architecture = '' 17 17 18 18 do_alltests = false 19 19 do_benchmark = false … … 183 183 sh 'make clean > /dev/null' 184 184 sh 'make > /dev/null 2>&1' 185 } 185 } 186 186 catch (Exception caughtError) { 187 187 err = caughtError //rethrow error later … … 257 257 def build() { 258 258 build_stage('Build') { 259 259 260 260 def install_dir = pwd tmp: true 261 261 262 262 //Configure the conpilation (Output is not relevant) 263 263 //Use the current directory as the installation target so nothing … … 290 290 if( !do_benchmark ) return 291 291 292 //Write the commit id to Benchmark293 writeFile file: 'bench.csv', text:'data=' + gitRefNewValue + ',' + arch_name + ','294 295 292 //Append bench results 296 sh 'make -C src/benchmark --no-print-directory csv-data >> bench.csv'293 sh 'make -C src/benchmark --no-print-directory jenkins githash=' + gitRefNewValue + ' arch=' + arch_name + ' | tee bench.json' 297 294 } 298 295 } … … 327 324 328 325 //Then publish the results 329 sh 'curl - -silent --data @bench.csvhttp://plg2:8082/jenkins/publish > /dev/null || true'326 sh 'curl -H "Content-Type: application/json" --silent --data @bench.json http://plg2:8082/jenkins/publish > /dev/null || true' 330 327 } 331 328 } -
src/benchmark/Makefile.am
r11094d9 rb7f8cb4 23 23 STATS = ${TOOLSDIR}stat.py 24 24 repeats = 30 25 TIME_FORMAT = "%E" 26 PRINT_FORMAT = '%20s\t' 25 27 26 28 .NOTPARALLEL: … … 29 31 30 32 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 31 32 bench$(EXEEXT) :33 @for ccflags in "-debug" "-nodebug"; do \34 echo ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -lrt bench.c;\35 ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\36 ./a.out ; \37 done ; \38 rm -f ./a.out ;39 40 csv-data$(EXEEXT):41 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c42 @./a.out43 @rm -f ./a.out44 45 ## =========================================================================================================46 ctxswitch$(EXEEXT): \47 ctxswitch-pthread.run \48 ctxswitch-cfa_coroutine.run \49 ctxswitch-cfa_thread.run \50 ctxswitch-upp_coroutine.run \51 ctxswitch-upp_thread.run52 53 ctxswitch-cfa_coroutine$(EXEEXT):54 ${CC} ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}55 56 ctxswitch-cfa_thread$(EXEEXT):57 ${CC} ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}58 59 ctxswitch-upp_coroutine$(EXEEXT):60 u++ ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}61 62 ctxswitch-upp_thread$(EXEEXT):63 u++ ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}64 65 ctxswitch-pthread$(EXEEXT):66 @BACKEND_CC@ ctxswitch/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}67 68 ## =========================================================================================================69 mutex$(EXEEXT) :\70 mutex-function.run \71 mutex-pthread_lock.run \72 mutex-upp.run \73 mutex-cfa1.run \74 mutex-cfa2.run \75 mutex-cfa4.run76 77 mutex-function$(EXEEXT):78 @BACKEND_CC@ mutex/function.c -DBENCH_N=500000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}79 80 mutex-pthread_lock$(EXEEXT):81 @BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}82 83 mutex-upp$(EXEEXT):84 u++ mutex/upp.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}85 86 mutex-cfa1$(EXEEXT):87 ${CC} mutex/cfa1.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}88 89 mutex-cfa2$(EXEEXT):90 ${CC} mutex/cfa2.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}91 92 mutex-cfa4$(EXEEXT):93 ${CC} mutex/cfa4.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}94 95 ## =========================================================================================================96 signal$(EXEEXT) :\97 signal-upp.run \98 signal-cfa1.run \99 signal-cfa2.run \100 signal-cfa4.run101 102 signal-upp$(EXEEXT):103 u++ schedint/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}104 105 signal-cfa1$(EXEEXT):106 ${CC} schedint/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}107 108 signal-cfa2$(EXEEXT):109 ${CC} schedint/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}110 111 signal-cfa4$(EXEEXT):112 ${CC} schedint/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}113 114 ## =========================================================================================================115 waitfor$(EXEEXT) :\116 waitfor-upp.run \117 waitfor-cfa1.run \118 waitfor-cfa2.run \119 waitfor-cfa4.run120 121 waitfor-upp$(EXEEXT):122 u++ schedext/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}123 124 waitfor-cfa1$(EXEEXT):125 ${CC} schedext/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}126 127 waitfor-cfa2$(EXEEXT):128 ${CC} schedext/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}129 130 waitfor-cfa4$(EXEEXT):131 ${CC} schedext/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}132 133 ## =========================================================================================================134 creation$(EXEEXT) :\135 creation-pthread.run \136 creation-cfa_coroutine.run \137 creation-cfa_coroutine_eager.run \138 creation-cfa_thread.run \139 creation-upp_coroutine.run \140 creation-upp_thread.run141 142 creation-cfa_coroutine$(EXEEXT):143 ${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}144 145 creation-cfa_coroutine_eager$(EXEEXT):146 ${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER147 148 creation-cfa_thread$(EXEEXT):149 ${CC} creation/cfa_thrd.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}150 151 creation-upp_coroutine$(EXEEXT):152 u++ creation/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}153 154 creation-upp_thread$(EXEEXT):155 u++ creation/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}156 157 creation-pthread$(EXEEXT):158 @BACKEND_CC@ creation/pthreads.c -DBENCH_N=250000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}159 160 ## =========================================================================================================161 162 compile$(EXEEXT) :\163 compile-array$(EXEEXT) \164 compile-attributes$(EXEEXT) \165 compile-empty$(EXEEXT) \166 compile-expression$(EXEEXT) \167 compile-io$(EXEEXT) \168 compile-monitor$(EXEEXT) \169 compile-operators$(EXEEXT) \170 compile-thread$(EXEEXT) \171 compile-typeof$(EXEEXT)172 173 174 compile-array$(EXEEXT):175 @printf '%20s\t' $(subst compile-,,$@)176 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/array.c177 178 compile-attributes$(EXEEXT):179 @printf '%20s\t' $(subst compile-,,$@)180 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/attributes.c181 182 compile-empty$(EXEEXT):183 @printf '%20s\t' $(subst compile-,,$@)184 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w compile/empty.c185 186 compile-expression$(EXEEXT):187 @printf '%20s\t' $(subst compile-,,$@)188 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/expression.c189 190 compile-io$(EXEEXT):191 @printf '%20s\t' $(subst compile-,,$@)192 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/io.c193 194 compile-monitor$(EXEEXT):195 @printf '%20s\t' $(subst compile-,,$@)196 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/monitor.c197 198 compile-operators$(EXEEXT):199 @printf '%20s\t' $(subst compile-,,$@)200 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/operators.c201 202 compile-thread$(EXEEXT):203 @printf '%20s\t' $(subst compile-,,$@)204 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/thread.c205 206 compile-typeof$(EXEEXT):207 @printf '%20s\t' $(subst compile-,,$@)208 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/typeof.c209 210 211 ## =========================================================================================================212 33 213 34 %.run : %$(EXEEXT) ${REPEAT} … … 220 41 @rm -f a.out .result.log 221 42 43 %.runquiet : 44 @+make $(basename $@) 45 @./a.out 46 @rm -f a.out 47 48 %.make : 49 @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) 50 @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 51 222 52 ${REPEAT} : 223 53 @+make -C ${TOOLSDIR} repeat 54 55 ## ========================================================================================================= 56 57 jenkins$(EXEEXT): 58 @echo "{" 59 @echo -e '\t"githash": "'${githash}'",' 60 @echo -e '\t"arch": "' ${arch} '",' 61 @echo -e '\t"compile": {' 62 @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' 63 @echo -e '\t\t"dummy" : {}' 64 @echo -e '\t},' 65 @echo -e '\t"ctxswitch": {' 66 @echo -en '\t\t"coroutine":' 67 @+make ctxswitch-cfa_coroutine.runquiet 68 @echo -en '\t\t,"thread":' 69 @+make ctxswitch-cfa_thread.runquiet 70 @echo -e '\t},' 71 @echo -e '\t"mutex": [' 72 @echo -en '\t\t' 73 @+make mutex-cfa1.runquiet 74 @echo -en '\t\t,' 75 @+make mutex-cfa2.runquiet 76 @echo -e '\t],' 77 @echo -e '\t"scheduling": [' 78 @echo -en '\t\t' 79 @+make signal-cfa1.runquiet 80 @echo -en '\t\t,' 81 @+make signal-cfa2.runquiet 82 @echo -en '\t\t,' 83 @+make waitfor-cfa1.runquiet 84 @echo -en '\t\t,' 85 @+make waitfor-cfa2.runquiet 86 @echo -e '\n\t],' 87 @echo -e '\t"epoch": ' $(shell date +%s) 88 @echo "}" 89 90 ## ========================================================================================================= 91 ctxswitch$(EXEEXT): \ 92 ctxswitch-pthread.run \ 93 ctxswitch-cfa_coroutine.run \ 94 ctxswitch-cfa_thread.run \ 95 ctxswitch-upp_coroutine.run \ 96 ctxswitch-upp_thread.run 97 98 ctxswitch-cfa_coroutine$(EXEEXT): 99 @${CC} ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 100 101 ctxswitch-cfa_thread$(EXEEXT): 102 @${CC} ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 103 104 ctxswitch-upp_coroutine$(EXEEXT): 105 @u++ ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 106 107 ctxswitch-upp_thread$(EXEEXT): 108 @u++ ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 109 110 ctxswitch-pthread$(EXEEXT): 111 @@BACKEND_CC@ ctxswitch/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 112 113 ## ========================================================================================================= 114 mutex$(EXEEXT) :\ 115 mutex-function.run \ 116 mutex-pthread_lock.run \ 117 mutex-upp.run \ 118 mutex-cfa1.run \ 119 mutex-cfa2.run \ 120 mutex-cfa4.run 121 122 mutex-function$(EXEEXT): 123 @@BACKEND_CC@ mutex/function.c -DBENCH_N=500000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 124 125 mutex-pthread_lock$(EXEEXT): 126 @@BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 127 128 mutex-upp$(EXEEXT): 129 @u++ mutex/upp.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 130 131 mutex-cfa1$(EXEEXT): 132 @${CC} mutex/cfa1.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 133 134 mutex-cfa2$(EXEEXT): 135 @${CC} mutex/cfa2.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 136 137 mutex-cfa4$(EXEEXT): 138 @${CC} mutex/cfa4.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 139 140 ## ========================================================================================================= 141 signal$(EXEEXT) :\ 142 signal-upp.run \ 143 signal-cfa1.run \ 144 signal-cfa2.run \ 145 signal-cfa4.run 146 147 signal-upp$(EXEEXT): 148 @u++ schedint/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 149 150 signal-cfa1$(EXEEXT): 151 @${CC} schedint/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 152 153 signal-cfa2$(EXEEXT): 154 @${CC} schedint/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 155 156 signal-cfa4$(EXEEXT): 157 @${CC} schedint/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 158 159 ## ========================================================================================================= 160 waitfor$(EXEEXT) :\ 161 waitfor-upp.run \ 162 waitfor-cfa1.run \ 163 waitfor-cfa2.run \ 164 waitfor-cfa4.run 165 166 waitfor-upp$(EXEEXT): 167 @u++ schedext/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 168 169 waitfor-cfa1$(EXEEXT): 170 @${CC} schedext/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 171 172 waitfor-cfa2$(EXEEXT): 173 @${CC} schedext/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 174 175 waitfor-cfa4$(EXEEXT): 176 @${CC} schedext/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 177 178 ## ========================================================================================================= 179 creation$(EXEEXT) :\ 180 creation-pthread.run \ 181 creation-cfa_coroutine.run \ 182 creation-cfa_coroutine_eager.run \ 183 creation-cfa_thread.run \ 184 creation-upp_coroutine.run \ 185 creation-upp_thread.run 186 187 creation-cfa_coroutine$(EXEEXT): 188 @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 189 190 creation-cfa_coroutine_eager$(EXEEXT): 191 @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER 192 193 creation-cfa_thread$(EXEEXT): 194 @${CC} creation/cfa_thrd.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 195 196 creation-upp_coroutine$(EXEEXT): 197 @u++ creation/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 198 199 creation-upp_thread$(EXEEXT): 200 @u++ creation/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 201 202 creation-pthread$(EXEEXT): 203 @@BACKEND_CC@ creation/pthreads.c -DBENCH_N=250000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 204 205 ## ========================================================================================================= 206 207 compile$(EXEEXT) :\ 208 compile-array.make \ 209 compile-attributes.make \ 210 compile-empty.make \ 211 compile-expression.make \ 212 compile-io.make \ 213 compile-monitor.make \ 214 compile-operators.make \ 215 compile-typeof.make 216 217 218 compile-array$(EXEEXT): 219 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/array.c 220 221 compile-attributes$(EXEEXT): 222 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/attributes.c 223 224 compile-empty$(EXEEXT): 225 @${CC} -nodebug -quiet -fsyntax-only -w compile/empty.c 226 227 compile-expression$(EXEEXT): 228 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/expression.c 229 230 compile-io$(EXEEXT): 231 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/io.c 232 233 compile-monitor$(EXEEXT): 234 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/monitor.c 235 236 compile-operators$(EXEEXT): 237 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/operators.c 238 239 compile-thread$(EXEEXT): 240 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/thread.c 241 242 compile-typeof$(EXEEXT): 243 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/typeof.c 244 -
src/benchmark/Makefile.in
r11094d9 rb7f8cb4 253 253 STATS = ${TOOLSDIR}stat.py 254 254 repeats = 30 255 TIME_FORMAT = "%E" 256 PRINT_FORMAT = '%20s\t' 255 257 all: all-am 256 258 … … 446 448 all : ctxswitch$(EXEEXT) mutex$(EXEEXT) signal$(EXEEXT) waitfor$(EXEEXT) creation$(EXEEXT) 447 449 448 bench$(EXEEXT) :449 @for ccflags in "-debug" "-nodebug"; do \450 echo ${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -lrt bench.c;\451 ${CC} ${AM_CFLAGS} ${CFLAGS} $${ccflags} -lrt bench.c;\452 ./a.out ; \453 done ; \454 rm -f ./a.out ;455 456 csv-data$(EXEEXT):457 @${CC} ${AM_CFLAGS} ${CFLAGS} ${ccflags} @CFA_FLAGS@ -nodebug -lrt -quiet -DN=50000000 csv-data.c458 @./a.out459 @rm -f ./a.out460 461 ctxswitch$(EXEEXT): \462 ctxswitch-pthread.run \463 ctxswitch-cfa_coroutine.run \464 ctxswitch-cfa_thread.run \465 ctxswitch-upp_coroutine.run \466 ctxswitch-upp_thread.run467 468 ctxswitch-cfa_coroutine$(EXEEXT):469 ${CC} ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}470 471 ctxswitch-cfa_thread$(EXEEXT):472 ${CC} ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}473 474 ctxswitch-upp_coroutine$(EXEEXT):475 u++ ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}476 477 ctxswitch-upp_thread$(EXEEXT):478 u++ ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}479 480 ctxswitch-pthread$(EXEEXT):481 @BACKEND_CC@ ctxswitch/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}482 483 mutex$(EXEEXT) :\484 mutex-function.run \485 mutex-pthread_lock.run \486 mutex-upp.run \487 mutex-cfa1.run \488 mutex-cfa2.run \489 mutex-cfa4.run490 491 mutex-function$(EXEEXT):492 @BACKEND_CC@ mutex/function.c -DBENCH_N=500000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}493 494 mutex-pthread_lock$(EXEEXT):495 @BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}496 497 mutex-upp$(EXEEXT):498 u++ mutex/upp.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}499 500 mutex-cfa1$(EXEEXT):501 ${CC} mutex/cfa1.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}502 503 mutex-cfa2$(EXEEXT):504 ${CC} mutex/cfa2.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}505 506 mutex-cfa4$(EXEEXT):507 ${CC} mutex/cfa4.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}508 509 signal$(EXEEXT) :\510 signal-upp.run \511 signal-cfa1.run \512 signal-cfa2.run \513 signal-cfa4.run514 515 signal-upp$(EXEEXT):516 u++ schedint/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}517 518 signal-cfa1$(EXEEXT):519 ${CC} schedint/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}520 521 signal-cfa2$(EXEEXT):522 ${CC} schedint/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}523 524 signal-cfa4$(EXEEXT):525 ${CC} schedint/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}526 527 waitfor$(EXEEXT) :\528 waitfor-upp.run \529 waitfor-cfa1.run \530 waitfor-cfa2.run \531 waitfor-cfa4.run532 533 waitfor-upp$(EXEEXT):534 u++ schedext/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}535 536 waitfor-cfa1$(EXEEXT):537 ${CC} schedext/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}538 539 waitfor-cfa2$(EXEEXT):540 ${CC} schedext/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}541 542 waitfor-cfa4$(EXEEXT):543 ${CC} schedext/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}544 545 creation$(EXEEXT) :\546 creation-pthread.run \547 creation-cfa_coroutine.run \548 creation-cfa_coroutine_eager.run \549 creation-cfa_thread.run \550 creation-upp_coroutine.run \551 creation-upp_thread.run552 553 creation-cfa_coroutine$(EXEEXT):554 ${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}555 556 creation-cfa_coroutine_eager$(EXEEXT):557 ${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER558 559 creation-cfa_thread$(EXEEXT):560 ${CC} creation/cfa_thrd.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags}561 562 creation-upp_coroutine$(EXEEXT):563 u++ creation/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}564 565 creation-upp_thread$(EXEEXT):566 u++ creation/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags}567 568 creation-pthread$(EXEEXT):569 @BACKEND_CC@ creation/pthreads.c -DBENCH_N=250000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags}570 571 compile$(EXEEXT) :\572 compile-array$(EXEEXT) \573 compile-attributes$(EXEEXT) \574 compile-empty$(EXEEXT) \575 compile-expression$(EXEEXT) \576 compile-io$(EXEEXT) \577 compile-monitor$(EXEEXT) \578 compile-operators$(EXEEXT) \579 compile-thread$(EXEEXT) \580 compile-typeof$(EXEEXT) \581 compile-vector_test$(EXEEXT)582 583 compile-array$(EXEEXT):584 @printf '%20s\t' $(subst compile-,,$@)585 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/array.c586 587 compile-attributes$(EXEEXT):588 @printf '%20s\t' $(subst compile-,,$@)589 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/attributes.c590 591 compile-empty$(EXEEXT):592 @printf '%20s\t' $(subst compile-,,$@)593 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w compile/empty.c594 595 compile-expression$(EXEEXT):596 @printf '%20s\t' $(subst compile-,,$@)597 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/expression.c598 599 compile-io$(EXEEXT):600 @printf '%20s\t' $(subst compile-,,$@)601 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/io.c602 603 compile-monitor$(EXEEXT):604 @printf '%20s\t' $(subst compile-,,$@)605 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/monitor.c606 607 compile-operators$(EXEEXT):608 @printf '%20s\t' $(subst compile-,,$@)609 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/operators.c610 611 compile-thread$(EXEEXT):612 @printf '%20s\t' $(subst compile-,,$@)613 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/thread.c614 615 compile-typeof$(EXEEXT):616 @printf '%20s\t' $(subst compile-,,$@)617 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/typeof.c618 619 compile-vector_test$(EXEEXT):620 @printf '%20s\t' $(subst compile-,,$@)621 @/usr/bin/time -f "%E" ${CC} -quiet -fsyntax-only -w ../tests/vector_test.c622 623 450 %.run : %$(EXEEXT) ${REPEAT} 624 451 @rm -f .result.log … … 630 457 @rm -f a.out .result.log 631 458 459 %.runquiet : 460 @+make $(basename $@) 461 @./a.out 462 @rm -f a.out 463 464 %.make : 465 @printf "${PRINT_FORMAT}" $(basename $(subst compile-,,$@)) 466 @+/usr/bin/time -f ${TIME_FORMAT} make $(basename $@) 2>&1 467 632 468 ${REPEAT} : 633 469 @+make -C ${TOOLSDIR} repeat 470 471 jenkins$(EXEEXT): 472 @echo "{" 473 @echo -e '\t"githash": "'${githash}'",' 474 @echo -e '\t"arch": "' ${arch} '",' 475 @echo -e '\t"compile": {' 476 @+make compile TIME_FORMAT='%e,' PRINT_FORMAT='\t\t\"%s\" :' 477 @echo -e '\t\t"dummy" : {}' 478 @echo -e '\t},' 479 @echo -e '\t"ctxswitch": {' 480 @echo -en '\t\t"coroutine":' 481 @+make ctxswitch-cfa_coroutine.runquiet 482 @echo -en '\t\t,"thread":' 483 @+make ctxswitch-cfa_thread.runquiet 484 @echo -e '\t},' 485 @echo -e '\t"mutex": [' 486 @echo -en '\t\t' 487 @+make mutex-cfa1.runquiet 488 @echo -en '\t\t,' 489 @+make mutex-cfa2.runquiet 490 @echo -e '\t],' 491 @echo -e '\t"scheduling": [' 492 @echo -en '\t\t' 493 @+make signal-cfa1.runquiet 494 @echo -en '\t\t,' 495 @+make signal-cfa2.runquiet 496 @echo -en '\t\t,' 497 @+make waitfor-cfa1.runquiet 498 @echo -en '\t\t,' 499 @+make waitfor-cfa2.runquiet 500 @echo -e '\n\t],' 501 @echo -e '\t"epoch": ' $(shell date +%s) 502 @echo "}" 503 504 ctxswitch$(EXEEXT): \ 505 ctxswitch-pthread.run \ 506 ctxswitch-cfa_coroutine.run \ 507 ctxswitch-cfa_thread.run \ 508 ctxswitch-upp_coroutine.run \ 509 ctxswitch-upp_thread.run 510 511 ctxswitch-cfa_coroutine$(EXEEXT): 512 @${CC} ctxswitch/cfa_cor.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 513 514 ctxswitch-cfa_thread$(EXEEXT): 515 @${CC} ctxswitch/cfa_thrd.c -DBENCH_N=50000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 516 517 ctxswitch-upp_coroutine$(EXEEXT): 518 @u++ ctxswitch/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 519 520 ctxswitch-upp_thread$(EXEEXT): 521 @u++ ctxswitch/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 522 523 ctxswitch-pthread$(EXEEXT): 524 @@BACKEND_CC@ ctxswitch/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 525 526 mutex$(EXEEXT) :\ 527 mutex-function.run \ 528 mutex-pthread_lock.run \ 529 mutex-upp.run \ 530 mutex-cfa1.run \ 531 mutex-cfa2.run \ 532 mutex-cfa4.run 533 534 mutex-function$(EXEEXT): 535 @@BACKEND_CC@ mutex/function.c -DBENCH_N=500000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 536 537 mutex-pthread_lock$(EXEEXT): 538 @@BACKEND_CC@ mutex/pthreads.c -DBENCH_N=50000000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 539 540 mutex-upp$(EXEEXT): 541 @u++ mutex/upp.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 542 543 mutex-cfa1$(EXEEXT): 544 @${CC} mutex/cfa1.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 545 546 mutex-cfa2$(EXEEXT): 547 @${CC} mutex/cfa2.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 548 549 mutex-cfa4$(EXEEXT): 550 @${CC} mutex/cfa4.c -DBENCH_N=5000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 551 552 signal$(EXEEXT) :\ 553 signal-upp.run \ 554 signal-cfa1.run \ 555 signal-cfa2.run \ 556 signal-cfa4.run 557 558 signal-upp$(EXEEXT): 559 @u++ schedint/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 560 561 signal-cfa1$(EXEEXT): 562 @${CC} schedint/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 563 564 signal-cfa2$(EXEEXT): 565 @${CC} schedint/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 566 567 signal-cfa4$(EXEEXT): 568 @${CC} schedint/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 569 570 waitfor$(EXEEXT) :\ 571 waitfor-upp.run \ 572 waitfor-cfa1.run \ 573 waitfor-cfa2.run \ 574 waitfor-cfa4.run 575 576 waitfor-upp$(EXEEXT): 577 @u++ schedext/upp.cc -DBENCH_N=5000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 578 579 waitfor-cfa1$(EXEEXT): 580 @${CC} schedext/cfa1.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 581 582 waitfor-cfa2$(EXEEXT): 583 @${CC} schedext/cfa2.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 584 585 waitfor-cfa4$(EXEEXT): 586 @${CC} schedext/cfa4.c -DBENCH_N=500000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 587 588 creation$(EXEEXT) :\ 589 creation-pthread.run \ 590 creation-cfa_coroutine.run \ 591 creation-cfa_coroutine_eager.run \ 592 creation-cfa_thread.run \ 593 creation-upp_coroutine.run \ 594 creation-upp_thread.run 595 596 creation-cfa_coroutine$(EXEEXT): 597 @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 598 599 creation-cfa_coroutine_eager$(EXEEXT): 600 @${CC} creation/cfa_cor.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} -DEAGER 601 602 creation-cfa_thread$(EXEEXT): 603 @${CC} creation/cfa_thrd.c -DBENCH_N=10000000 -I. -nodebug -lrt -quiet @CFA_FLAGS@ ${AM_CFLAGS} ${CFLAGS} ${ccflags} 604 605 creation-upp_coroutine$(EXEEXT): 606 @u++ creation/upp_cor.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 607 608 creation-upp_thread$(EXEEXT): 609 @u++ creation/upp_thrd.cc -DBENCH_N=50000000 -I. -nodebug -lrt -quiet ${AM_CFLAGS} ${CFLAGS} ${ccflags} 610 611 creation-pthread$(EXEEXT): 612 @@BACKEND_CC@ creation/pthreads.c -DBENCH_N=250000 -I. -lrt -pthread ${AM_CFLAGS} ${CFLAGS} ${ccflags} 613 614 compile$(EXEEXT) :\ 615 compile-array.make \ 616 compile-attributes.make \ 617 compile-empty.make \ 618 compile-expression.make \ 619 compile-io.make \ 620 compile-monitor.make \ 621 compile-operators.make \ 622 compile-typeof.make 623 624 compile-array$(EXEEXT): 625 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/array.c 626 627 compile-attributes$(EXEEXT): 628 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/attributes.c 629 630 compile-empty$(EXEEXT): 631 @${CC} -nodebug -quiet -fsyntax-only -w compile/empty.c 632 633 compile-expression$(EXEEXT): 634 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/expression.c 635 636 compile-io$(EXEEXT): 637 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/io.c 638 639 compile-monitor$(EXEEXT): 640 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/monitor.c 641 642 compile-operators$(EXEEXT): 643 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/operators.c 644 645 compile-thread$(EXEEXT): 646 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/thread.c 647 648 compile-typeof$(EXEEXT): 649 @${CC} -nodebug -quiet -fsyntax-only -w ../tests/typeof.c 634 650 635 651 # Tell versions [3.59,3.63) of GNU make to not export all variables. -
src/benchmark/csv-data.c
r11094d9 rb7f8cb4 28 28 // coroutine context switch 29 29 long long int measure_coroutine() { 30 const unsigned int NoOfTimes = N;30 const unsigned int NoOfTimes = 50000000; 31 31 long long int StartTime, EndTime; 32 32 … … 43 43 // thread context switch 44 44 long long int measure_thread() { 45 const unsigned int NoOfTimes = N;45 const unsigned int NoOfTimes = 50000000; 46 46 long long int StartTime, EndTime; 47 47 … … 61 61 62 62 long long int measure_1_monitor_entry() { 63 const unsigned int NoOfTimes = N;63 const unsigned int NoOfTimes = 5000000; 64 64 long long int StartTime, EndTime; 65 65 mon_t mon; … … 79 79 80 80 long long int measure_2_monitor_entry() { 81 const unsigned int NoOfTimes = N;81 const unsigned int NoOfTimes = 5000000; 82 82 long long int StartTime, EndTime; 83 83 mon_t mon1, mon2; … … 94 94 //----------------------------------------------------------------------------- 95 95 // single internal sched entry 96 const unsigned int NoOfTimes = 500000; 97 96 98 mon_t mon1; 97 99 … … 107 109 108 110 void side1A( mon_t & mutex a, long long int * out ) { 111 const unsigned int NoOfTimes = 500000; 109 112 long long int StartTime, EndTime; 110 113 … … 112 115 for( int i = 0;; i++ ) { 113 116 signal(cond1a); 114 if( i > N ) break;117 if( i > NoOfTimes ) break; 115 118 wait(cond1b); 116 119 } 117 120 EndTime = Time(); 118 121 119 *out = ( EndTime - StartTime ) / N ;122 *out = ( EndTime - StartTime ) / NoOfTimes; 120 123 } 121 124 … … 141 144 142 145 //----------------------------------------------------------------------------- 143 // multi internal sched entry146 // multi internal sched 144 147 mon_t mon2; 145 148 … … 155 158 156 159 void side2A( mon_t & mutex a, mon_t & mutex b, long long int * out ) { 160 const unsigned int NoOfTimes = 500000; 157 161 long long int StartTime, EndTime; 158 162 … … 160 164 for( int i = 0;; i++ ) { 161 165 signal(cond2a); 162 if( i > N ) break;166 if( i > NoOfTimes ) break; 163 167 wait(cond2b); 164 168 } 165 169 EndTime = Time(); 166 170 167 *out = ( EndTime - StartTime ) / N ;171 *out = ( EndTime - StartTime ) / NoOfTimes; 168 172 } 169 173 … … 189 193 190 194 //----------------------------------------------------------------------------- 195 // single external sched 196 197 volatile int go = 0; 198 199 void __attribute__((noinline)) call( mon_t & mutex m1 ) {} 200 201 long long int __attribute__((noinline)) wait( mon_t & mutex m1 ) { 202 go = 1; 203 const unsigned int NoOfTimes = 5000000; 204 long long int StartTime, EndTime; 205 206 StartTime = Time(); 207 for (size_t i = 0; i < NoOfTimes; i++) { 208 waitfor(call, m1); 209 } 210 211 EndTime = Time(); 212 go = 0; 213 return ( EndTime - StartTime ) / NoOfTimes; 214 } 215 216 thread thrd3 {}; 217 void ^?{}( thrd3 & mutex this ) {} 218 void main( thrd3 & this ) { 219 while(go == 0) { yield(); } 220 while(go == 1) { call(mon1); } 221 222 } 223 224 long long int measure_1_sched_ext() { 225 go = 0; 226 thrd3 t; 227 return wait(mon1); 228 } 229 230 //----------------------------------------------------------------------------- 231 // multi external sched 232 233 void __attribute__((noinline)) call( mon_t & mutex m1, mon_t & mutex m2 ) {} 234 235 long long int __attribute__((noinline)) wait( mon_t & mutex m1, mon_t & mutex m2 ) { 236 go = 1; 237 const unsigned int NoOfTimes = 5000000; 238 long long int StartTime, EndTime; 239 240 StartTime = Time(); 241 for (size_t i = 0; i < NoOfTimes; i++) { 242 waitfor(call, m1, m2); 243 } 244 245 EndTime = Time(); 246 go = 0; 247 return ( EndTime - StartTime ) / NoOfTimes; 248 } 249 250 thread thrd4 {}; 251 void ^?{}( thrd4 & mutex this ) {} 252 void main( thrd4 & this ) { 253 while(go == 0) { yield(); } 254 while(go == 1) { call(mon1, mon2); } 255 256 } 257 258 long long int measure_2_sched_ext() { 259 go = 0; 260 thrd3 t; 261 return wait(mon1, mon2); 262 } 263 264 //----------------------------------------------------------------------------- 191 265 // main loop 192 266 int main() 193 267 { 194 sout | time(NULL) | ','; 195 sout | measure_coroutine() | ','; 196 sout | measure_thread() | ','; 197 sout | measure_1_monitor_entry() | ','; 198 sout | measure_2_monitor_entry() | ','; 199 sout | measure_1_sched_int() | ','; 200 sout | measure_2_sched_int() | endl; 201 } 268 sout | "\tepoch:" | time(NULL) | ',' | endl; 269 sout | "\tctxswitch: {" | endl; 270 sout | "\t\tcoroutine: "| measure_coroutine() | ',' | endl; 271 sout | "\t\tthread:" | measure_thread() | ',' | endl; 272 sout | "\t}," | endl; 273 sout | "\tmutex: [" | measure_1_monitor_entry() | ',' | measure_2_monitor_entry() | "]," | endl; 274 sout | "\tscheduling: ["| measure_1_sched_int() | ',' | measure_2_sched_int() | ',' | 275 measure_1_sched_ext() | ',' | measure_2_sched_ext() | "]," | endl; 276 }
Note: See TracChangeset
for help on using the changeset viewer.