Skip to content

Commit

Permalink
remove use of sudo here
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectsByJackHe committed Jan 28, 2025
1 parent b314e22 commit a3b5e33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/secnetperf-helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ function Wait-StartRemoteServerPassive {
# Creates a new local process to asynchronously run the test.
function Start-LocalTest {
param ($FullPath, $FullArgs, $OutputDir, $UseSudo, $LinuxPerfPrefix)
Write-Host "Starting Localtest with LinuxPerfPrefix: $LinuxPerfPrefix"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
if ($isWindows) {
$pinfo.FileName = $FullPath
Expand Down Expand Up @@ -621,7 +622,7 @@ function Invoke-Secnetperf {
if ($IsWindows) {
wpr -start CPU
} else {
$env:linux_perf_prefix = "sudo perf record -o cpu-traces-$scenario-$io-istcp-$tcp.data -- "
$env:linux_perf_prefix = "perf record -o cpu-traces-$scenario-$io-istcp-$tcp.data -- "
}
NetperfSendCommand "Start_Server_CPU_Tracing;$scenario-$io-istcp-$tcp.data"
NetperfWaitServerFinishExecution
Expand All @@ -641,6 +642,7 @@ function Invoke-Secnetperf {
Write-Host "==============================`nRUN $($try+1):"
"> secnetperf $clientArgs" | Add-Content $clientOut
try {
Write-Host "About to start localtest with linux_perf_prefix: $env:linux_perf_prefix"
$process = Start-LocalTest "$clientPath" $clientArgs $artifactDir $useSudo $env:linux_perf_prefix
$rawOutput = Wait-LocalTest $process $artifactDir ($io -eq "wsk") 30000
Write-Host $rawOutput
Expand Down

0 comments on commit a3b5e33

Please sign in to comment.