44// Note that the parameters will be set as env variables so we cannot use names that conflict
55// with the engineering system parameter names.
66
7- // -------------------------- Globals ---------------------------------//
8-
9- def validTestFolders = [
10- ' Benchstones' ,
11- ' BenchmarksGame' ,
12- ' Bytemark' ,
13- ' Math' ,
14- ' Span' ,
15- ' first half' ,
16- ' last half'
17- ]
18-
197// --------------------- Windows Functions ----------------------------//
208
219def windowsBuild (String arch , String config , String pgo , boolean isBaseline ) {
@@ -39,7 +27,7 @@ def windowsBuild(String arch, String config, String pgo, boolean isBaseline) {
3927 stash name : " nt-${ arch} -${ pgo}${ baselineString} -test-artifacts" , includes : ' bin/tests/**'
4028}
4129
42- def windowsPerf (String arch , String config , String uploadString , String runType , String opt_level , String jit , String pgo , String scenario , boolean isBaseline , boolean isProfileOn , String testFolder ) {
30+ def windowsPerf (String arch , String config , String uploadString , String runType , String opt_level , String jit , String pgo , String scenario , boolean isBaseline , boolean isProfileOn , int slice ) {
4331 withCredentials([string(credentialsId : ' CoreCLR Perf BenchView Sas' , variable : ' BV_UPLOAD_SAS_TOKEN' )]) {
4432 checkout scm
4533 String baselineString = " "
@@ -52,11 +40,6 @@ def windowsPerf(String arch, String config, String uploadString, String runType,
5240 unstash " metadata"
5341 }
5442
55- String test = ' '
56- if (testFolder != ' all' ) {
57- test = testFolder
58- }
59-
6043 String pgoTestFlag = ((pgo == ' nopgo' ) ? ' -nopgo' : ' ' )
6144
6245 // We want to use the baseline metadata for baseline runs. We expect to find the submission metadata in
@@ -78,56 +61,34 @@ def windowsPerf(String arch, String config, String uploadString, String runType,
7861
7962 String runXUnitCommonArgs = " -arch ${ arch} -configuration ${ config} -generateBenchviewData \" %WORKSPACE%\\ Microsoft.Benchview.JSONFormat\\ tools\" ${ uploadString} ${ pgoTestFlag} -runtype ${ runType} ${ testEnv} -optLevel ${ opt_level} -jitName ${ jit} -outputdir \" %WORKSPACE%\\ bin\\ sandbox_logs\" "
8063 if (scenario == ' perf' ) {
81- String runXUnitPerfCommonArgs = " ${ runXUnitCommonArgs} -stabilityPrefix \" START \" CORECLR_PERF_RUN\" /B /WAIT /HIGH /AFFINITY 0x2\" "
82- if (test == ' first half ' || testFolder == ' all ' )
64+ String runXUnitPerfCommonArgs = " ${ runXUnitCommonArgs} -stabilityPrefix \" START \\\ " CORECLR_PERF_RUN\\ \" /B /WAIT /HIGH /AFFINITY 0x2\" "
65+ if (slice == -1 )
8366 {
8467 String runXUnitPerflabArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ performance\\ perflab\\ Perflab -library"
8568
8669 profileArg = isProfileOn ? " default+${ profileArg} +gcapi" : profileArg
87- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitPerflabArgs} -collectionFlags ${ profileArg} "
88- }
70+ bat " py tests\\ scripts\\ run-xunit-perf.py ${ runXUnitPerflabArgs} -collectionFlags ${ profileArg} "
8971
90- if (test == ' first half' ) {
91-
92- [
93- ' Burgers' ,
94- ' Devirtualization' ,
95- ' FractalPerf' ,
96- ' Inlining' ,
97- ' Layout'
98- ]. each { benchmark ->
99- String runXUnitCodeQualityArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ Jit\\ Performance\\ CodeQuality\\ ${ benchmark} "
100- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitCodeQualityArgs} -collectionFlags ${ profileArg} "
101- }
102- }
103- else if (test == ' last half' ) {
104- [
105- ' Linq' ,
106- ' Roslyn' ,
107- ' SciMark' ,
108- ' Serialization' ,
109- ' V8'
110- ]. each { benchmark ->
111- String runXUnitCodeQualityArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ Jit\\ Performance\\ CodeQuality\\ ${ benchmark} "
112- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitCodeQualityArgs} -collectionFlags ${ profileArg} "
113- }
72+ String runXUnitCodeQualityArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ Jit\\ Performance\\ CodeQuality\\ "
73+ bat " py tests\\ scripts\\ run-xunit-perf.py ${ runXUnitCodeQualityArgs} -collectionFlags ${ profileArg} "
11474 }
75+
11576 else {
116- String runXUnitCodeQualityArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ Jit \\ Performance \\ CodeQuality \\ ${ test } "
117- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitCodeQualityArgs} -collectionFlags ${ profileArg} "
77+ String runXUnitCodeQualityArgs = " ${ runXUnitPerfCommonArgs} -slice ${ slice } -sliceConfigFile \" %WORKSPACE% \\ tests \\ scripts \\ perf-slices.json \" - testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} "
78+ bat " py tests\\ scripts\\ run-xunit-perf.py ${ runXUnitCodeQualityArgs} -collectionFlags ${ profileArg} "
11879 }
11980 }
12081 else if (scenario == ' jitbench' ) {
12182 String runXUnitPerfCommonArgs = " ${ runXUnitCommonArgs} -stabilityPrefix \" START \" CORECLR_PERF_RUN\" /B /WAIT /HIGH\" -scenarioTest"
12283 runXUnitPerfCommonArgs = " ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ performance\\ Scenario\\ JitBench -group CoreCLR-Scenarios"
12384
12485 if (! (opt_level == ' min_opt' && isProfileOn)) {
125- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitPerfCommonArgs} -collectionFlags ${ profileArgs} "
86+ bat " py tests\\ scripts\\ run-xunit-perf.py ${ runXUnitPerfCommonArgs} -collectionFlags ${ profileArgs} "
12687 }
12788 }
12889 else if (scenario == ' illink' ) {
12990 String runXUnitPerfCommonArgs = " ${ runXUnitCommonArgs} -scenarioTest"
130- bat " tests\\ scripts\\ run-xunit-perf.cmd ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ performance\\ linkbench\\ linkbench -group ILLink -nowarmup"
91+ bat " py tests\\ scripts\\ run-xunit-perf.py ${ runXUnitPerfCommonArgs} -testBinLoc bin\\ tests\\ ${ os} .${ arch} .${ config} \\ performance\\ linkbench\\ linkbench -group ILLink -nowarmup"
13192 }
13293 archiveArtifacts allowEmptyArchive : false , artifacts :' bin/sandbox_logs/**,machinedata.json'
13394 }
@@ -192,7 +153,7 @@ def linuxPerf(String arch, String os, String config, String uploadString, String
192153 baselineString = " -baseline"
193154 }
194155
195- String pgoTestFlag = ((pgo == ' nopgo' ) ? ' -- nopgo' : ' ' )
156+ String pgoTestFlag = ((pgo == ' nopgo' ) ? ' -nopgo' : ' ' )
196157
197158 dir (' .' ) {
198159 unstash " linux-${ arch} -${ pgo}${ baselineString} -build-artifacts"
@@ -209,9 +170,13 @@ def linuxPerf(String arch, String os, String config, String uploadString, String
209170 sh " mv -f submission-metadata-baseline.json submission-metadata.json"
210171 }
211172
212- sh " ./tests/scripts/perf-prep.sh"
173+ sh " ./tests/scripts/perf-prep.sh --nocorefx "
213174 sh " ./init-tools.sh"
214- sh " ./tests/scripts/run-xunit-perf.sh --testRootDir=\"\$ {WORKSPACE}/bin/tests/Windows_NT.${ arch} .${ config} \" --optLevel=${ optLevel} ${ pgoTestFlag} --testNativeBinDir=\"\$ {WORKSPACE}/bin/obj/Linux.${ arch} .${ config} /tests\" --coreClrBinDir=\"\$ {WORKSPACE}/bin/Product/Linux.${ arch} .${ config} \" --mscorlibDir=\"\$ {WORKSPACE}/bin/Product/Linux.${ arch} .${ config} \" --coreFxBinDir=\"\$ {WORKSPACE}/corefx\" --runType=\" ${ runType} \" --benchViewOS=\" ${ os} \" --stabilityPrefix=\" taskset 0x00000002 nice --adjustment=-10\" --uploadToBenchview --generatebenchviewdata=\"\$ {WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools\" "
175+ sh " ./build-test.sh release $arch generatelayoutonly"
176+
177+ String runXUnitCommonArgs = " -arch ${ arch} -os Ubuntu16.04 -configuration ${ config} -stabilityPrefix \" taskset 0x00000002 nice --adjustment=-10\" -generateBenchviewData \"\$ {WORKSPACE}/tests/scripts/Microsoft.BenchView.JSONFormat/tools\" ${ uploadString} ${ pgoTestFlag} -runtype ${ runType} -optLevel ${ optLevel} -outputdir \"\$ {WORKSPACE}/bin/sandbox_logs\" "
178+
179+ sh " python3 ./tests/scripts/run-xunit-perf.py -testBinLoc bin/tests/Windows_NT.${ arch} .${ config} /JIT/Performance/CodeQuality ${ runXUnitCommonArgs} "
215180 archiveArtifacts allowEmptyArchive : false , artifacts :' bin/toArchive/**,machinedata.json'
216181 }
217182}
@@ -294,6 +259,11 @@ def innerLoopBuilds = [
294259 simpleNode(' Windows_NT' ,' latest' ) {
295260 windowsBuild(' x86' , config, ' pgo' , false )
296261 }
262+ },
263+ " linux x64 pgo build" : {
264+ simpleNode(' RHEL7.2' , ' latest-or-auto' ) {
265+ linuxBuild(' x64' , config, ' pgo' , false )
266+ }
297267 }
298268]
299269
@@ -312,11 +282,6 @@ if (!isPR()) {
312282 windowsBuild(' x86' , config, ' nopgo' , false )
313283 }
314284 },
315- " linux x64 pgo build" : {
316- simpleNode(' RHEL7.2' , ' latest-or-auto' ) {
317- linuxBuild(' x64' , config, ' pgo' , false )
318- }
319- },
320285 " linux x64 nopgo build" : {
321286 simpleNode(' RHEL7.2' , ' latest-or-auto' ) {
322287 linuxBuild(' x64' , config, ' nopgo' , false )
@@ -354,17 +319,26 @@ def innerLoopTests = [:]
354319[' x64' , ' x86' ]. each { arch ->
355320 [' full_opt' ]. each { opt_level ->
356321 [false ]. each { isBaseline ->
357- validTestFolders . each { benchmark ->
322+ [ 0 , 1 , 2 , 3 , 4 , 5 ] . each { slice ->
358323 String baseline = " "
359324 if (isBaseline) {
360325 baseline = " baseline"
361326 }
362327 if (isPR() || ! isBaseline) {
363- innerLoopTests[" windows ${ arch} ryujit ${ opt_level} pgo ${ benchmark }${ baseline} perf" ] = {
328+ innerLoopTests[" windows ${ arch} ryujit ${ opt_level} pgo ${ slice }${ baseline} perf" ] = {
364329 simpleNode(' windows_server_2016_clr_perf' , 180 ) {
365- windowsPerf(arch, config, uploadString, runType, opt_level, ' ryujit' , ' pgo' , ' perf' , isBaseline, true , benchmark )
330+ windowsPerf(arch, config, uploadString, runType, opt_level, ' ryujit' , ' pgo' , ' perf' , isBaseline, true , slice )
366331 }
367332 }
333+
334+ }
335+ }
336+
337+ if (arch == ' x64' ) {
338+ innerLoopTests[" linux ${ arch} ryujit ${ opt_level} pgo perf" ] = {
339+ simpleNode(' ubuntu_1604_clr_perf' , 180 ) {
340+ linuxPerf(arch, ' Ubuntu16.04' , config, uploadString, runType, opt_level, ' pgo' , false )
341+ }
368342 }
369343 }
370344 }
@@ -376,15 +350,15 @@ def outerLoopTests = [:]
376350
377351if (! isPR()) {
378352 [' x64' , ' x86' ]. each { arch ->
379- outerLoopTests[" windows ${ arch} ryujit full_opt pgo jitbench" ] = {
353+ outerLoopTests[" windows ${ arch} ryujit full_opt pgo${ baseline } jitbench" ] = {
380354 simpleNode(' windows_server_2016_clr_perf' , 180 ) {
381- windowsPerf(arch, config, uploadString, runType, ' full_opt' , ' ryujit' , ' pgo' , ' jitbench' , false , false , ' ' )
355+ windowsPerf(arch, config, uploadString, runType, ' full_opt' , ' ryujit' , ' pgo' , ' jitbench' , false , false , -1 )
382356 }
383357 }
384358
385359 outerLoopTests[" windows ${ arch} ryujit full_opt pgo illink" ] = {
386360 simpleNode(' Windows_NT' , ' 20170427-elevated' ) {
387- windowsPerf(arch, config, uploadString, runType, ' full_opt' , ' ryujit' , ' pgo' , ' illink' , false , false , ' ' )
361+ windowsPerf(arch, config, uploadString, runType, ' full_opt' , ' ryujit' , ' pgo' , ' illink' , false , false , -1 )
388362 }
389363 }
390364 }
@@ -396,7 +370,7 @@ if (!isPR()) {
396370 [true , false ]. each { isProfileOn ->
397371 outerLoopTests[" windows ${ arch} ${ jit} ${ opt_level} ${ pgo_enabled} perf" ] = {
398372 simpleNode(' windows_server_2016_clr_perf' , 180 ) {
399- windowsPerf(arch, config, uploadString, runType, opt_level, jit, pgo_enabled, ' perf' , false , isProfileOn, ' all ' )
373+ windowsPerf(arch, config, uploadString, runType, opt_level, jit, pgo_enabled, ' perf' , false , isProfileOn, -1 )
400374 }
401375 }
402376
0 commit comments