From de84865c821c91fb1bf05146cf64058633acb91a Mon Sep 17 00:00:00 2001 From: Michelle McDaniel Date: Tue, 14 Feb 2017 10:11:56 -0800 Subject: [PATCH] Add perf job for legacy jit Add performance testing jobs for jit32. This change adds jit32 as an architecture for perf.groovy. It also renames the x86 legs to be x86ryujit. For the two x86-based architectures, we pass a testenv. This is so if we have to switch which version is the default jit on x86, we will not need to change the perf jobs, we can just update the testenv files. This change updates run-xunit-perf.cmd to take a test env script as a parameter and run it before running the tests if it exists. This change also cleans up some of the calls in perf.groovy to use variables that we've already set, rather than baking in the contents of those variables (changing Release to ${configuration}). --- perf.groovy | 29 +++++++++++++++++++++-------- tests/scripts/run-xunit-perf.cmd | 11 +++++++++++ 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/perf.groovy b/perf.groovy index 1eb9f19..3561e08 100644 --- a/perf.groovy +++ b/perf.groovy @@ -27,8 +27,21 @@ def static getOSGroup(def os) { // Setup perflab tests runs [true, false].each { isPR -> ['Windows_NT'].each { os -> - ['x64', 'x86'].each { architecture -> - def newJob = job(Utilities.getFullJobName(project, "perf_perflab_${os}_${architecture}", isPR)) { + ['x64', 'x86', 'x86jit32'].each { arch -> + architecture = arch + testEnv = '' + + if (arch == 'x86jit32') + { + architecture = 'x86' + testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\compatjit_x86_testenv.cmd' + } + else if (arch == 'x86') + { + testEnv = '-testEnv %WORKSPACE%\\tests\\x86\\ryujit_x86_testenv.cmd' + } + + def newJob = job(Utilities.getFullJobName(project, "perf_perflab_${os}_${arch}", isPR)) { // Set the label. label('windows_clr_perf') wrappers { @@ -59,10 +72,10 @@ def static getOSGroup(def os) { "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\submission-metadata.py\" --name " + "\"" + benchViewName + "\"" + " --user " + "\"dotnet-bot@microsoft.com\"\n" + "py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\build.py\" git --branch %GIT_BRANCH_WITHOUT_ORIGIN% --type " + runType) batchFile("py \"%WORKSPACE%\\Microsoft.BenchView.JSONFormat\\tools\\machinedata.py\"") - batchFile("set __TestIntermediateDir=int&&build.cmd release ${architecture}") - batchFile("tests\\runtest.cmd release ${architecture} GenerateLayoutOnly") - batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype " + runType) - batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} -testBinLoc bin\\tests\\Windows_NT.${architecture}.Release\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype " + runType) + batchFile("set __TestIntermediateDir=int&&build.cmd ${configuration} ${architecture}") + batchFile("tests\\runtest.cmd ${configuration} ${architecture} GenerateLayoutOnly") + batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\performance\\perflab\\Perflab -library -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}") + batchFile("tests\\scripts\\run-xunit-perf.cmd -arch ${architecture} -configuration ${configuration} ${testEnv} -testBinLoc bin\\tests\\Windows_NT.${architecture}.${configuration}\\Jit\\Performance\\CodeQuality -uploadToBenchview \"%WORKSPACE%\\Microsoft.Benchview.JSONFormat\\tools\" -runtype ${runType}") } } @@ -76,9 +89,9 @@ def static getOSGroup(def os) { if (isPR) { TriggerBuilder builder = TriggerBuilder.triggerOnPullRequest() - builder.setGithubContext("${os} ${architecture} CoreCLR Perf Tests") + builder.setGithubContext("${os} ${arch} CoreCLR Perf Tests") builder.triggerOnlyOnComment() - builder.setCustomTriggerPhrase("(?i).*test\\W+${os}_${architecture}\\W+perf.*") + builder.setCustomTriggerPhrase("(?i).*test\\W+${os}_${arch}\\W+perf.*") builder.triggerForBranch(branch) builder.emitTrigger(newJob) } diff --git a/tests/scripts/run-xunit-perf.cmd b/tests/scripts/run-xunit-perf.cmd index 060ba33..2ca22f8 100644 --- a/tests/scripts/run-xunit-perf.cmd +++ b/tests/scripts/run-xunit-perf.cmd @@ -78,6 +78,11 @@ xcopy /s %BENCHDIR%*.txt . >> %RUNLOG% set CORE_ROOT=%CORECLR_REPO%\sandbox +@rem setup additional environment variables +if EXIST %TEST_ENV% ( + call %TEST_ENV% +) + xunit.performance.run.exe %BENCHNAME%.%TEST_FILE_EXT% -runner xunit.console.netcore.exe -runnerhost corerun.exe -verbose -runid %PERFOUT% > %BENCHNAME%.out xunit.performance.analysis.exe %PERFOUT%.xml -xml %XMLOUT% > %BENCHNAME%-analysis.out @@ -126,6 +131,12 @@ shift shift goto :ARGLOOP ) +IF /I [%1] == [-testEnv] ( +set TEST_ENV=%2 +shift +shift +goto :ARGLOOP +) IF /I [%1] == [-configuration] ( set TEST_CONFIG=%2 shift -- 2.7.4