Skip to content

Commit

Permalink
Run kernel mode perf tests with a kernel mode client (microsoft#1501)
Browse files Browse the repository at this point in the history
* Run kernel mode perf tests with a kernel mode client

* fix user mode tests
  • Loading branch information
ThadHouse authored Apr 23, 2021
1 parent c2e5bfe commit f1dc5cc
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/performance-helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,21 @@ function Get-ExeName {

function Remove-PerfServices {
if ($IsWindows) {
if ($null -ne (Get-Service -Name "secnetperfdrvpriv" -ErrorAction Ignore)) {
try {
net.exe stop secnetperfdrvpriv /y | Out-Null
}
catch {}
sc.exe delete secnetperfdrvpriv /y | Out-Null
}
if ($null -ne (Get-Service -Name "msquicpriv" -ErrorAction Ignore)) {
try {
net.exe stop msquicpriv /y | Out-Null
}
catch {}
sc.exe delete msquicpriv /y | Out-Null
}

Invoke-TestCommand -Session $Session -ScriptBlock {
if ($null -ne (Get-Service -Name "secnetperfdrvpriv" -ErrorAction Ignore)) {
try {
Expand Down
17 changes: 17 additions & 0 deletions scripts/performance.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@ function Invoke-Test {
$RemoteArguments += " -stats:1"
}

if ($Kernel) {
$Arch = Split-Path (Split-Path $LocalExe -Parent) -Leaf
$RootBinPath = Split-Path (Split-Path (Split-Path $LocalExe -Parent) -Parent) -Parent
$KernelDir = Join-Path $RootBinPath "winkernel" $Arch

Copy-Item (Join-Path $KernelDir "secnetperfdrvpriv.sys") (Split-Path $LocalExe -Parent)
Copy-Item (Join-Path $KernelDir "msquicpriv.sys") (Split-Path $LocalExe -Parent)

$LocalArguments = "-driverNamePriv:secnetperfdrvpriv $LocalArguments"
}

Write-LogAndDebug "Running Remote: $RemoteExe Args: $RemoteArguments"

# Starting the server
Expand Down Expand Up @@ -438,6 +449,12 @@ function Invoke-Test {
$LocalResults | Write-LogAndDebug
}
} finally {
if ($Kernel) {
net.exe stop msquicpriv /y | Out-Null
sc.exe delete msquictestpriv | Out-Null
sc.exe delete msquicpriv | Out-Null
}

$RemoteResults = Wait-ForRemote -Job $RemoteJob
Write-LogAndDebug $RemoteResults.ToString()

Expand Down

0 comments on commit f1dc5cc

Please sign in to comment.